@@ -43,7 +43,7 @@ Replace `<TOPIC NAME>` with a unique name for your custom topic. The Event Grid
43
43
1. Run the following command to create the topic:
44
44
45
45
```azurecli-interactive
46
- az eventgrid topic create --name $topicname -l westus2 -g gridResourceGroup
46
+ az eventgrid topic create --name $topicname --location westus2 --resource-group gridResourceGroup
47
47
```
48
48
49
49
## Create a queue
@@ -61,8 +61,8 @@ Before you subscribe to the custom topic, create the endpoint for the event mess
61
61
```azurecli-interactive
62
62
queuename="eventqueue"
63
63
64
- az storage account create -n $storagename -g gridResourceGroup -l westus2 --sku Standard_LRS
65
- key="$(az storage account keys list -n $storagename --query "[0].{value:value}" --output tsv)"
64
+ az storage account create --name $storagename --resource-group gridResourceGroup --location westus2 --sku Standard_LRS
65
+ key="$(az storage account keys list --account-name $storagename --query "[0].{value:value}" --output tsv)"
66
66
az storage queue create --name $queuename --account-name $storagename --account-key $key
67
67
```
68
68
@@ -79,7 +79,7 @@ Before you run the command, replace the placeholder for the [expiration date](co
79
79
```azurecli-interactive
80
80
storageid=$(az storage account show --name $storagename --resource-group gridResourceGroup --query id --output tsv)
81
81
queueid="$storageid/queueservices/default/queues/$queuename"
82
- topicid=$(az eventgrid topic show --name $topicname -g gridResourceGroup --query id --output tsv)
82
+ topicid=$(az eventgrid topic show --name $topicname --resource-group gridResourceGroup --query id --output tsv)
83
83
84
84
az eventgrid event-subscription create \
85
85
--source-resource-id $topicid \
@@ -108,8 +108,8 @@ If you use the REST API to create the subscription, you pass the ID of the stora
108
108
Trigger an event to see how Event Grid distributes the message to your endpoint. First, get the URL and key for the custom topic:
109
109
110
110
```azurecli-interactive
111
- endpoint=$(az eventgrid topic show --name $topicname -g gridResourceGroup --query "endpoint" --output tsv)
112
- key=$(az eventgrid topic key list --name $topicname -g gridResourceGroup --query "key1" --output tsv)
111
+ endpoint=$(az eventgrid topic show --name $topicname --resource-group gridResourceGroup --query "endpoint" --output tsv)
112
+ key=$(az eventgrid topic key list --name $topicname --resource-group gridResourceGroup --query "key1" --output tsv)
113
113
```
114
114
115
115
For the sake of simplicity in this article, you use sample event data to send to the custom topic. Typically, an application or an Azure service would send the event data.
0 commit comments