Domains - Create Or Update

Create or update a domain.
Asynchronously creates or updates a new domain with the specified parameters.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}?api-version=2022-06-15

URI Parameters

Name In Required Type Description
domainName
path True

string

Name of the domain.

resourceGroupName
path True

string

The name of the resource group within the user's subscription.

subscriptionId
path True

string

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True

string

Version of the API to be used with the client request.

Request Body

Name Required Type Description
location True

string

Location of the resource.

identity

IdentityInfo

Identity information for the Event Grid Domain resource.

properties.autoCreateTopicWithFirstSubscription

boolean

This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription is created at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topic by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides the flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create the domain topic on demand if needed.

properties.autoDeleteTopicWithLastSubscription

boolean

This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scope of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants full control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewer resources by the user.

properties.dataResidencyBoundary

DataResidencyBoundary

Data Residency Boundary of the resource.

properties.disableLocalAuth

boolean

This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.

properties.inboundIpRules

InboundIpRule[]

This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.

properties.inputSchema

InputSchema

This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource.

properties.inputSchemaMapping InputSchemaMapping:

JsonInputSchemaMapping

Information about the InputSchemaMapping which specified the info about mapping event payload.

properties.publicNetworkAccess

PublicNetworkAccess

This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring

tags

object

Tags of the resource.

Responses

Name Type Description
201 Created

Domain

Created

Other Status Codes

*** Error Responses: ***

  • 400 Bad Request.

  • 500 Internal Server Error.

Examples

Domains_CreateOrUpdate

Sample request

PUT https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampledomain1?api-version=2022-06-15

{
  "location": "westus2",
  "tags": {
    "tag1": "value1",
    "tag2": "value2"
  },
  "properties": {
    "publicNetworkAccess": "Enabled",
    "inboundIpRules": [
      {
        "ipMask": "12.18.30.15",
        "action": "Allow"
      },
      {
        "ipMask": "12.18.176.1",
        "action": "Allow"
      }
    ]
  }
}

Sample response

{
  "properties": {
    "endpoint": "https://exampledomain1.westus2-1.eventgrid.azure.net/api/events",
    "provisioningState": "Succeeded",
    "publicNetworkAccess": "Enabled",
    "inboundIpRules": [
      {
        "ipMask": "12.18.30.15",
        "action": "Allow"
      },
      {
        "ipMask": "12.18.176.1",
        "action": "Allow"
      }
    ]
  },
  "id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampledomain1",
  "location": "westus2",
  "name": "exampledomain1",
  "tags": {
    "tag1": "value1",
    "tag2": "value2"
  },
  "type": "Microsoft.EventGrid/domains"
}

Definitions

Name Description
ConnectionState

ConnectionState information.

createdByType

The type of identity that created the resource.

DataResidencyBoundary

Data Residency Boundary of the resource.

Domain

EventGrid Domain.

DomainProvisioningState

Provisioning state of the Event Grid Domain Resource.

IdentityInfo

The identity information for the resource.

IdentityType

The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity.

InboundIpRule
InputSchema

This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource.

IpActionType

Action to perform based on the match or no match of the IpMask.

JsonField

This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'id', 'topic' and 'eventtime' properties. This represents a field in the input event schema.

JsonFieldWithDefault

This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'subject', 'eventtype' and 'dataversion' properties. This represents a field in the input event schema along with a default value to be used, and at least one of these two properties should be provided.

JsonInputSchemaMapping

This enables publishing to Event Grid using a custom input schema. This can be used to map properties from a custom input JSON schema to the Event Grid event schema.

PersistedConnectionStatus

Status of the connection.

PrivateEndpoint

PrivateEndpoint information.

PrivateEndpointConnection
PublicNetworkAccess

This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring

ResourceProvisioningState

Provisioning state of the Private Endpoint Connection.

systemData

Metadata pertaining to creation and last modification of the resource.

UserIdentityProperties

The information about the user identity.

ConnectionState

ConnectionState information.

Name Type Description
actionsRequired

string

Actions required (if any).

description

string

Description of the connection state.

status

PersistedConnectionStatus

Status of the connection.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

DataResidencyBoundary

Data Residency Boundary of the resource.

Name Type Description
WithinGeopair

string

WithinRegion

string

Domain

EventGrid Domain.

Name Type Default value Description
id

string

Fully qualified identifier of the resource.

identity

IdentityInfo

Identity information for the Event Grid Domain resource.

location

string

Location of the resource.

name

string

Name of the resource.

properties.autoCreateTopicWithFirstSubscription

boolean

True

This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription is created at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topic by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides the flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create the domain topic on demand if needed.

properties.autoDeleteTopicWithLastSubscription

boolean

True

