Skip to content

Commit 2d9f6a7

Browse files
committed
Fix code sample formatting
1 parent 41b3eee commit 2d9f6a7

File tree

1 file changed

+45
-20
lines changed

1 file changed

+45
-20
lines changed

articles/cosmos-db/monitor-resource-logs.md

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,22 @@ Use the [Azure Monitor REST API](/rest/api/monitor/diagnosticsettings/createorup
151151
--output "tsv" \
152152
)
153153
154-
az rest --method PUT --url "$resourceId/providers/Microsoft.Insights/diagnosticSettings/$diagnosticSettingName" --url-parameters "api-version=2021-05-01-preview" --body '{
155-
"properties": {
156-
"workspaceId": "'"$workspaceId"'",
157-
"logs": [
158-
{
159-
"category": "QueryRuntimeStatistics",
160-
"enabled": true
161-
}
162-
],
163-
"logAnalyticsDestinationType": "Dedicated"
164-
}
165-
}'
154+
az rest \
155+
--method "PUT" \
156+
--url "$resourceId/providers/Microsoft.Insights/diagnosticSettings/$diagnosticSettingName" \
157+
--url-parameters "api-version=2021-05-01-preview" \
158+
--body '{
159+
"properties": {
160+
"workspaceId": "'"$workspaceId"'",
161+
"logs": [
162+
{
163+
"category": "QueryRuntimeStatistics",
164+
"enabled": true
165+
}
166+
],
167+
"logAnalyticsDestinationType": "Dedicated"
168+
}
169+
}'
166170
```
167171
168172
> [!IMPORTANT]
@@ -180,7 +184,10 @@ Use the [Azure Monitor REST API](/rest/api/monitor/diagnosticsettings/createorup
180184
--output "tsv" \
181185
)
182186
183-
az rest --method GET --url "$resourceId/providers/Microsoft.Insights/diagnosticSettings/$diagnosticSettingName" --url-parameters "api-version=2021-05-01-preview"
187+
az rest \
188+
--method "GET" \
189+
--url "$resourceId/providers/Microsoft.Insights/diagnosticSettings/$diagnosticSettingName" \
190+
--url-parameters "api-version=2021-05-01-preview"
184191
```
185192
186193
### [Bicep](#tab/bicep)
@@ -343,19 +350,37 @@ Use the Azure CLI to enable full-text query for your Azure Cosmos DB account.
343350
1. Enable full-text query using `az rest` again with an HTTP `PATCH` verb and a JSON payload.
344351
345352
```azurecli
346-
az rest --method PATCH --url $(az cosmosdb show --resource-group "<resource-group-name>" --name "<account-name>" --query "id" --output "tsv") --url-parameters "api-version=2021-05-01-preview" --body '{
347-
"properties": {
348-
"diagnosticLogSettings": {
349-
"enableFullTextQuery": "True"
353+
az rest \
354+
--method "PATCH" \
355+
--url $(az cosmosdb show \
356+
--resource-group "<resource-group-name>" \
357+
--name "<account-name>" \
358+
--query "id" \
359+
--output "tsv" \
360+
) \
361+
--url-parameters "api-version=2021-05-01-preview" \
362+
--body '{
363+
"properties": {
364+
"diagnosticLogSettings": {
365+
"enableFullTextQuery": "True"
366+
}
350367
}
351-
}
352-
}'
368+
}'
353369
```
354370
355371
1. Wait a few minutes for the operation to complete. Check the status of full-text query by using `az rest` again with HTTP `GET`.
356372
357373
```azurecli
358-
az rest --method GET --url $(az cosmosdb show --resource-group "<resource-group-name>" --name "<account-name>" --query "id" --output "tsv") --url-parameters "api-version=2021-05-01-preview" --query "{accountName:name,fullTextQueryEnabled:properties.diagnosticLogSettings.enableFullTextQuery}"
374+
az rest \
375+
--method "GET" \
376+
--url $(az cosmosdb show \
377+
--resource-group "<resource-group-name>" \
378+
--name "<account-name>" \
379+
--query "id" \
380+
--output "tsv" \
381+
) \
382+
--url-parameters "api-version=2021-05-01-preview" \
383+
--query "{accountName:name,fullTextQueryEnabled:properties.diagnosticLogSettings.enableFullTextQuery}"
359384
```
360385
361386
The output should be similar to this example.

0 commit comments

Comments
 (0)