共用方式為


Microsoft.EventGrid 主題 2022-06-15

Bicep 資源定義

主題資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.EventGrid/topics 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.EventGrid/topics@2022-06-15' = {
  identity: {
    principalId: 'string'
    tenantId: 'string'
    type: 'string'
    userAssignedIdentities: {
      {customized property}: {
        clientId: 'string'
        principalId: 'string'
      }
    }
  }
  location: 'string'
  name: 'string'
  properties: {
    dataResidencyBoundary: 'string'
    disableLocalAuth: bool
    inboundIpRules: [
      {
        action: 'string'
        ipMask: 'string'
      }
    ]
    inputSchema: 'string'
    inputSchemaMapping: {
      inputSchemaMappingType: 'string'
      // For remaining properties, see InputSchemaMapping objects
    }
    publicNetworkAccess: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

InputSchemaMapping 物件

設定 inputSchemaMappingType 屬性來指定物件的類型

針對 Json,請使用:

{
  inputSchemaMappingType: 'Json'
  properties: {
    dataVersion: {
      defaultValue: 'string'
      sourceField: 'string'
    }
    eventTime: {
      sourceField: 'string'
    }
    eventType: {
      defaultValue: 'string'
      sourceField: 'string'
    }
    id: {
      sourceField: 'string'
    }
    subject: {
      defaultValue: 'string'
      sourceField: 'string'
    }
    topic: {
      sourceField: 'string'
    }
  }
}

屬性值

IdentityInfo

名字 描述 價值
principalId 資源識別的主要標識碼。 字串
tenantId 資源的租用戶標識碼。 字串
類型 所使用的受控識別類型。 類型 'SystemAssigned, UserAssigned' 包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 『None』 將會移除任何身分識別。 'None'
'SystemAssigned'
'SystemAssigned, UserAssigned'
'UserAssigned'
userAssignedIdentities 與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源識別碼:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。
此屬性目前未使用,並保留供日後使用。
IdentityInfoUserAssignedIdentities

IdentityInfoUserAssignedIdentities

名字 描述 價值

InboundIpRule

名字 描述 價值
行動 根據相符專案或 IpMask 不相符執行的動作。 'Allow'
ipMask CIDR 表示法中的IP位址,例如10.0.0.0.0/8。 字串

InputSchemaMapping

名字 描述 價值
inputSchemaMappingType 針對 jsonInputSchemaMapping 類型設定為 'Json', 'Json' (必要)

JsonField

名字 描述 價值
sourceField 輸入事件架構中要作為對應來源的功能變數名稱。 字串

JsonFieldWithDefault

名字 描述 價值
defaultValue 未提供SourceField時要用於對應的預設值,如果已發佈的 JSON 事件承載中沒有具有指定名稱的屬性,則為 。 字串
sourceField 輸入事件架構中要作為對應來源的功能變數名稱。 字串

JsonInputSchemaMapping

名字 描述 價值
inputSchemaMappingType 自定義對應的類型 'Json' (必要)
性能 輸入架構對應的 JSON 屬性 JsonInputSchemaMappingProperties

JsonInputSchemaMappingProperties

名字 描述 價值
dataVersion 事件方格事件之 DataVersion 屬性的對應資訊。 JsonFieldWithDefault
eventTime Event Grid 事件之 EventTime 屬性的對應資訊。 JsonField
eventType Event Grid 事件之 EventType 屬性的對應資訊。 JsonFieldWithDefault
id 事件方格事件的Id屬性對應資訊。 JsonField
主題 事件方格事件之 Subject 屬性的對應資訊。 JsonFieldWithDefault
主題 事件方格事件之 Topic 屬性的對應資訊。 JsonField

Microsoft.EventGrid/topics

名字 描述 價值
身份 資源的身分識別資訊。 IdentityInfo
位置 資源的位置。 字串 (必要)
名字 資源名稱 字串 (必要)
性能 主題的屬性。 TopicProperties
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤

TopicProperties

名字 描述 價值
dataResidencyBoundary 資源的數據落地界限。 'WithinGeopair'
'WithinRegion'
disableLocalAuth 此布爾值是用來啟用或停用本機驗證。默認值為 false。 當 屬性設定為 true 時,如果允許使用者發佈至主題,則只會使用 AAD 令牌進行驗證。 bool
inboundIpRules 這可用來限制來自特定IP的流量,而不是所有IP的流量。 注意:只有在啟用 PublicNetworkAccess 時,才會考慮這些專案。 InboundIpRule[]
inputSchema 這會決定事件方格針對發佈至主題的連入事件所應預期的格式。 'CloudEventSchemaV1_0'
'CustomEventSchema'
'EventGridSchema'
inputSchemaMapping 這可讓您使用自定義事件架構發佈。 您可以指定 InputSchemaMapping,將來源架構的各種屬性對應至 EventGridEvent 架構的各種必要屬性。 InputSchemaMapping
publicNetworkAccess 這會判斷是否允許透過公用網路傳輸流量。 默認會啟用。
您可以設定 <seealso cref=“P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicProperties.InboundIpRules” />
'Disabled'
'Enabled'

TrackedResourceTags

名字 描述 價值

UserIdentityProperties

名字 描述 價值
clientId 使用者指派身分識別的用戶端標識碼。 字串
principalId 使用者指派身分識別的主體標識碼。 字串

快速入門範例

下列快速入門範例會部署此資源類型。

Bicep 檔案 描述
建立 Azure 事件方格自定義主題和佇列訂用帳戶 建立 Azure 事件方格自定義主題和服務總線佇列訂用帳戶。 範本最初由 Markus Meyer 撰寫。
建立 Azure 事件方格自定義主題和訂用帳戶 建立 Azure 事件方格自定義主題和 Webhook 訂用帳戶。 範本最初由John Downs 撰寫。

ARM 樣本資源定義

主題資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.EventGrid/topics 資源,請將下列 JSON 新增至您的範本。

{
  "type": "Microsoft.EventGrid/topics",
  "apiVersion": "2022-06-15",
  "name": "string",
  "identity": {
    "principalId": "string",
    "tenantId": "string",
    "type": "string",
    "userAssignedIdentities": {
      "{customized property}": {
        "clientId": "string",
        "principalId": "string"
      }
    }
  },
  "location": "string",
  "properties": {
    "dataResidencyBoundary": "string",
    "disableLocalAuth": "bool",
    "inboundIpRules": [
      {
        "action": "string",
        "ipMask": "string"
      }
    ],
    "inputSchema": "string",
    "inputSchemaMapping": {
      "inputSchemaMappingType": "string"
      // For remaining properties, see InputSchemaMapping objects
    },
    "publicNetworkAccess": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

InputSchemaMapping 物件

設定 inputSchemaMappingType 屬性來指定物件的類型

針對 Json,請使用:

{
  "inputSchemaMappingType": "Json",
  "properties": {
    "dataVersion": {
      "defaultValue": "string",
      "sourceField": "string"
    },
    "eventTime": {
      "sourceField": "string"
    },
    "eventType": {
      "defaultValue": "string",
      "sourceField": "string"
    },
    "id": {
      "sourceField": "string"
    },
    "subject": {
      "defaultValue": "string",
      "sourceField": "string"
    },
    "topic": {
      "sourceField": "string"
    }
  }
}

屬性值

IdentityInfo

名字 描述 價值
principalId 資源識別的主要標識碼。 字串
tenantId 資源的租用戶標識碼。 字串
類型 所使用的受控識別類型。 類型 'SystemAssigned, UserAssigned' 包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 『None』 將會移除任何身分識別。 'None'
'SystemAssigned'
'SystemAssigned, UserAssigned'
'UserAssigned'
userAssignedIdentities 與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源識別碼:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。
此屬性目前未使用,並保留供日後使用。
IdentityInfoUserAssignedIdentities

IdentityInfoUserAssignedIdentities

名字 描述 價值

InboundIpRule

名字 描述 價值
行動 根據相符專案或 IpMask 不相符執行的動作。 'Allow'
ipMask CIDR 表示法中的IP位址,例如10.0.0.0.0/8。 字串

InputSchemaMapping

名字 描述 價值
inputSchemaMappingType 針對 jsonInputSchemaMapping 類型設定為 'Json', 'Json' (必要)

JsonField

名字 描述 價值
sourceField 輸入事件架構中要作為對應來源的功能變數名稱。 字串

JsonFieldWithDefault

名字 描述 價值
defaultValue 未提供SourceField時要用於對應的預設值,如果已發佈的 JSON 事件承載中沒有具有指定名稱的屬性,則為 。 字串
sourceField 輸入事件架構中要作為對應來源的功能變數名稱。 字串

JsonInputSchemaMapping

名字 描述 價值
inputSchemaMappingType 自定義對應的類型 'Json' (必要)
性能 輸入架構對應的 JSON 屬性 JsonInputSchemaMappingProperties

JsonInputSchemaMappingProperties

名字 描述 價值
dataVersion 事件方格事件之 DataVersion 屬性的對應資訊。 JsonFieldWithDefault
eventTime Event Grid 事件之 EventTime 屬性的對應資訊。 JsonField
eventType Event Grid 事件之 EventType 屬性的對應資訊。 JsonFieldWithDefault
id 事件方格事件的Id屬性對應資訊。 JsonField
主題 事件方格事件之 Subject 屬性的對應資訊。 JsonFieldWithDefault
主題 事件方格事件之 Topic 屬性的對應資訊。 JsonField

Microsoft.EventGrid/topics

名字 描述 價值
apiVersion API 版本 '2022-06-15'
身份 資源的身分識別資訊。 IdentityInfo
位置 資源的位置。 字串 (必要)
名字 資源名稱 字串 (必要)
性能 主題的屬性。 TopicProperties
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤
類型 資源類型 'Microsoft.EventGrid/topics'

TopicProperties

名字 描述 價值
dataResidencyBoundary 資源的數據落地界限。 'WithinGeopair'
'WithinRegion'
disableLocalAuth 此布爾值是用來啟用或停用本機驗證。默認值為 false。 當 屬性設定為 true 時,如果允許使用者發佈至主題,則只會使用 AAD 令牌進行驗證。 bool
inboundIpRules 這可用來限制來自特定IP的流量,而不是所有IP的流量。 注意:只有在啟用 PublicNetworkAccess 時,才會考慮這些專案。 InboundIpRule[]
inputSchema 這會決定事件方格針對發佈至主題的連入事件所應預期的格式。 'CloudEventSchemaV1_0'
'CustomEventSchema'
'EventGridSchema'
inputSchemaMapping 這可讓您使用自定義事件架構發佈。 您可以指定 InputSchemaMapping,將來源架構的各種屬性對應至 EventGridEvent 架構的各種必要屬性。 InputSchemaMapping
publicNetworkAccess 這會判斷是否允許透過公用網路傳輸流量。 默認會啟用。
您可以設定 <seealso cref=“P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicProperties.InboundIpRules” />
'Disabled'
'Enabled'

TrackedResourceTags

名字 描述 價值

UserIdentityProperties

名字 描述 價值
clientId 使用者指派身分識別的用戶端標識碼。 字串
principalId 使用者指派身分識別的主體標識碼。 字串

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
建立 Azure 事件方格自定義主題和佇列訂用帳戶

部署至 Azure
建立 Azure 事件方格自定義主題和服務總線佇列訂用帳戶。 範本最初由 Markus Meyer 撰寫。
建立 Azure 事件方格自定義主題和訂用帳戶

部署至 Azure
建立 Azure 事件方格自定義主題和 Webhook 訂用帳戶。 範本最初由John Downs 撰寫。
建立 Azure 事件方格自定義主題訂用帳戶

部署至 Azure
建立 Azure 事件方格自定義主題和服務總線主題訂用帳戶。 範本最初由 Markus Meyer 撰寫。
建立事件方格自定義主題和事件中樞處理程式

部署至 Azure
建立 Azure 事件方格自定義主題和事件中樞來處理事件。
使用 CloudEvents 自定義 Azure 事件方格主題/訂用帳戶

部署至 Azure
建立自定義 Azure 事件方格主題、具有 CloudEvents 架構的 Webhook 訂用帳戶,以及邏輯應用程式作為事件處理程式。 範本最初由 Justin Yoo 撰寫。

Terraform (AzAPI 提供者) 資源定義

主題資源類型可以使用目標作業來部署:

  • 資源群組

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.EventGrid/topics 資源,請將下列 Terraform 新增至您的範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.EventGrid/topics@2022-06-15"
  name = "string"
  identity = {
    principalId = "string"
    tenantId = "string"
    type = "string"
    userAssignedIdentities = {
      {customized property} = {
        clientId = "string"
        principalId = "string"
      }
    }
  }
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = jsonencode({
    properties = {
      dataResidencyBoundary = "string"
      disableLocalAuth = bool
      inboundIpRules = [
        {
          action = "string"
          ipMask = "string"
        }
      ]
      inputSchema = "string"
      inputSchemaMapping = {
        inputSchemaMappingType = "string"
        // For remaining properties, see InputSchemaMapping objects
      }
      publicNetworkAccess = "string"
    }
  })
}

InputSchemaMapping 物件

設定 inputSchemaMappingType 屬性來指定物件的類型

針對 Json,請使用:

{
  inputSchemaMappingType = "Json"
  properties = {
    dataVersion = {
      defaultValue = "string"
      sourceField = "string"
    }
    eventTime = {
      sourceField = "string"
    }
    eventType = {
      defaultValue = "string"
      sourceField = "string"
    }
    id = {
      sourceField = "string"
    }
    subject = {
      defaultValue = "string"
      sourceField = "string"
    }
    topic = {
      sourceField = "string"
    }
  }
}

屬性值

IdentityInfo

名字 描述 價值
principalId 資源識別的主要標識碼。 字串
tenantId 資源的租用戶標識碼。 字串
類型 所使用的受控識別類型。 類型 'SystemAssigned, UserAssigned' 包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 『None』 將會移除任何身分識別。 'None'
'SystemAssigned'
'SystemAssigned, UserAssigned'
'UserAssigned'
userAssignedIdentities 與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源識別碼:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。
此屬性目前未使用,並保留供日後使用。
IdentityInfoUserAssignedIdentities

IdentityInfoUserAssignedIdentities

名字 描述 價值

InboundIpRule

名字 描述 價值
行動 根據相符專案或 IpMask 不相符執行的動作。 'Allow'
ipMask CIDR 表示法中的IP位址,例如10.0.0.0.0/8。 字串

InputSchemaMapping

名字 描述 價值
inputSchemaMappingType 針對 jsonInputSchemaMapping 類型設定為 'Json', 'Json' (必要)

JsonField

名字 描述 價值
sourceField 輸入事件架構中要作為對應來源的功能變數名稱。 字串

JsonFieldWithDefault

名字 描述 價值
defaultValue 未提供SourceField時要用於對應的預設值,如果已發佈的 JSON 事件承載中沒有具有指定名稱的屬性,則為 。 字串
sourceField 輸入事件架構中要作為對應來源的功能變數名稱。 字串

JsonInputSchemaMapping

名字 描述 價值
inputSchemaMappingType 自定義對應的類型 'Json' (必要)
性能 輸入架構對應的 JSON 屬性 JsonInputSchemaMappingProperties

JsonInputSchemaMappingProperties

名字 描述 價值
dataVersion 事件方格事件之 DataVersion 屬性的對應資訊。 JsonFieldWithDefault
eventTime Event Grid 事件之 EventTime 屬性的對應資訊。 JsonField
eventType Event Grid 事件之 EventType 屬性的對應資訊。 JsonFieldWithDefault
id 事件方格事件的Id屬性對應資訊。 JsonField
主題 事件方格事件之 Subject 屬性的對應資訊。 JsonFieldWithDefault
主題 事件方格事件之 Topic 屬性的對應資訊。 JsonField

Microsoft.EventGrid/topics

名字 描述 價值
身份 資源的身分識別資訊。 IdentityInfo
位置 資源的位置。 字串 (必要)
名字 資源名稱 字串 (必要)
性能 主題的屬性。 TopicProperties
標籤 資源標籤 標記名稱和值的字典。
類型 資源類型 “Microsoft.EventGrid/topics@2022-06-15”

TopicProperties

名字 描述 價值
dataResidencyBoundary 資源的數據落地界限。 'WithinGeopair'
'WithinRegion'
disableLocalAuth 此布爾值是用來啟用或停用本機驗證。默認值為 false。 當 屬性設定為 true 時,如果允許使用者發佈至主題,則只會使用 AAD 令牌進行驗證。 bool
inboundIpRules 這可用來限制來自特定IP的流量,而不是所有IP的流量。 注意:只有在啟用 PublicNetworkAccess 時,才會考慮這些專案。 InboundIpRule[]
inputSchema 這會決定事件方格針對發佈至主題的連入事件所應預期的格式。 'CloudEventSchemaV1_0'
'CustomEventSchema'
'EventGridSchema'
inputSchemaMapping 這可讓您使用自定義事件架構發佈。 您可以指定 InputSchemaMapping,將來源架構的各種屬性對應至 EventGridEvent 架構的各種必要屬性。 InputSchemaMapping
publicNetworkAccess 這會判斷是否允許透過公用網路傳輸流量。 默認會啟用。
您可以設定 <seealso cref=“P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicProperties.InboundIpRules” />
'Disabled'
'Enabled'

TrackedResourceTags

名字 描述 價值

UserIdentityProperties

名字 描述 價值
clientId 使用者指派身分識別的用戶端標識碼。 字串
principalId 使用者指派身分識別的主體標識碼。 字串