AuthUsingEnvironmentVariables.md
June 11, 2024 ยท View on GitHub
Authenticate to Azure using environment variables
You'll need the following values to authenticate to Azure:
- Subscription ID
- Tenant ID
Obtaining the values
These values can be obtained from the portal with the following instructions:
Get Subscription ID
- Log in to your Azure account.
- Select Subscriptions in the left sidebar.
- Select the subscription to be used.
- Select Overview.
- Copy the Subscription ID.
Get Tenant ID
For information on how to get Tenant ID, see this document.
Setting Environment Variables
After you obtain the values, set the following environment variables:
AZURE_TENANT_IDAZURE_SUBSCRIPTION_ID
To set the environment variables on your development system:
Windows:
(Note: Administrator access is required)
- Open the Control Panel.
- Select System Security > System.
- Select Advanced system settings on the left.
- Inside the System Properties window, select the Environment Variables button.
- Select the property you'd like to change, then select the Edit button. If the property name isn't listed, select the New button.
Linux-based OS:
export AZURE_TENANT_ID="__TENANT_ID__"
export AZURE_SUBSCRIPTION_ID="__SUBSCRIPTION_ID__"