This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scope of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants full control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewer resources by the user.

properties.dataResidencyBoundary

DataResidencyBoundary

Data Residency Boundary of the resource.

properties.disableLocalAuth

boolean

False

This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.

properties.endpoint

string

Endpoint for the Event Grid Domain Resource which is used for publishing the events.

properties.inboundIpRules

InboundIpRule[]

This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.

properties.inputSchema

InputSchema

EventGridSchema

This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource.

properties.inputSchemaMapping InputSchemaMapping:

JsonInputSchemaMapping

Information about the InputSchemaMapping which specified the info about mapping event payload.

properties.metricResourceId

string

Metric resource id for the Event Grid Domain Resource.

properties.privateEndpointConnections

PrivateEndpointConnection[]

List of private endpoint connections.

properties.provisioningState

DomainProvisioningState

Provisioning state of the Event Grid Domain Resource.

properties.publicNetworkAccess

PublicNetworkAccess

Enabled

This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring

systemData

systemData

The system metadata relating to the Event Grid Domain resource.

tags

object

Tags of the resource.

type

string

Type of the resource.

DomainProvisioningState

Provisioning state of the Event Grid Domain Resource.

Name Type Description
Canceled

string

Creating

string

Deleting

string

Failed

string

Succeeded

string

Updating

string

IdentityInfo

The identity information for the resource.

Name Type Description
principalId

string

The principal ID of resource identity.

tenantId

string

The tenant ID of resource.

type

IdentityType

The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity.

userAssignedIdentities

<string,  UserIdentityProperties>

The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. This property is currently not used and reserved for future usage.

IdentityType

The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity.

Name Type Description
None

string

SystemAssigned

string

SystemAssigned, UserAssigned

string

UserAssigned

string

InboundIpRule

Name Type Description
action

IpActionType

Action to perform based on the match or no match of the IpMask.

ipMask

string

IP Address in CIDR notation e.g., 10.0.0.0/8.

InputSchema

This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource.

Name Type Description
CloudEventSchemaV1_0

string

CustomEventSchema

string

EventGridSchema

string

IpActionType

Action to perform based on the match or no match of the IpMask.

Name Type Description
Allow

string

JsonField

This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'id', 'topic' and 'eventtime' properties. This represents a field in the input event schema.

Name Type Description
sourceField

string

Name of a field in the input event schema that's to be used as the source of a mapping.

JsonFieldWithDefault

This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'subject', 'eventtype' and 'dataversion' properties. This represents a field in the input event schema along with a default value to be used, and at least one of these two properties should be provided.

Name Type Description
defaultValue

string

The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.

sourceField

string

Name of a field in the input event schema that's to be used as the source of a mapping.

JsonInputSchemaMapping

This enables publishing to Event Grid using a custom input schema. This can be used to map properties from a custom input JSON schema to the Event Grid event schema.

Name Type Description
inputSchemaMappingType string:

Json

Type of the custom mapping

properties.dataVersion

JsonFieldWithDefault

The mapping information for the DataVersion property of the Event Grid Event.

properties.eventTime

JsonField

The mapping information for the EventTime property of the Event Grid Event.

properties.eventType

JsonFieldWithDefault

The mapping information for the EventType property of the Event Grid Event.

properties.id

JsonField

The mapping information for the Id property of the Event Grid Event.

properties.subject

JsonFieldWithDefault

The mapping information for the Subject property of the Event Grid Event.

properties.topic

JsonField

The mapping information for the Topic property of the Event Grid Event.

PersistedConnectionStatus

Status of the connection.

Name Type Description
Approved

string

Disconnected

string

Pending

string

Rejected

string

PrivateEndpoint

PrivateEndpoint information.

Name Type Description
id

string

The ARM identifier for Private Endpoint.

PrivateEndpointConnection

Name Type Description
id

string

Fully qualified identifier of the resource.

name

string

Name of the resource.

properties.groupIds

string[]

GroupIds from the private link service resource.

properties.privateEndpoint

PrivateEndpoint

The Private Endpoint resource for this Connection.

properties.privateLinkServiceConnectionState

ConnectionState

Details about the state of the connection.

properties.provisioningState

ResourceProvisioningState

Provisioning state of the Private Endpoint Connection.

type

string

Type of the resource.

PublicNetworkAccess

This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring

Name Type Description
Disabled

string

Enabled

string

ResourceProvisioningState

Provisioning state of the Private Endpoint Connection.

Name Type Description
Canceled

string

Creating

string

Deleting

string

Failed

string

Succeeded

string

Updating

string

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

UserIdentityProperties

The information about the user identity.

Name Type Description
clientId

string

The client id of user assigned identity.

principalId

string

The principal id of user assigned identity.