Skip to content

Commit e8dd304

Browse files
committed
wip 0103
1 parent 2b322d4 commit e8dd304

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

articles/azure-monitor/essentials/rest-api-walkthrough.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Tasks executed using the Azure Monitor API use the Azure Resource Manager authen
2222

2323
## Create an Azure Active Directory service principal
2424

25-
### [Azure Portal](#tab/portal)
25+
### [Azure portal](#tab/portal)
2626

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)
2828

2929
### [Azure CLI](#tab/cli)
3030

@@ -48,7 +48,7 @@ The response looks as follows:
4848
>[!Important]
4949
> 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.
5050
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
5252

5353
```azurecli
5454
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
6161
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)
6262

6363

64-
### [Powershell](#tab/powershell)
64+
### [PowerShell](#tab/powershell)
6565

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).
6767

6868
---
6969

7070
## Retrieve a token
7171

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:
7373

7474
```HTTP
7575
@@ -440,7 +440,7 @@ For example
440440
* **Azure Virtual Machines**: /subscriptions/\<subscription-id>/resourceGroups/\<resource-group-name>/providers/Microsoft.Compute/virtualMachines/\<vm-name>
441441
* **Azure Event Hubs**: /subscriptions/\<subscription-id>/resourceGroups/\<resource-group-name>/providers/Microsoft.EventHub/namespaces/\<eventhub-namespace>
442442

443-
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.
444444

445445

446446
### [Azure portal](#tab/portal)
@@ -454,7 +454,7 @@ The Resource JSON page is displayed. The resource ID can be copied using the ico
454454
:::image type="content" source="./media/rest-api-walkthrough/resourceid_azure_portal.png" alt-text="A screenshot showing the Resource JSON page for a resource":::
455455

456456

457-
### [Powershell](#tab/powershell)
457+
### [PowerShell](#tab/powershell)
458458

459459
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:
460460

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ To access Azure REST APIs such as the Log analytics API, or to send custom metri
1313

1414
## Register an App
1515

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)
1818

1919
1. To register an app, open the Active Directory Overview page in the Azure portal.
2020

@@ -69,13 +69,14 @@ Add a role and scope for the resources that you want to access using the API
6969
az role assignment create --assignee <`appId`> --role <Role> --scope <resource URI>
7070
```
7171

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+
7374
```azurecli
7475
az role assignment create --assignee 0a123b56-c987-1234-abcd-1a2b3c4d5e6f --role Reader --scope '\/subscriptions/a1234bcd-5849-4a5d-a2eb-5267eae1bbc7/resourceGroups/rg-001'
7576
```
7677
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)
7778

78-
### [Powershell](#tab/powershell)
79+
### [PowerShell](#tab/powershell)
7980
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).
8081

8182

@@ -115,9 +116,9 @@ For example,
115116

116117
- 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)
117118

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)
119120

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.
121122

122123
> [!NOTE]
123124
> 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)