Skip to content

Commit b1478a1

Browse files
committed
replaced az resource commands
1 parent 83f0752 commit b1478a1

8 files changed

+16
-29
lines changed

articles/event-grid/custom-event-to-hybrid-connection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ You subscribe to an Event Grid topic to tell Event Grid which events you want to
4747
The following script gets the resource ID of the relay namespace. It constructs the ID for the hybrid connection, and subscribes to an Event Grid topic. The script sets the endpoint type to `hybridconnection` and uses the hybrid connection ID for the endpoint.
4848

4949
```azurecli-interactive
50-
relayname=<namespace-name>
50+
relaynsname=<namespace-name>
5151
relayrg=<resource-group-for-relay>
5252
hybridname=<hybrid-name>
5353
54-
relayid=$(az resource show --name $relayname --resource-group $relayrg --resource-type Microsoft.Relay/namespaces --query id --output tsv)
54+
relayid=$(az relay namespace show --resource-group $relayrg --name $relaynsname --query id --output tsv)
5555
hybridid="$relayid/hybridConnections/$hybridname"
5656
topicid=$(az eventgrid topic show --name <topic_name> -g gridResourceGroup --query id --output tsv)
5757

articles/event-grid/how-to-filter-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ New-AzEventGridSubscription `
124124
In the following Azure CLI example, you create an event subscription that filters by the beginning of the subject. You use the `--subject-begins-with` parameter to limit events to ones for a specific resource. You pass the resource ID of a network security group.
125125

126126
```azurecli
127-
resourceId=$(az resource show --name demoSecurityGroup --resource-group myResourceGroup --resource-type Microsoft.Network/networkSecurityGroups --query id --output tsv)
127+
resourceId=$(az network nsg show -g myResourceGroup -n demoSecurityGroup --query id --output tsv)
128128
129129
az eventgrid event-subscription create \
130130
--name demoSubscriptionToResourceGroup \

articles/event-grid/mqtt-certificate-chain-client-authentication.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,19 @@ Using the CA files generated to create certificate for the client.
7878
Use the following commands to upload/show/delete a certificate authority (CA) certificate to the service
7979

8080
**Upload certificate authority root or intermediate certificate**
81+
8182
```azurecli-interactive
82-
az resource create --resource-type Microsoft.EventGrid/namespaces/caCertificates --id /subscriptions/`Subscription ID`/resourceGroups/`Resource Group`/providers/Microsoft.EventGrid/namespaces/`Namespace Name`/caCertificates/`CA certificate name` --api-version --properties @./resources/ca-cert.json
83+
az eventgrid namespace ca-certificate create -g myRG --namespace-name myNS -n myCertName --certificate @./resources/ca-cert.json
8384
```
8485

8586
**Show certificate information**
8687
```azurecli-interactive
87-
az resource show --id /subscriptions/`Subscription ID`/resourceGroups/`Resource Group`/providers/Microsoft.EventGrid/namespaces/`Namespace Name`/caCertificates/`CA certificate name`
88+
az eventgrid namespace ca-certificate show -g myRG --namespace-name myNS -n myCertName
8889
```
8990

9091
**Delete certificate**
9192
```azurecli-interactive
92-
az resource delete --id /subscriptions/`Subscription ID`/resourceGroups/`Resource Group`/providers/Microsoft.EventGrid/namespaces/`Namespace Name`/caCertificates/`CA certificate name`
93+
az eventgrid namespace ca-certificate delete -g myRG --namespace-name myNS -n myCertName
9394
```
9495

9596
## Next steps

articles/event-grid/mqtt-client-groups.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ Use the following commands to create/show/delete a client group
7777

7878
**Create client group**
7979
```azurecli-interactive
80-
az resource create --resource-type Microsoft.EventGrid/namespaces/clientGroups --id /subscriptions/`Subscription ID`/resourceGroups/`Resource Group`/providers/Microsoft.EventGrid/namespaces/`Namespace Name`/clientGroups/`Client Group Name` --api-version 2023-06-01-preview --properties @./resources/CG.json
80+
az eventgrid namespace client-group create -g myRG --namespace-name myNS -n myCG
8181
```
8282

8383
**Get client group**
8484
```azurecli-interactive
85-
az resource show --id /subscriptions/`Subscription ID`/resourceGroups/`Resource Group`/providers/Microsoft.EventGrid/namespaces/`Namespace Name`/clientGroups/`Client group name` |
85+
az eventgrid namespace client-group show -g myRG --namespace-name myNS -n myCG
8686
```
8787

8888
**Delete client group**
8989
```azurecli-interactive
90-
az resource delete --id /subscriptions/`Subscription ID`/resourceGroups/`Resource Group`/providers/Microsoft.EventGrid/namespaces/`Namespace Name`/clientGroups/`Client group name` |
90+
az eventgrid namespace client-group delete -g myRG --namespace-name myNS -n myCG
9191
```
9292

9393
## Next steps

articles/event-grid/mqtt-clients.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,17 @@ Use the following commands to create/show/delete a client
156156

157157
**Create client**
158158
```azurecli-interactive
159-
az resource create --resource-type Microsoft.EventGrid/namespaces/clients --id /subscriptions/`Subscription ID`/resourceGroups/`Resource Group`/providers/Microsoft.EventGrid/namespaces/`Namespace Name`/clients/`Client name` --api-version 2023-06-01-preview --properties @./resources/client.json
159+
az eventgrid namespace client create -g myRG --namespace-name myNS -n myClient
160160
```
161161

162162
**Get client**
163163
```azurecli-interactive
164-
az resource show --id /subscriptions/`Subscription ID`/resourceGroups/`Resource Group`/providers/Microsoft.EventGrid/namespaces/`Namespace Name`/clients/`Client name`
164+
az eventgrid namespace client show -g myRG --namespace-name myNS -n myClient
165165
```
166166

167167
**Delete client**
168168
```azurecli-interactive
169-
az resource delete --id /subscriptions/`Subscription ID`/resourceGroups/`Resource Group`/providers/Microsoft.EventGrid/namespaces/`Namespace Name`/clients/`Client name`
169+
az eventgrid namespace client delete -g myRG --namespace-name myNS -n myClient
170170
```
171171

172172
## Next steps

articles/event-grid/mqtt-publish-and-subscribe-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ az eventgrid namespace topic-space create -g {Resource Group} --namespace-name {
9393

9494
## Create permission bindings
9595

96-
Use the `az resource` command to create the first permission binding for publisher permission. Update the command with your resource group, namespace name, and permission binding name.
96+
Use the `az eventgrid` command to create the first permission binding for publisher permission. Update the command with your resource group, namespace name, and permission binding name.
9797

9898
```azurecli-interactive
9999
az eventgrid namespace permission-binding create -g {Resource Group} --namespace-name {Namespace Name} -n {Permission Binding Name} --client-group-name '$all' --permission publisher --topic-space-name {Topicspace Name}

