You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Create Event Grid namespace](../../event-grid/create-view-manage-namespaces.md) with Azure CLI. The location should be the same as the one you used to deploy Azure IoT Operations.
59
59
60
60
```azurecli
61
-
az eventgrid namespace create --namespace-name $EVENT_GRID_NAMESPACE \
@@ -76,7 +77,8 @@ The max client sessions option allows IoT MQ to spawn multiple instances and sti
76
77
In the Event Grid namespace, create a topic space named `tutorial` with a topic template `telemetry/#`.
77
78
78
79
```azurecli
79
-
az eventgrid namespace topic-space create --resource-group $RESOURCE_GROUP \
80
+
az eventgrid namespace topic-space create \
81
+
--resource-group $RESOURCE_GROUP \
80
82
--namespace-name $EVENT_GRID_NAMESPACE \
81
83
--name tutorial \
82
84
--topic-templates "telemetry/#"
@@ -89,7 +91,8 @@ By using the `#` wildcard in the topic template, you can publish to any topic un
89
91
Using `az k8s-extension show`, find the principal ID for the Azure IoT MQ Arc extension. The command stores the principal ID in a variable for later use.
90
92
91
93
```azurecli
92
-
export PRINCIPAL_ID=$(az k8s-extension show --resource-group $RESOURCE_GROUP \
94
+
export PRINCIPAL_ID=$(az k8s-extension show \
95
+
--resource-group $RESOURCE_GROUP \
93
96
--cluster-name $CLUSTER_NAME \
94
97
--name mq \
95
98
--cluster-type connectedClusters \
@@ -104,29 +107,35 @@ Take note of the output value for `identity.principalId`, which is a GUID value
104
107
d84481ae-9181-xxxx-xxxx-xxxxxxxxxxxx
105
108
```
106
109
107
-
Then, use Azure CLI to assign publisher and subscriber roles to IoT MQ for the topic space you created. Replace `<MQ_ID>` with the principal ID you found in the previous step, and replace `<SUBSCRIPTION_ID>`, `<RESOURCE_GROUP>`, `<EG_NAME>` with your values matching the Event Grid namespace you created.
110
+
Then, use Azure CLI to assign publisher and subscriber roles to IoT MQ for the topic space you created.
108
111
109
112
Assigning the publisher role:
110
113
111
114
```azurecli
112
-
az role assignment create --assignee <MQ_ID> --role "EventGrid TopicSpaces Publisher" --scope /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.EventGrid/namespaces/<EG_NAME>/topicSpaces/tutorial
> The scope matches the `id` of the topic space you created with `az eventgrid namespace topic-space create` in the previous step, and you can find it in the output of the command.
123
132
124
133
## Event Grid MQTT broker hostname
125
134
126
-
Use Azure CLI to get the Event Grid MQTT broker hostname. Replace `<EG_NAME>` and `<RESOURCE_GROUP>` with your own values.
135
+
Use Azure CLI to get the Event Grid MQTT broker hostname.
127
136
128
137
```azurecli
129
-
az eventgrid namespace show -g <RESOURCE_GROUP> -n <EG_NAME> --query topicSpacesConfiguration.hostname -o tsv
138
+
az eventgrid namespace show --resource-group $RESOURCE_GROUP --namespace-name $EVENT_GRID_NAMESPACE --query topicSpacesConfiguration.hostname -o tsv
130
139
```
131
140
132
141
Take note of the output value for `topicSpacesConfiguration.hostname` that is a hostname value that looks like:
0 commit comments