Skip to content

Commit a294faa

Browse files
committed
updates
1 parent 029af98 commit a294faa

File tree

1 file changed

+35
-16
lines changed

1 file changed

+35
-16
lines changed

articles/azure-monitor/essentials/self-managed-prometheus-remote-write.md

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,18 @@ Administrator permissions for the cluster or resource are required to complete t
7070

7171
## Set up authentication for remote-write
7272

73-
Depending on the environment where Prometheus is running, you can use one of the following authentication methods to configure remote-write to send data to Azure Monitor workspace.
73+
Depending on the environment where Prometheus is running, you can configure remote-write to use user-assigned managed identity or Microsoft Entra ID application authentication to send data to Azure Monitor workspace.
7474

75-
### [Remote-write with user-assigned managed identity](#tab/managed-identity)
75+
Use the Azure portal or CLI to create a user-assigned managed identity or Microsoft Entra ID application.
76+
77+
### [Remote-write using user-assigned managed identity](#tab/managed-identity)
78+
#### Remote-write using user-assigned managed identity authentication
7679

7780
To configure a user-assigned managed identity for remote-write to Azure Monitor workspace, complete the following steps.
7881

7982
#### Create a user-assigned managed identity
8083

81-
Create a user-managed identity to use in your remote-write configuration
82-
Use the following CLI, or to use the portal, see [Manage user-assigned managed identities](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities#create-a-user-assigned-managed-identity).
84+
To create a user-managed identity to use in your remote-write configuration, see [Manage user-assigned managed identities](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities#create-a-user-assigned-managed-identity).
8385

8486
Note the value of the `clientId` of the managed identity that you created. This ID is used in the Prometheus remote write configuration.
8587

@@ -122,13 +124,14 @@ Assign the `Monitoring Metrics Publisher` role on the workspace's data collectio
122124

123125

124126
### [Microsoft Entra ID application](#tab/entra-application)
127+
#### Remote-write using Microsoft Entra ID application authentication.
125128

126129
To configure remote-write to Azure Monitor workspace using a Microsoft Entra ID application, create an Entra application and assign it the `Monitoring Metrics Publisher` role on the workspace's data collection rule to the application.
127130

128131
> [!NOTE]
129132
> Your Azure Entra application uses a client secret or password. Client secrets have an expiration date. Make sure to create a new client secret before it expires so you don't lose authenticated access
130133
131-
#### Create a Microsoft Entra ID application using the Azure portal
134+
#### Create a Microsoft Entra ID application
132135

133136
To create a Microsoft Entra ID application using the portal, see [Create a Microsoft Entra ID application and service principal that can access resources](/entra/identity-platform/howto-create-service-principal-portal#register-an-application-with-microsoft-entra-id-and-create-a-service-principal).
134137

@@ -185,15 +188,18 @@ Note the value of the `clientId` of the managed identity that you created. This
185188
1. Create a user-assigned managed identity using the following CLI command:
186189

187190
```azurecli
188-
az account set --subscription <subscription id>
189-
az identity create --name <idnetity name> --resource-group <resource group name>
191+
az account set \
192+
--subscription <subscription id>
193+
az identity create \
194+
--name <idnetity name> \
195+
--resource-group <resource group name>
190196
```
191197
192198
The following is an example of the output displayed:
193199
194200
```azurecli
195201
{
196-
"clientId": "abcdef01-a123-b456-d789-0123abc345de","
202+
"clientId": "abcdef01-a123-b456-d789-0123abc345de",
197203
"id": "/subscriptions/12345678-abcd-1234-abcd-1234567890ab/resourcegroups/rg-001/providers/Microsoft. ManagedIdentity/userAssignedIdentities/PromRemoteWriteIdentity",
198204
"location": "eastus",
199205
"name": "PromRemoteWriteIdentity",
@@ -217,7 +223,10 @@ Note the value of the `clientId` of the managed identity that you created. This
217223
For example,
218224
219225
```azurecli
220-
az role assignment create --role "Monitoring Metrics Publisher" --assignee abcdef01-a123-b456-d789-0123abc345de --scope /subscriptions/12345678-abcd-1234-abcd-1234567890ab/resourceGroups/MA_amw-001_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/amw-001
226+
az role assignment create \
227+
--role "Monitoring Metrics Publisher" \
228+
--assignee abcdef01-a123-b456-d789-0123abc345de \
229+
--scope /subscriptions/12345678-abcd-1234-abcd-1234567890ab/resourceGroups/MA_amw-001_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/amw-001
221230
```
222231
223232
1. Assign the managed identity to a Virtual Machine or Virtual Machine Scale Set.
@@ -237,11 +246,15 @@ Note the value of the `clientId` of the managed identity that you created. This
237246
-g <resource group name> \
238247
-n <VSS name> \
239248
--identities <user assigned identity resource ID>
240-
``
249+
```
250+
251+
For example, for a Virtual Machine Scale Set:
241252
242-
For example:
243253
```azurecli
244-
az vm identity assign -g rg-prom-on-vm -n win-for-prom --identities /subscriptions/12345678-abcd-1234-abcd-1234567890ab/resourcegroups/rg-001/providers/Microsoft. ManagedIdentity/userAssignedIdentities/PromRemoteWriteIdentity
254+
az vm identity assign \
255+
-g rg-prom-on-vm \
256+
-n win-vm-prom \
257+
--identities /subscriptions/12345678-abcd-1234-abcd-1234567890ab/resourcegroups/rg-001/providers/Microsoft. ManagedIdentity/userAssignedIdentities/PromRemoteWriteIdentity
245258
```
246259
247260
#### Create a Microsoft Entra ID application
@@ -254,7 +267,10 @@ az ad sp create-for-rbac --name <application name> \
254267
```
255268
For example,
256269
```azurecli
257-
az ad sp create-for-rbac --name PromRemoteWriteApp --role "Monitoring Metrics Publisher" --scopes /ubscriptions/ abcdef00-1234-5678-abcd-1234567890ab/resourceGroups/MA_amw-001_eastus_managed/providers/Microsoft.nsights/ dataCollectionRules/amw-001
270+
az ad sp create-for-rbac \
271+
--name PromRemoteWriteApp \
272+
--role "Monitoring Metrics Publisher" \
273+
--scopes /ubscriptions/abcdef00-1234-5678-abcd-1234567890ab/resourceGroups/MA_amw-001_eastus_managed/providers/Microsoft.nsights/dataCollectionRules/amw-001
258274
```
259275
The following is an example of the output displayed:
260276
```azurecli
@@ -313,12 +329,13 @@ To find your client for managed identity authentication in the portal, go to the
313329
To find the client ID for the Microsoft Entra ID application, use the following CLI or see the first step in the [Create an Microsoft Entra ID application using the Azure portal](#create-an-microsoft-entra-id-application-using-the-azure-portal) section.
314330

315331
```azurecli
316-
$ az ad app list --display-name < application name.>
332+
$ az ad app list --display-name < application name>
317333
```
318334
For more information, see [az ad app list](/cli/azure/ad/app?view=azure-cli-latest#az-ad-app-list).
319335

320336

321-
After editing the configuration file, restart Prometheus to apply the changes.
337+
>[!NOTE]
338+
> After editing the configuration file, restart Prometheus for the changes to apply.
322339

323340

324341
## Verify if the remote-write data is flowing
@@ -338,7 +355,9 @@ To use the Prometheus explorer, from to your Azure Monitor workspace in the Azur
338355
Use PromQL queries in Grafana and verify that the results return expected data. See [getting Grafana setup with Managed Prometheus](../essentials/prometheus-grafana.md) to configure Grafana.
339356

340357

341-
## Troubleshoot remote write
358+
359+
360+
## Troubleshoot remote write <<<< Move to separate article and link from all related articles>>>>
342361

343362
It takes about 30 minutes for the assignment of the role to take effect.
344363
During this time you may see an HTTP 403 error in the Prometheus log. Check that you have configured the managed identity or Microsoft Entra ID application correctly, and if so, wait 30 minutes for the role assignment to take effect.

0 commit comments

Comments
 (0)