articles/event-grid/mqtt-topic-spaces.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,7 @@ Use the following steps to create a topic space:
8484

8585
Use the following commands to create a topic space:
8686
```azurecli-interactive
87-
az resource create --resource-type Microsoft.EventGrid/namespaces/topicSpaces --id /subscriptions/<Subscription ID>/resourceGroups/<Resource Group>/providers/Microsoft.EventGrid/namespaces/<Namespace Name>/topicSpaces/<Topic Space Name> --is-full-object --api-version 2023-06-01-preview --properties @./resources/TS.json
88-
```
89-
90-
**TS.json:**
91-
```json
92-
{
93-
"properties": {
94-
"topicTemplates": [
95-
"segment1/+/segment3/${client.authenticationName}",
96-
"segment1/${client.attributes.attribute1}/segment3/#"
97-
]
98-
99-
}
100-
101-
}
87+
az eventgrid namespace topic-space create -g myRG --namespace-name myNS -n myTopicSpace --topic-templates ['segment1/+/segment3/${client.authenticationName}', "segment1/${client.attributes.attribute1}/segment3/#"]
10288
```
10389

10490
> [!NOTE]

articles/event-grid/query-event-subscriptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ To get event grid subscriptions for a particular resource, provide the resource
139139
For Azure CLI, use:
140140

141141
```azurecli-interactive
142-
resourceid=$(az resource show -n mystorage -g myResourceGroup --resource-type "Microsoft.Storage/storageaccounts" --query id --output tsv)
142+
resourceid=$(az storage account show -g myResourceGroup -n myStorageAccount --query id --output tsv)
143143
az eventgrid event-subscription list --resource-id $resourceid
144144
```
145145

0 commit comments

Comments
 (0)