Skip to content

Commit 901030b

Browse files
committed
final fixes
1 parent 0a1d03e commit 901030b

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed
-11.7 KB
Loading

articles/azure-monitor/essentials/metrics-store-custom-rest-api.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ To send metrics for resources in other environments or on-premises, use [Applica
2020

2121
A service principal is an application whose tokens can be used to authenticate and grant access to specific Azure resources using Azure Active Directory. This includes user-apps, services or automation tools.
2222

23-
1. Register application and create a service principal in your Azure Active Directory tenant by using the instructions found at [Register an application with Azure Active Directory](../logs/api/register-app-for-token.md).
23+
1. [Register an application with Azure Active Directory](../logs/api/register-app-for-token.md) to create a service principal.
2424

2525
1. Save the tenant ID, new client ID, and client secret value for your app to use when requesting a token.
2626

27-
1. Give the app created as part of the previous step, **Monitoring Metrics Publisher** permissions to the resource you wish to emit metrics against. If you plan to use the app to emit custom metrics against many resources, you can grant these permissions at the resource group or subscription level.
27+
1. Give the app created as part of the previous step **Monitoring Metrics Publisher** permissions to the resource you wish to emit metrics against. If you plan to use the app to emit custom metrics against many resources, you can grant these permissions at the resource group or subscription level.
2828

2929
On your resource's overview page, select **Access Control (IAM)**
3030
1. Select **Add**, then **Add role assignment** from the dropdown.
@@ -106,12 +106,12 @@ Save the access token from the response for use in the following HTTP requests.
106106
- **resourceId**: Resource ID of the Azure resource you're tracking the metric against.
107107
- **accessToken**: The authorization token acquired from the previous step.
108108

109-
```Shell
110-
curl -X POST 'https://<location>.monitoring.azure.com/<resourceId>/metrics' \
111-
-H 'Content-Type: application/json' \
112-
-H 'Authorization: Bearer <accessToken>' \
113-
-d @custommetric.json
114-
```
109+
```Shell
110+
curl -X POST 'https://<location>.monitoring.azure.com/<resourceId>/metrics' \
111+
-H 'Content-Type: application/json' \
112+
-H 'Authorization: Bearer <accessToken>' \
113+
-d @custommetric.json
114+
```
115115

116116
1. Change the timestamp and values in the JSON file.
117117
1. Repeat the previous two steps a number of times, to create data for several minutes.
@@ -120,9 +120,9 @@ curl -X POST 'https://<location>.monitoring.azure.com/<resourceId>/metrics' \
120120

121121
If you receive an error message with some part of the process, consider the following troubleshooting information:
122122

123-
* You can't issue metrics against a subscription or resource group, or resource, check that your application or Service Principal has the **Monitoring Metrics Publisher** role assigned in Access control (IAM).
124-
* The number of dimension names must match the values. Check the values and dimentions.
125-
* You might be emitting metrics against a region that doesn’t support custom metrics. See [supported regions](./metrics-custom-overview.md#supported-regions).
123+
- If you can't issue metrics against a subscription or resource group, or resource, check that your application or Service Principal has the **Monitoring Metrics Publisher** role assigned in Access control (IAM).
124+
- Check that the number of dimension names matches the number values.
125+
- Check that you are not emitting metrics against a region that doesn’t support custom metrics. See [supported regions](./metrics-custom-overview.md#supported-regions).
126126

127127
## View your metrics
128128

articles/azure-monitor/logs/api/register-app-for-token.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.topic: article
99

1010
# Register an App to request authorization tokens and work with APIs
1111

12-
To access Azure REST APIs such as the Log analytics API, or to send custom metrics, you can generate an authorization token based on a client ID and secret. The token is then passed in your REST API request. This article shows you how to register a client app and assign permissions to access so that you can generate a token.
12+
To access Azure REST APIs such as the Log analytics API, or to send custom metrics, you can generate an authorization token based on a client ID and secret. The token is then passed in your REST API request. This article shows you how to register a client app and create a client secret so that you can generate a token.
1313

1414
## Register an App
1515

@@ -41,13 +41,15 @@ To access Azure REST APIs such as the Log analytics API, or to send custom metri
4141
## Next steps
4242

4343
Before you can generate a token using your app, client ID, and secret, assign the app to a role using Access control (IAM) for resource that you want to access.
44-
The role will depend on the resource time, and the API that you want to use.
44+
The role will depend on the resource type and the API that you want to use.
45+
For example,
46+
- To grant your app read from a Log Analytics Workspace, add your app as a member to the **Reader** role using Access control (IAM) for your Log Analytics Workspace. For more information, see [Access the API](./access-api.md)
4547

46-
* To grant your app read from a Log Analytics Workspace, add your app as a member to the **Reader** role using Access control (IAM) for your Log Analytics Workspace. For more information, see [Access the API](./access-api.md)
48+
- To grant access to send custom metrics for a resource, add your app as a member to the **Monitoring Metrics Publisher** role using Access control (IAM) for your resource. For more information, see [ Send metrics to the Azure Monitor metric database using REST API](../../essentials/metrics-store-custom-rest-api.md)
4749

48-
* To grant access to send custom metrics for a resource, add your app as a member to the **Monitoring Metrics Publisher** role using Access control (IAM) for your resource. For more information, see [ Send metrics to the Azure Monitor metric database using REST API](../../essentials/metrics-store-custom-rest-api.md)
50+
For more information see [Assign Azure roles using the Azure portal](https://learn.microsoft.com/azure/role-based-access-control/role-assignments-portal)
4951

50-
Once you have roles and permission setup, you can use your client ID and client secret to generate a bearer token to access the REST API.
52+
Once you have assigned a role you can use your app, client ID, and client secret to generate a bearer token to access the REST API.
5153

5254
> [!NOTE]
5355
> When using Azure AD authentication, it may take up to 60 minutes for the Azure Application Insights REST API to recognize new role-based access control (RBAC) permissions. While permissions are propagating, REST API calls may fail with error code 403.

0 commit comments

Comments
 (0)