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
@@ -22,7 +22,7 @@ Use the [**Azure CLI**](/cli/azure/install-azure-cli) to issue a [Microsoft Entr
22
22
| Azure CLI | Download and install the [Azure CLI](/cli/azure/install-azure-cli). |
23
23
| Entra app | (If authenticating for a service principal) Create the Entra application and have the app client ID and client secret ready. |
24
24
25
-
## Acquiring an Entra token for yourself
25
+
## Get an Entra token for yourself
26
26
27
27
# [Azure CLI](#tab/azure-cli)
28
28
@@ -43,21 +43,24 @@ Use the [**Azure CLI**](/cli/azure/install-azure-cli) to issue a [Microsoft Entr
43
43
```
44
44
45
45
# [Azure PowerShell](#tab/azure-powershell)
46
+
## Get a token for a user
46
47
47
48
1. Sign in to Azure PowerShell using the `Connect-AzAccount` command and follow the on-screen instructions.
48
-
1. Set the correct subscription for the signed-in user with these PowerShell commands. Make sure the Azure subscription ID is associated with the tenant connected to the Azure DevOps organization you're trying to access. If you don't know your subscription ID, you can find it in the [Azure portal](/azure/azure-portal/get-subscription-tenant-id).
49
+
2. Set the correct subscription for the signed-in user with these PowerShell commands. Make sure the Azure subscription ID is associated with the tenant connected to the Azure DevOps organization you're trying to access. If you don't know your subscription ID, you can find it in the [Azure portal](/azure/azure-portal/get-subscription-tenant-id).
49
50
50
51
```azurepowershell-interactive
51
52
Set-AzContext -Subscription <subscriptionID>
52
53
```
53
54
54
-
1. Generate a Microsoft Entra ID access token with the `Get-AzAccessToken` command using the Azure DevOps resource ID: `499b84ac-1321-427f-aa17-267ca6975798`.
55
+
3. Generate a Microsoft Entra ID access token with the `Get-AzAccessToken` command using the Azure DevOps resource ID: `499b84ac-1321-427f-aa17-267ca6975798`.
> [Get-AzAccessToken](/powershell/module/az.accounts/get-azaccesstoken) returns the token as a [SecureString](/dotnet/api/system.security.securestring). If you're unsure of how to use SecureString, refer to the documentation. To convert a SecureString to plain text to use in an Auth Header, leverage the .NET [[System.Runtime.InteropServices.Marshal]](/dotnet/api/system.runtime.interopservices.marshal) class to [convert](/dotnet/api/system.runtime.interopservices.marshal.securestringtobstr) the SecureString to a BSTR (binary string) pointer, then [read](/dotnet/api/system.runtime.interopservices.marshal.ptrtostringbstr) the pointer as a plain text string to a variable.
59
62
60
-
## Acquiring a token for a service principal
63
+
## Get a token for a service principal
61
64
62
65
1. Sign in to the Azure CLI as the service principal using the `az devops login` command.
63
66
2. Follow the on-screen instructions and finish signing in.
0 commit comments