【发布时间】:2020-06-11 05:37:41
【问题描述】:
我尝试创建一个系统主题。为此,我正在使用预览中的 eventgrid 扩展。
az eventgrid system-topic create \
--name $topicName \
--resource-group $resourceGroupName \
--location $location \
--topic-type microsoft.storage.storageaccounts \
--source $storageId
但如果我尝试以这种方式获取 id/endpoint/key:
echo "Landing Topic Information:"
topicId=$(az eventgrid topic show \
--name $topicName \
--resource-group $resourceGroupName \
--query id \
--output tsv)
echo "Topic Id: $topicId"
topicEndpoint=$(az eventgrid topic show \
--name $topicName \
--resource-group $resourceGroupName \
--query endpoint \
--output tsv)
echo "Topic Endpoint: $topicEndpoint"
topicKey=$(az eventgrid topic key list \
--name $topicName \
--resource-group $resourceGroupName \
--query key1 \
--output tsv)
echo "Topic Key: $topicKey"
我收到一个错误:
Landing Topic Information:
The behavior of this command has been altered by the following extension: eventgrid
The Resource 'Microsoft.EventGrid/topics/xxx' under resource group 'xxxxxx-grp' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Topic Id:
The behavior of this command has been altered by the following extension: eventgrid
The Resource 'Microsoft.EventGrid/topics/xxx' under resource group 'xxxxxx-grp' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Topic Endpoint:
The behavior of this command has been altered by the following extension: eventgrid
The Resource 'Microsoft.EventGrid/topics/xxx' under resource group 'xxxxxx-grp' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Topic Key:
我可以使用门户查看系统主题
看结果,我更喜欢不使用扩展,所以问题是:如何在没有扩展的情况下使用 CLI 创建系统主题?*
命令行界面:
$ az --version
azure-cli 2.7.0
command-modules-nspkg 2.0.3
core 2.7.0
nspkg 3.0.4
telemetry 1.0.4
Extensions:
eventgrid 0.4.9
interactive 0.4.4
Python location '/opt/az/bin/python3'
Extensions directory '/home/angelcc/.azure/cliextensions'
Python (Linux) 3.6.10 (default, May 29 2020, 08:10:59)
[GCC 9.3.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
参考资料:
【问题讨论】: