az eventgrid topic
管理 Azure 事件方格主題。
命令
名稱 | Description | 類型 | 狀態 |
---|---|---|---|
az eventgrid topic create |
建立主題。 |
Core | GA |
az eventgrid topic delete |
刪除主題。 |
Core | GA |
az eventgrid topic event-subscription |
管理主題的事件訂閱。 |
Core | GA |
az eventgrid topic event-subscription create |
建立主題的新事件訂用帳戶。 |
Core | GA |
az eventgrid topic event-subscription delete |
刪除主題的事件訂閱。 |
Core | GA |
az eventgrid topic event-subscription list |
列出特定主題的事件訂閱。 |
Core | GA |
az eventgrid topic event-subscription show |
取得主題的事件訂用帳戶詳細數據。 |
Core | GA |
az eventgrid topic event-subscription update |
更新主題的事件訂閱。 |
Core | GA |
az eventgrid topic key |
管理主題的共用存取金鑰。 |
Core | GA |
az eventgrid topic key list |
列出主題的共用存取金鑰。 |
Core | GA |
az eventgrid topic key regenerate |
重新產生主題的共用存取金鑰。 |
Core | GA |
az eventgrid topic list |
列出可用的主題。 |
Core | GA |
az eventgrid topic show |
取得主題的詳細數據。 |
Core | GA |
az eventgrid topic update |
更新主題。 |
Core | GA |
az eventgrid topic create
建立主題。
az eventgrid topic create --name
--resource-group
[--extended-location-name]
[--extended-location-type {customlocation}]
[--identity {noidentity, systemassigned}]
[--inbound-ip-rules]
[--input-mapping-default-values]
[--input-mapping-fields]
[--input-schema {cloudeventschemav1_0, customeventschema, eventgridschema}]
[--kind {azure, azurearc}]
[--location]
[--mi-system-assigned]
[--mi-user-assigned]
[--public-network-access {disabled, enabled}]
[--sku {basic, premium}]
[--tags]
範例
建立新的主題。
az eventgrid topic create -g rg1 --name topic1 -l westus2
使用自定義輸入對應建立新的主題。
az eventgrid topic create -g rg1 --name topic1 -l westus2 --input-schema customeventschema --input-mapping-fields topic=myTopicField eventType=myEventTypeField --input-mapping-default-values subject=DefaultSubject dataVersion=1.0
建立新的主題,以接受 CloudEvents V1.0 架構中發佈的事件。
az eventgrid topic create -g rg1 --name topic1 -l westus2 --input-schema cloudeventschemav1_0
建立新的主題,以允許具有基本 Sku 和系統指派身分識別的特定輸入 IP 規則
az eventgrid topic create -g rg1 --name topic1 -l westus2 --public-network-access enabled --inbound-ip-rules 10.0.0.0/8 Allow --inbound-ip-rules 10.2.0.0/8 Allow --sku Basic --identity systemassigned
在 Azure 中建立新主題。
az eventgrid topic create -g rg1 --name topic1 -l westus2
在 Azure 中建立新主題。
az eventgrid topic create -g rg1 --name topic1 -l westus2 --kind azure
在以自定義位置為目標的 AzureArc 中建立新主題。
az eventgrid topic create -g rg1 --name topic1 -l eastus2euap --kind azurearc --extended-location-name /subscriptions/<subid>/resourcegroups/<rgname>/providers/microsoft.extendedlocation/customlocations/<cust-loc-name> --extended-location-type customlocation --input-schema CloudEventSchemaV1_0
必要參數
主題的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
如果 kind==azurearc,則為擴充位置名稱。
屬性 | 值 |
---|---|
Parameter group: | Azure Arc Arguments |
如果 kind==azurearc,則為擴充位置類型。
屬性 | 值 |
---|---|
Parameter group: | Azure Arc Arguments |
接受的值: | customlocation |
自變數 'identity' 已被取代,未來版本將會移除。
資源的受控識別類型。 未來將會被 --mi-system-assigned-identity 取代。
屬性 | 值 |
---|---|
接受的值: | noidentity, systemassigned |
輸入IP規則的清單。
以 CIDR 表示法指定 IP 位址的輸入 IP 規則清單,例如 10.0.0.0/8,以及根據 IpMask 的相符專案或不符合的對應動作來執行。 可能的值包括 - 允許。
當輸入架構指定為 customeventschema 時,此參數可用來根據預設值來指定輸入對應。 當您的自定義架構不包含對應至此參數所支援三個字段之一的欄位時,您可以使用此參數。 以 『key=value』 格式指定空格分隔的對應。 允許的索引鍵名稱為 'subject'、'eventtype'、'dataversion'。 對應的值名稱應該指定要用於對應的預設值,而且只有在發行的事件沒有特定欄位的有效對應時,才會使用它們。
當輸入架構指定為 customeventschema 時,此參數會用來根據功能變數名稱指定輸入對應。 以 『key=value』 格式指定空格分隔的對應。 允許的索引鍵名稱為 'id'、'topic'、'eventtime'、'subject'、'eventtype'、'dataversion'。 對應的值名稱應該指定自定義輸入架構中的欄位名稱。 如果未提供 『id』 或 'eventtime' 的對應,事件方格就會自動產生這兩個字段的預設值。
將傳入事件發佈至本主題/網域的架構。 如果您將 customeventschema 指定為此參數的值,您也必須提供至少一個 --input_mapping_default_values / --input_mapping_fields 的值。
屬性 | 值 |
---|---|
預設值: | eventgridschema |
接受的值: | cloudeventschemav1_0, customeventschema, eventgridschema |
主題資源的種類。
屬性 | 值 |
---|---|
預設值: | Azure |
接受的值: | azure, azurearc |
Location. 值的來源:az account list-locations
。 您可以使用 az configure --defaults location=<location>
來設定預設位置。
此參數的存在表示將使用 SystemAssigned 受控識別。
當 identityType 是使用者或混合時,新增使用者指派的身分識別。 此屬性適用於所有目的地類型,但 StorageQueue 除外。 您可以使用多個 --mi-user-assigned
自變數來指定多個屬性。
這會判斷是否允許透過公用網路傳輸流量。 默認會啟用。 您可以藉由設定進一步限制特定IP。
屬性 | 值 |
---|---|
接受的值: | disabled, enabled |
資源的 SKU 名稱。
屬性 | 值 |
---|---|
預設值: | Basic |
接受的值: | basic, premium |
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az eventgrid topic delete
刪除主題。
az eventgrid topic delete [--ids]
[--name]
[--resource-group]
[--subscription]
範例
刪除主題。
az eventgrid topic delete -g rg1 --name topic1
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
主題的名稱。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az eventgrid topic list
列出可用的主題。
az eventgrid topic list [--odata-query]
[--resource-group]
範例
列出目前 Azure 訂用帳戶中的所有主題。
az eventgrid topic list
列出資源群組中的所有主題。
az eventgrid topic list -g rg1
列出名稱包含模式 「XYZ」 的資源群組中的所有主題
az eventgrid topic list -g rg1 --odata-query "Contains(name, 'XYZ')"
列出資源群組中的所有主題,但名稱為 「name1」 的功能變數名稱除外
az eventgrid topic list -g rg1 --odata-query "NOT (name eq 'name1')"
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
用於篩選清單結果的 OData 查詢。 [名稱] 屬性目前只允許篩選。 支持的作業包括:CONTAINS、eq (等於)、ne (不等於)、AND、OR 和 NOT。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az eventgrid topic show
取得主題的詳細數據。
az eventgrid topic show [--ids]
[--name]
[--resource-group]
[--subscription]
範例
顯示主題的詳細數據。
az eventgrid topic show -g rg1 -n topic1
根據資源識別碼顯示主題的詳細數據。
az eventgrid topic show --ids /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
主題的名稱。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az eventgrid topic update
更新主題。
az eventgrid topic update [--identity {noidentity, systemassigned}]
[--ids]
[--inbound-ip-rules]
[--mi-system-assigned]
[--mi-user-assigned]
[--name]
[--public-network-access {disabled, enabled}]
[--resource-group]
[--sku {basic, premium}]
[--subscription]
[--tags]
範例
使用新的 SKU、身分識別和公用網路存取資訊更新現有主題的屬性。
az eventgrid topic update -g rg1 --name topic1 --sku Premium --identity systemassigned --public-network-access enabled --inbound-ip-rules 10.0.0.0/8 Allow --inbound-ip-rules 10.2.0.0/8 Allow --tags Dept=IT --sku basic
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
自變數 'identity' 已被取代,未來版本將會移除。
資源的受控識別類型。 未來將會被 --mi-system-assigned-identity 取代。
屬性 | 值 |
---|---|
接受的值: | noidentity, systemassigned |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
以 CIDR 表示法指定 IP 位址的輸入 IP 規則清單,例如 10.0.0.0/8,以及根據 IpMask 的相符專案或不符合的對應動作來執行。 可能的值包括 - 允許。
此參數的存在表示將使用 SystemAssigned 受控識別。
當 identityType 是使用者或混合時,新增使用者指派的身分識別。 此屬性適用於所有目的地類型,但 StorageQueue 除外。 您可以使用多個 --mi-user-assigned
自變數來指定多個屬性。
主題的名稱。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
這會判斷是否允許透過公用網路傳輸流量。 默認會啟用。 您可以藉由設定進一步限制特定IP。
屬性 | 值 |
---|---|
接受的值: | disabled, enabled |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
資源的 SKU 名稱。
屬性 | 值 |
---|---|
接受的值: | basic, premium |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |