使用 Azure CLI 更新 EventGrid 主题以设置 DeadLettering 目标

Updating EventGrid Topic to set DeadLettering destination using Azure CLI

我正在按照说明 here 添加 --deadletter-endpoint 到现有的 EventGrid 订阅。

进程失败并出现错误:Event subscription doesn't exist.

我错过了什么?:

containername=eg-dead-letter-events //container where deadlettered events will be stored

topicid=$(az eventgrid system-topic show --name egtop-dev -g TEST_DEV --query id --output tsv) //name of eventgrid system topic

storageid=$(az storage account show --name stgdev --resource-group TEST_DEV --query id --output tsv) //name of storage account where deadlettered events will be stored

az eventgrid event-subscription update \
--name egsub-dev \ //name of Event Subscription here? also tried System Topic name, no go.
--source-resource-id $topicid \ //I cannot find a clear reference for what is supposed to go here
--deadletter-endpoint $storageid/blobServices/default/containers/$containername

编辑 1: 取得了一些进展

az eventgrid event-subscription list --topic-type "Microsoft.Storage.StorageAccounts" --location southcentralus
az eventgrid event-subscription update --name egsub-dev --source-resource-id /subscriptions/$subscription/resourceGroups/$resourceGroup/providers/Microsoft.Storage/storageAccounts/storageAccountThatTriggersEventGrid/providers/Microsoft.EventGrid/eventSubscriptions/egsub-dev --deadletter-endpoint $storageid/blobServices/default/containers/$containername
No registered resource provider found for location 'southcentralus' and API version '2020-10-15-preview' for type 'storageAccounts'. The supported api-versions are '2021-04-01, 2021-02-01, 2021-01-01, 2020-08-01-preview, 2019-06-01, 2019-04-01, 2018-11-01, 2018-07-01, 2018-03-01-preview, 2018-02-01, 2017-10-01, 2017-06-01, 2016-12-01, 2016-05-01, 2016-01-01, 2015-06-15, 2015-05-01-preview'. The supported locations are 'eastus, eastus2, westus, westeurope, eastasia, southeastasia, japaneast, japanwest, northcentralus, southcentralus, centralus, northeurope, brazilsouth, australiaeast, australiasoutheast, southindia, centralindia, westindia, canadaeast, canadacentral, westus2, westcentralus, uksouth, ukwest, koreacentral, koreasouth, francecentral, australiacentral, southafricanorth, uaenorth, switzerlandnorth, germanywestcentral, norwayeast, westus3, jioindiawest'.

对此有何想法?

关于这个问题,请更新脚本如下

sourceid=$(az eventgrid system-topic show --name egtop-dev -g TEST_DEV --query source --output tsv) 

storageid=$(az storage account show --name stgdev --resource-group TEST_DEV --query id --output tsv)

az eventgrid event-subscription update \
--name egsub-dev \
--source-resource-id $sourceid\
--deadletter-endpoint $storageid/blobServices/default/containers/$containername