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: Authenticate to Azure Deployment Environments REST APIs
3
-
description: Learn how to authenticate to Azure Deployment Environments REST APIs.
3
+
description: Learn how to authenticate to Azure Deployment Environments REST APIs by using Microsoft Entra ID.
4
4
ms.service: deployment-environments
5
5
ms.custom: ignite-2022, build-2023
6
6
ms.topic: conceptual
7
7
ms.author: chrismiller
8
8
author: chrismiller
9
-
ms.date: 09/07/2023
9
+
ms.date: 11/22/2023
10
10
---
11
-
# Authenticating to Azure Deployment Environments REST APIs
12
11
13
-
> [!TIP]
14
-
> Before authenticating, ensure that the user or identity has the appropriate permissions to perform the desired action. For more information, see [configuring project admins](./how-to-configure-project-admin.md) and [configuring environment users](./how-to-configure-deployment-environments-user.md).
12
+
# Authenticate to Azure Deployment Environments REST APIs
15
13
14
+
> [!TIP]
15
+
> Before authenticating, ensure that the user or identity has the appropriate permissions to perform the desired action. For more information, see [Provide access for dev team leads](./how-to-configure-project-admin.md) and [Provide access for developers](./how-to-configure-deployment-environments-user.md).
## Using Microsoft Entra authentication for REST APIs
19
+
## Use Microsoft Entra ID authentication for REST APIs
20
20
21
-
Use the following procedures to authenticate with Microsoft Entra ID. You can follow along in [Azure Cloud Shell](../../articles/cloud-shell/quickstart.md), on an Azure virtual machine, or on your local machine.
21
+
Use the following procedures to access Azure Deployment Environments REST APIs by using Microsoft Entra ID. You can follow along in [Azure Cloud Shell](../../articles/cloud-shell/quickstart.md), on an Azure virtual machine, or on your local machine.
22
22
23
-
### Sign in to the user's Azure subscription
23
+
### Sign in to your Azure subscription
24
24
25
25
Start by authenticating with Microsoft Entra ID by using the Azure CLI. This step isn't required in Azure Cloud Shell.
26
26
27
27
```azurecli
28
28
az login
29
29
```
30
30
31
-
The command opens a browser window to the Microsoft Entra authentication page. It requires you to give your Microsoft Entra user ID and password.
31
+
The command opens a browser window to the Microsoft Azure authentication page, where you can choose an account. The page requires you to give your Microsoft Entra ID username and password.
32
32
33
-
Next, set the correct subscription context. If you authenticate from an incorrect subscription or tenant you may receive unexpected 403 Forbidden errors.
33
+
Next, set the correct subscription context. If you authenticate from an incorrect subscription or tenant, you might receive unexpected **403 Forbidden** errors.
34
34
35
35
```azurecli
36
36
az account set --subscription <subscription_id>
37
37
```
38
38
39
-
40
39
<aname='retrieve-the-azure-ad-access-token'></a>
41
40
42
-
### Retrieve the Microsoft Entra access token
41
+
### Retrieve the Microsoft Entra ID access token
43
42
44
-
Use the Azure CLI to acquire an access token for the Microsoft Entra authenticated user.
45
-
Note that the resource ID is different depending on if you are accessing administrator (control plane) APIs or developer (data plane) APIs.
43
+
Use the Azure CLI to acquire an access token for the Microsoft Entra ID authenticated user. The resource ID is different depending on if you access administrator (control plane) APIs or developer (data plane) APIs.
46
44
47
45
For administrator APIs, use the following command:
48
46
```azurecli-interactive
@@ -54,7 +52,7 @@ For developer APIs, use the following command:
54
52
az account get-access-token --resource https://devcenter.azure.com
55
53
```
56
54
57
-
After authentication is successful, Microsoft Entra ID returns an access token for current Azure subscription:
55
+
After authentication is successful, Microsoft Entra ID returns an access token for the current Azure subscription:
58
56
59
57
```json
60
58
{
@@ -66,14 +64,16 @@ After authentication is successful, Microsoft Entra ID returns an access token f
66
64
}
67
65
```
68
66
69
-
The token is a Base64 string. The token is valid for at least 5 minutes with the maximum of 90 minutes. The expiresOn defines the actual token expiration time.
67
+
The token is a Base64 string. The token is valid for at least five minutes. The maximum duration is 90 minutes. The `expiresOn` defines the actual token expiration time.
70
68
71
69
> [!TIP]
72
-
> Developer API tokens for the service are encrypted and cannot be decoded using JWT decoding tools. They can only be processed by the service.
70
+
> Developer API tokens for the service are encrypted and can't be decoded using JWT decoding tools. They can only be processed by the service.
73
71
74
72
75
-
### Using a bearer token to access REST APIs
76
-
To access REST APIs, you must set the Authorization header on your request. The header value should be the string `Bearer` followed by a space and the token you received in the previous step.
73
+
### Use a bearer token to access REST APIs
74
+
75
+
To access REST APIs, you must set the authorization header on your request. The header value should be the string `Bearer` followed by a space and the token you received in the previous step.
0 commit comments