Skip to content

Commit 4991253

Browse files
authored
Merge pull request #296634 from v-albemi/authenticate
Freshness Edit: Azure Deployment Environments Set 2
2 parents f70caaa + 5131bef commit 4991253

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
title: Authenticate to Azure Deployment Environments REST APIs
3-
description: Learn how to authenticate to Azure Deployment Environments REST APIs as administrator or developer, by using the Azure CLI.
3+
description: Learn how to authenticate to Azure Deployment Environments REST APIs, as administrator or developer, by using Azure CLI.
44
ms.service: azure-deployment-environments
55
ms.custom: build-2023
66
ms.topic: concept-article
77
ms.author: rosemalcolm
88
author: RoseHJM
9-
ms.date: 01/31/2025
9+
ms.date: 03/21/2025
1010

11-
#customer intent: As a developer, I want to learn how to authenticate to Microsoft Dev Box REST APIs, so that I can securely interact with Microsoft Dev Box services.
11+
#customer intent: As a developer, I want to learn how to authenticate to Microsoft Dev Box REST APIs so that I can securely interact with Microsoft Dev Box services.
1212
---
1313

1414
# Authenticate to Azure Deployment Environments REST APIs
1515

16-
In this article, you'll learn how to authenticate to Microsoft Dev Box REST APIs using the Azure CLI. Authentication is a crucial step for accessing both administrator (control plane) and developer (data plane) APIs. This guide walks you through retrieving an access token from Microsoft Entra ID, understanding the token's structure and validity, and using the bearer token to access REST APIs. By following these steps, you can securely interact with Microsoft Dev Box services.
16+
In this article, you learn how to authenticate to Microsoft Dev Box REST APIs by using Azure CLI. Authentication is a crucial step for accessing both administrator (control plane) and developer (data plane) APIs. This guide walks you through retrieving an access token from Microsoft Entra ID, understanding the token's structure and validity, and using the bearer token to access REST APIs. By following these steps, you can securely interact with Microsoft Dev Box services.
1717

1818
> [!TIP]
1919
> 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).
@@ -22,19 +22,19 @@ In this article, you'll learn how to authenticate to Microsoft Dev Box REST APIs
2222

2323
## Use Microsoft Entra ID authentication for REST APIs
2424

25-
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.
25+
Use the following procedures to access Azure Deployment Environments REST APIs by using Microsoft Entra ID. You can use Azure CLI or [Azure Cloud Shell](../../articles/cloud-shell/quickstart.md), on an Azure virtual machine or on your local computer.
2626

2727
### Sign in to your Azure subscription
2828

29-
Start by authenticating with Microsoft Entra ID by using the Azure CLI. This step isn't required in Azure Cloud Shell.
29+
Start by authenticating with Microsoft Entra ID by using Azure CLI. This step isn't required in Azure Cloud Shell.
3030

3131
```azurecli
3232
az login
3333
```
3434

35-
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.
35+
The command opens a browser window to the Microsoft Azure authentication page, where you can choose an account. The page requires you to provide your Microsoft Entra ID user name and password.
3636

37-
Next, set the correct subscription context. If you authenticate from an incorrect subscription or tenant, you might receive unexpected *403 Forbidden* errors.
37+
Next, set the correct subscription context. If you authenticate from an incorrect subscription or tenant, you might receive *403 Forbidden* errors.
3838

3939
```azurecli
4040
az account set --subscription <subscription_id>
@@ -44,19 +44,21 @@ az account set --subscription <subscription_id>
4444

4545
### Retrieve the Microsoft Entra ID access token
4646

47-
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.
47+
Use Azure CLI to acquire an access token for the Microsoft Entra ID authenticated user. The resource ID differs, depending on whether you access administrator (control plane) APIs or developer (data plane) APIs.
4848

4949
For administrator APIs, use the following command:
50+
5051
```azurecli-interactive
5152
az account get-access-token
5253
```
5354

5455
For developer APIs, use the following command:
56+
5557
```azurecli-interactive
5658
az account get-access-token --resource https://devcenter.azure.com
5759
```
5860

59-
After authentication is successful, Microsoft Entra ID returns an access token for the current Azure subscription:
61+
After authentication succeeds, Microsoft Entra ID returns an access token for the current Azure subscription:
6062

6163
```json
6264
{
@@ -68,16 +70,15 @@ After authentication is successful, Microsoft Entra ID returns an access token f
6870
}
6971
```
7072

71-
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.
73+
The token is a Base64 string. The token is valid for at least five minutes. The maximum duration is 90 minutes. The `expiresOn` value defines the actual token expiration time.
7274

7375
> [!TIP]
74-
> 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.
75-
76+
> Developer API tokens for the service are encrypted and can't be decoded by JWT decoding tools. They can be processed only by the service.
7677
7778
### Use a bearer token to access REST APIs
7879

7980
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.
8081

8182
## Related content
8283

83-
- Review [Microsoft Entra ID fundamentals](../../articles/active-directory/fundamentals/whatis.md)
84+
- [Microsoft Entra ID fundamentals](../../articles/active-directory/fundamentals/whatis.md)

0 commit comments

Comments
 (0)