Skip to content

Commit 19ef8d7

Browse files
Merge pull request #271545 from spelluru/egridazresource0408
replaced az resource commands
2 parents db71473 + c810bc5 commit 19ef8d7

8 files changed

+25
-38
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: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ This article describes how to list the Event Grid subscriptions in your Azure su
1414

1515
## Resource groups and Azure subscriptions
1616

17-
Azure subscriptions and resource groups aren't Azure resources. Therefore, event grid subscriptions to resource groups or Azure subscriptions do not have the same properties as event grid subscriptions to Azure resources. Event grid subscriptions to resource groups or Azure subscriptions are considered global.
17+
Azure subscriptions and resource groups aren't Azure resources. Therefore, Event Grid subscriptions to resource groups or Azure subscriptions don't have the same properties as Event Grid subscriptions to Azure resources. Event Grid subscriptions to resource groups or Azure subscriptions are considered global.
1818

19-
To get event grid subscriptions for an Azure subscription and its resource groups, you don't need to provide any parameters. Make sure you've selected the Azure subscription you want to query. The following examples don't get event grid subscriptions for custom topics or Azure resources.
19+
To get Event Grid subscriptions for an Azure subscription and its resource groups, you don't need to provide any parameters. Make sure you've selected the Azure subscription you want to query. The following examples don't get Event Grid subscriptions for custom topics or Azure resources.
2020

2121
For Azure CLI, use:
2222

@@ -32,7 +32,7 @@ Set-AzContext -Subscription "My Azure Subscription"
3232
Get-AzEventGridSubscription
3333
```
3434

35-
To get event grid subscriptions for an Azure subscription, provide the topic type of **Microsoft.Resources.Subscriptions**.
35+
To get Event Grid subscriptions for an Azure subscription, provide the topic type of **Microsoft.Resources.Subscriptions**.
3636

3737
For Azure CLI, use:
3838

@@ -46,7 +46,7 @@ For PowerShell, use:
4646
Get-AzEventGridSubscription -TopicTypeName "Microsoft.Resources.Subscriptions"
4747
```
4848

49-
To get event grid subscriptions for all resource groups within an Azure subscription, provide the topic type of **Microsoft.Resources.ResourceGroups**.
49+
To get Event Grid subscriptions for all resource groups within an Azure subscription, provide the topic type of **Microsoft.Resources.ResourceGroups**.
5050

5151
For Azure CLI, use:
5252

@@ -60,7 +60,7 @@ For PowerShell, use:
6060
Get-AzEventGridSubscription -TopicTypeName "Microsoft.Resources.ResourceGroups"
6161
```
6262

63-
To get event grid subscriptions for a specified resource group, provide the name of the resource group as a parameter.
63+
To get Event Grid subscriptions for a specified resource group, provide the name of the resource group as a parameter.
6464

6565
For Azure CLI, use:
6666

@@ -76,9 +76,9 @@ Get-AzEventGridSubscription -ResourceGroupName myResourceGroup
7676

7777
## Custom topics and Azure resources
7878

79-
Event grid custom topics are Azure resources. Therefore, you query event grid subscriptions for custom topics and other resources, like Blob storage account, in the same way. To get event grid subscriptions for custom topics, you must provide parameters that identify the resource or identify the location of the resource. It's not possible to broadly query event grid subscriptions for resources across your Azure subscription.
79+
Event Grid custom topics are Azure resources. Therefore, you query Event Grid subscriptions for custom topics and other resources, like Blob storage account, in the same way. To get Event Grid subscriptions for custom topics, you must provide parameters that identify the resource or identify the location of the resource. It's not possible to broadly query Event Grid subscriptions for resources across your Azure subscription.
8080

81-
To get event grid subscriptions for custom topics and other resources in a location, provide the name of the location.
81+
To get Event Grid subscriptions for custom topics and other resources in a location, provide the name of the location.
8282

8383
For Azure CLI, use:
8484

@@ -120,7 +120,7 @@ For PowerShell, use:
120120
Get-AzEventGridSubscription -TopicTypeName "Microsoft.Storage.StorageAccounts" -Location westus2
121121
```
122122

123-
To get event grid subscriptions for a custom topic, provide the name of the custom topic and the name of its resource group.
123+
To get Event Grid subscriptions for a custom topic, provide the name of the custom topic and the name of its resource group.
124124

125125
For Azure CLI, use:
126126

@@ -134,12 +134,12 @@ For PowerShell, use:
134134
Get-AzEventGridSubscription -TopicName myCustomTopic -ResourceGroupName myResourceGroup
135135
```
136136

137-
To get event grid subscriptions for a particular resource, provide the resource ID.
137+
To get Event Grid subscriptions for a particular resource, provide the resource ID.
138138

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)