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
Copy file name to clipboardExpand all lines: articles/azure-monitor/essentials/rest-api-walkthrough.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,9 @@ Tasks executed using the Azure Monitor API use the Azure Resource Manager authen
22
22
23
23
## Create an Azure Active Directory service principal
24
24
25
-
### [Azure Portal](#tab/portal)
25
+
### [Azure portal](#tab/portal)
26
26
27
-
To create an Azure Active Directory service principal using the Azure Portal see [Register an App to request authorization tokens and work with APIs](../logs/api/register-app-for-token)
27
+
To create an Azure Active Directory service principal using the Azure portal see [Register an App to request authorization tokens and work with APIs](../logs/api/register-app-for-token)
28
28
29
29
### [Azure CLI](#tab/cli)
30
30
@@ -48,7 +48,7 @@ The response looks as follows:
48
48
>[!Important]
49
49
> The output includes credentials that you must protect. Be sure that you do not include these credentials in your code or check the credentials into your source control.
50
50
51
-
Add a role and scope for the resouces that you want to access using the API
51
+
Add a role and scope for the resource that you want to access using the API
52
52
53
53
```azurecli
54
54
az role assignment create --assignee <`appId`> --role <Role> --scope <resource URI>
@@ -61,15 +61,15 @@ The example below assigns the `Reader` role to the service principal for all res
61
61
For more information on creating a service principal using Azure CLI, see [Create an Azure service principal with the Azure CLI](https://learn.microsoft.com/cli/azure/create-an-azure-service-principal-azure-cli)
62
62
63
63
64
-
### [Powershell](#tab/powershell)
64
+
### [PowerShell](#tab/powershell)
65
65
66
-
To create an Azure Active Directory service principal using thePowershell see [using Azure PowerShell to create a service principal to access resources](/powershell/azure/create-azure-service-principal-azureps). It's also possible to [create a service principal via the Azure portal](../../active-directory/develop/howto-create-service-principal-portal.md).
66
+
To create an Azure Active Directory service principal using thePowershell, see [using Azure PowerShell to create a service principal for accessing resources](/powershell/azure/create-azure-service-principal-azureps). It's also possible to [create a service principal via the Azure portal](../../active-directory/develop/howto-create-service-principal-portal.md).
67
67
68
68
---
69
69
70
70
## Retrieve a token
71
71
72
-
To retrieve an access token using a REST call submit the following request using the `appId` and `password` for your servide pricipal and app:
72
+
To retrieve an access token using a REST call submit the following request using the `appId` and `password` for your service principal and app:
Use the Azure portal, PowerShell or the Azure CLI to find the resource Id.
443
+
Use the Azure portal, PowerShell or the Azure CLI to find the resource ID.
444
444
445
445
446
446
### [Azure portal](#tab/portal)
@@ -454,7 +454,7 @@ The Resource JSON page is displayed. The resource ID can be copied using the ico
454
454
:::image type="content" source="./media/rest-api-walkthrough/resourceid_azure_portal.png" alt-text="A screenshot showing the Resource JSON page for a resource":::
455
455
456
456
457
-
### [Powershell](#tab/powershell)
457
+
### [PowerShell](#tab/powershell)
458
458
459
459
The resource ID can be retrieved by using Azure PowerShell cmdlets too. For example, to obtain the resource ID for an Azure logic app, execute the `Get-AzureLogicApp` cmdlet, as in the following example:
Copy file name to clipboardExpand all lines: articles/azure-monitor/logs/api/register-app-for-token.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,8 @@ To access Azure REST APIs such as the Log analytics API, or to send custom metri
13
13
14
14
## Register an App
15
15
16
-
Create a service proncipal and refister an usign the Azure Portal, Azure CLI, or Powershell.
17
-
### [Azure Portal](#tab/portal)
16
+
Create a service principal and register an app using the Azure portal, Azure CLI, or PowerShell.
17
+
### [Azure portal](#tab/portal)
18
18
19
19
1. To register an app, open the Active Directory Overview page in the Azure portal.
20
20
@@ -69,13 +69,14 @@ Add a role and scope for the resources that you want to access using the API
69
69
az role assignment create --assignee <`appId`> --role <Role> --scope <resource URI>
70
70
```
71
71
72
-
The example below assigns the `Reader` role to the service principal for all resources in the `rg-001`resource group:
72
+
The CLI example below assigns the `Reader` role to the service principal for all resources in the `rg-001`resource group:
73
+
73
74
```azurecli
74
75
az role assignment create --assignee 0a123b56-c987-1234-abcd-1a2b3c4d5e6f --role Reader --scope '\/subscriptions/a1234bcd-5849-4a5d-a2eb-5267eae1bbc7/resourceGroups/rg-001'
75
76
```
76
77
For more information on creating a service principal using Azure CLI, see [Create an Azure service principal with the Azure CLI](https://learn.microsoft.com/cli/azure/create-an-azure-service-principal-azure-cli)
77
78
78
-
### [Powershell](#tab/powershell)
79
+
### [PowerShell](#tab/powershell)
79
80
The following sample script demonstrates creating an Azure Active Directory service principal via PowerShell. For a more detailed walkthrough, see the documentation on [using Azure PowerShell to create a service principal to access resources](/powershell/azure/create-azure-service-principal-azureps). It's also possible to [create a service principal via the Azure portal](../../active-directory/develop/howto-create-service-principal-portal.md).
80
81
81
82
@@ -115,9 +116,9 @@ For example,
115
116
116
117
- 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)
117
118
118
-
For more information see [Assign Azure roles using the Azure portal](https://learn.microsoft.com/azure/role-based-access-control/role-assignments-portal)
119
+
For more information, see [Assign Azure roles using the Azure portal](https://learn.microsoft.com/azure/role-based-access-control/role-assignments-portal)
119
120
120
-
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.
121
+
Once you've assigned a role, you can use your app, client ID, and client secret to generate a bearer token to access the REST API.
121
122
122
123
> [!NOTE]
123
124
> 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