I try to create a system-topic. To do it, I'm using the eventgrid extension that is in preview.
az eventgrid system-topic create \
--name $topicName \
--resource-group $resourceGroupName \
--location $location \
--topic-type microsoft.storage.storageaccounts \
--source $storageId
But if I try to get the id/endpoint/key on this way:
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"
I get an error:
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:
I can see the system-topic using the Portal
Looking at the result, I prefer don't use extensions, so the question is: How to create a system-topic using the CLI without extension?*
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.
References:
- Official documentation: Create, view, and manage Event Grid system topics using Azure CLI
- Official documentation: System topics in Azure Event Grid
- Official documentaion: Create system topics