我有一个 Azure 事件网格订阅,它在我运行以下代码时返回:-
az eventgrid event-subscription list --resource-group [my resource group]
这将返回我拥有的事件订阅列表。id 显示为:
/subscriptions/[subscription ID]/resourceGroups/[my resource group]/providers/Microsoft.Storage/storageAccounts/[my storage account]/providers/Microsoft.EventGrid/eventSubscriptions/[my sub]
主题为:-
/subscriptions/[susbcription id]/resourceGroups/[my resource group]/providers/Microsoft.Storage/storageAccounts/[my storage account]
但是,当我尝试对列出的事件订阅使用 show 或 update 时,我收到以下错误:-
Invalid event subscription request: Supplied URL is invalid. It cannot be null or empty and should be a proper HTTPS URL like https://www.example.com.
我将上面列出的主题传递到--source-resource-id
参数中,如下所示:-
az eventgrid event-subscription show --source-resource-id "/subscriptions/[subscription id]/resourceGroups/[my resource group]/providers/microsoft.storage/storageaccounts/[my storage account]" --name [my event subscription]
这似乎遵循帮助文件和文档中的语法:-
知道我可能做错了什么吗?
如下所述,当使用 source-resource-id 运行列表时,会返回一个空对象:-
如果在没有 source-resource-id 和 jmespath 查询的情况下运行它,它将返回一个对象:-
使用云 cli 运行时,得到这个:-