Overview
This guide will show you how to create an Azure AD App, configure a Federated Credential, and configure env zero to utilize OIDC. The federated credential within the Azure AD app will be configured to accept env zeroโs OIDC token. Refer to OIDC Integrations for more background on env zeroโs OIDC configuration.Azure AD App + Federated Credential
The Azure AD App will be configured with a Federated Credential in order to accept env zero OIDC token. Using the Azure Portal:- Microsoft Entra ID > App registrations > โ+ New Registrationโ
- Enter Name: e.g. โenv zero OIDC appโ
- Select Supported account types if youโre unsure, choose โSingle tenantโ
- Skip Redirect URI
- Register the app.
- Under the โenv zero OIDC appโ > โCertificates and Secretsโ > โFederated credentialsโ
- โ+ Add credentialโ
- Federated Credential Scenario - Other issuer
- Issuer -
https://login.app.env0.com/
- Subject Identifier -
auth0|xxxxxx
(see the section below on โRetrieving your Subject Identifierโ) - Name - enter a name (e.g. โenv0 OIDCโ)
- Audience -
https://prod.env0.com
- For using the Azure Provider in Terraform, we need to specify the following variables:
ARM_TENANT_ID
- you can find the value in your app registration summary (โenv zero OIDC appโ) under โDirectory (tenant) IDโARM_CLIENT_ID
- you can find the value in your app registration summary (โenv zero OIDC appโ) under โApplication (client) IDโARM_SUBSCRIPTION_ID
- You can retrieve the Subscription ID from the Azure Subscription, or in a Resource Group that you want to use.
Azure App AD App Permissions
In order for Terraform to be able to deploy and manage the resources, we need to associate your Azure AD App with your Subscription or Resource Group- In this example, I will give the โenv zero OIDC appโ the โContributorโ role in my โsales-acme-demoโ resource group. This means that env zero will only be able to create and manage resources within this resource group.
- Go to the Resource Group (โsales-acme-demoโ) > Access Control (IAM)
- Click on โ+ Addโ > โAdd role assignmentโ\
- Select a role (the level of privilege to give to Terraform) - in this case, we choose โContributorโ and hit โNextโ
- Assign access to โUser, group, or service principalโ
- Select a member by โ+ Select Membersโ
- Search for โenv zero OIDC appโ and hit โSelectโ
- Hit โReview + assignโ\
Configure env0 OIDC Credential
Go to the organizationโs credentials page and create a new deployment credential. SelectAzure OIDC
type and enter the following fields:
Subscription ID
- Azure subscription idTenant ID
- Azure tenant idClient ID
- Azure client id

Azure Provider VersionMake sure you use a version of the Azure provider greater than 3.7.0.
OIDC did not work for โ=3.7.0โ
OIDC did not work for โ=3.7.0โ
Assign your Credential in your Project
After creating your Organization Credential - donโt forget to go into your Project Settings to use the OIDC credential you just created.Deploying to multiple Azure Subscriptions
Sometimes you want to be able to deploy to multiple Azure Subscriptions in one Terraform workspace. In Terraform / OpenTofu, you can specify multiple azure provider blocks in order to target mutliple subscriptions, see example below:Terraform / OpenTofu (hcl)