Skip to content

Commit 8ca62e5

Browse files
committed
Add resource sync rule enable commands
1 parent 4378a6c commit 8ca62e5

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

articles/iot-operations/troubleshoot/troubleshoot.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,60 @@ A deployment can fail if the cluster doesn't have sufficient resources for the s
7272
7373
To learn more about how to choose suitable values for these parameters, see [Configure broker settings for high availability, scaling, and memory usage](../manage-mqtt-broker/howto-configure-availability-scale.md).
7474

75+
### You want to enable resource sync rules on an existing instance
76+
77+
Currently, you can't use the `az iot ops` command to enable resource sync rules on an existing instance. To work around this limitation, you can use the `az rest` command as follows:
78+
79+
To create the device registry rule:
80+
81+
1. Create a file called *rsr_device_registry.json* with the following content. Replace the `<placeholder>` values with your own values:
82+
83+
```json
84+
{
85+
"location": "<custom location region>",
86+
"properties": {
87+
"targetResourceGroup": "/subscriptions/<subscription Id>/resourceGroups/<resource group name>",
88+
"priority": 200,
89+
"selector": {
90+
"matchLabels": {
91+
"management.azure.com/provider-name": "Microsoft.DeviceRegistry"
92+
}
93+
}
94+
}
95+
}
96+
```
97+
98+
1. Run the following command to create the device registry resource sync rule. Replace the `<placeholder>` values with your own values:
99+
100+
```azcli
101+
az rest --url /subscriptions/<subscription Id>/resourceGroups/<resource group name>/providers/Microsoft.ExtendedLocation/customLocations/<custom location name>/resourceSyncRules/<rule name>?api-version=2021-08-31-preview --method PUT --body "@rsr_device_registry.json"
102+
```
103+
104+
To create the instance rule:
105+
106+
1. Create a file called *rsr_instance.json* with the following content. Replace the `<placeholder>` values with your own values:
107+
108+
```json
109+
{
110+
"location": "<custom location region>",
111+
"properties": {
112+
"targetResourceGroup": "/subscriptions/<subscription Id>/resourceGroups/<resource group name>",
113+
"priority": 400,
114+
"selector": {
115+
"matchLabels": {
116+
"management.azure.com/provider-name": "microsoft.iotoperations"
117+
}
118+
}
119+
}
120+
}
121+
```
122+
123+
1. Run the following command to create the instance resource sync rule. Replace the `<placeholder>` values with your own values:
124+
125+
```azcli
126+
az rest --url /subscriptions/<subscription Id>/resourceGroups/<resource group name>/providers/Microsoft.ExtendedLocation/customLocations/<custom location name>/resourceSyncRules/<rule name>?api-version=2021-08-31-preview --method PUT --body "@rsr_instance.json"
127+
```
128+
75129
## Troubleshoot Azure Key Vault secret management
76130

77131
If you see the following error message related to secret management, you need to update your Azure Key Vault contents:

0 commit comments

Comments
 (0)