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
title: Monitor Azure Cosmos DB data by using Azure Diagnostic settings
2
+
title: Monitor data by using Azure Diagnostic settings
3
+
titleSuffix: Azure Cosmos DB
3
4
description: Learn how to use Azure diagnostic settings to monitor the performance and availability of data stored in Azure Cosmos DB
4
5
author: seesharprun
5
6
ms.author: sidandrews
6
7
ms.reviewer: esarroyo
7
8
ms.service: cosmos-db
8
9
ms.topic: how-to
9
-
ms.date: 04/23/2023
10
+
ms.date: 04/26/2023
10
11
ms.custom: ignite-2022
11
12
---
12
13
@@ -26,8 +27,17 @@ Platform metrics and the Activity logs are collected automatically, whereas you
26
27
> [!NOTE]
27
28
> We recommend creating the diagnostic setting in resource-specific mode (for all APIs except API for Table) [following our instructions for creating diagnostics setting via REST API](monitor-resource-logs.md). This option provides additional cost-optimizations with an improved view for handling data.
28
29
30
+
## Prerequisites
31
+
32
+
- An existing Azure Cosmos DB account.
33
+
- If you have an Azure subscription, [create a new account](nosql/how-to-create-account.md?tabs=azure-portal).
34
+
- If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
35
+
- Alternatively, you can [try Azure Cosmos DB free](try-free.md) before you commit.
36
+
29
37
## Create diagnostic settings
30
38
39
+
Here, we walk through the process of creating diagnostic settings for your account.
40
+
31
41
### [Azure portal](#tab/azure-portal)
32
42
33
43
1. Sign into the [Azure portal](https://portal.azure.com).
@@ -114,7 +124,6 @@ Use the [Azure Monitor REST API](/rest/api/monitor/diagnosticsettings/createorup
114
124
> [!NOTE]
115
125
> The URI for the Microsoft Insights subresource is in this format: `subscriptions/{SUBSCRIPTION_ID}/resourceGroups/{RESOURCE_GROUP}/providers/Microsoft.DocumentDb/databaseAccounts/{ACCOUNT_NAME}/providers/microsoft.insights/diagnosticSettings/{DIAGNOSTIC_SETTING_NAME}`. For more information about Azure Cosmos DB resource URIs, see [resource URI syntax for Azure Cosmos DB REST API](/rest/api/cosmos-db/cosmosdb-resource-uri-syntax-for-rest).
116
126
117
-
118
127
1. Set the body of the request to this JSON payload.
119
128
120
129
```json
@@ -184,6 +193,210 @@ Use the [Azure Monitor REST API](/rest/api/monitor/diagnosticsettings/createorup
1. Deploy the template using [`az deployment group create`](/cli/azure/deployment/group#az-deployment-group-create).
392
+
393
+
```azurecli
394
+
az deployment group create \
395
+
--resource-group <resource-group-name> \
396
+
--template-file <path-to-template>.json \
397
+
--parameters @<parameters-file-name>.json
398
+
```
399
+
187
400
---
188
401
189
402
## Enable full-text query for logging query text
@@ -197,13 +410,13 @@ Azure Cosmos DB provides advanced logging for detailed troubleshooting. By enabl
197
410
198
411
1. To enable this feature, navigate to the `Features` page in your Azure Cosmos DB account.
199
412
200
-
:::image type="content" source="media/monitor/full-text-query-features.png" lightbox="media/monitor/full-text-query-features.png" alt-text="Screenshot of navigation to the Features page.":::
413
+
:::image type="content" source="media/monitor/full-text-query-features.png" lightbox="media/monitor/full-text-query-features.png" alt-text="Screenshot of the navigation process to the Features page.":::
201
414
202
415
2. Select `Enable`. This setting is applied within a few minutes. All newly ingested logs have the full-text or PIICommand text for each request.
203
416
204
-
:::image type="content" source="media/monitor/select-enable-full-text.png" alt-text="Screenshot of full-text being enabled.":::
417
+
:::image type="content" source="media/monitor/select-enable-full-text.png" alt-text="Screenshot of the full-text feature being enabled.":::
### [Azure CLI / REST API / ARM template](#tab/azure-cli+rest-api+azure-resource-manager-template)
207
420
208
421
1. Ensure you're logged in to the Azure CLI. For more information, see [sign in with Azure CLI](/cli/azure/authenticate-azure-cli). Optionally, ensure that you've configured the active subscription for your CLI. For more information, see [change the active Azure CLI subscription](/cli/azure/manage-azure-subscriptions-azure-cli#change-the-active-subscription).
209
422
@@ -303,7 +516,5 @@ To learn how to query using these newly enabled features, see:
303
516
304
517
## Next steps
305
518
306
-
- For a reference of the log and metric data, see [monitoring Azure Cosmos DB data reference](monitor-reference.md#resource-logs).
307
-
- For more information on how to query resource-specific tables, see [troubleshooting using resource-specific tables](monitor-logs-basic-queries.md#resource-specific-queries).
308
-
- For more information on how to query AzureDiagnostics tables, see [troubleshooting using AzureDiagnostics tables](monitor-logs-basic-queries.md#azure-diagnostics-queries).
309
-
- For detailed information about how to create a diagnostic setting by using the Azure portal, CLI, or PowerShell, see [create diagnostic setting to collect platform logs and metrics in Azure](../azure-monitor/essentials/diagnostic-settings.md) article.
519
+
> [!div class="nextstepaction"]
520
+
> [Monitoring Azure Cosmos DB data reference](monitor-reference.md#resource-logs)
0 commit comments