Stores the state as a Blob with the given Key within the Blob Container within the Blob Storage Account.
This backend supports state locking and consistency checking with Azure Blob Storage native capabilities.
The azurerm
backend supports 3 methods of authenticating to the storage account:
The Access Key method can be used directly, by specifying the access key, or in combination with an Azure AD principal (e.g. user, service principal or managed identity). To use an Access Key directly you must generate one for your state file blob and specify it in the backend configuration. If neither an access key or client ID is specified, Terraform will attempt to use Azure CLI. In both cases where no access key is given, Terraform will attempt to retrieve the access key for the storage account, using the authenticated Azure AD principal.
The Azure Active Directory method can only be used in combination with an Azure AD principal. To use the Azure Active Directory method you must set the use_azuread_auth
variable to true
in your backend configuration. This will cause the backend to use the Access Token of the Azure AD principal to authenticate to the state file blob, instead of authenticating using a shared access key.
The SAS Token method can only be used directly. You must generate a SAS Token for your state file blob and pass it to the backend config.
The azurerm
backend supports the following authentication scenarios to connect to the storage account, based on the configuration variables provided:
Authentication Method | Storage Account Authentication Type | Minimum Required Configuration†|
---|---|---|
User Principal via Azure CLI | Access Key | N/A |
User Principal via Azure CLI | Azure AD | use_azuread_auth = true |
Service Principal or User Assigned Managed Identity via OIDC (Workload identity federation) | Access Key | use_oidc = true |
Service Principal or User Assigned Managed Identity via OIDC (Workload identity federation) | Azure AD | use_azuread_auth = true , use_oidc = true |
Managed Identity Principal | Access Key | use_msi = true |
Managed Identity Principal | Azure AD | use_azuread_auth = true , use_msi = true |
Service Principal via Client Secret | Access Key | client_secret = "..." |
Service Principal via Client Secret | Azure AD | use_azuread_auth = true , client_secret = "..." |
Service Principal via Client Certificate | Access Key | client_certificate_path = "..." |
Service Principal via Client Certificate | Azure AD | client_certificate_path = "... , use_azuread_auth = true |
Access Key direct | Access Key | access_key = "..." |
SAS Token direct | SAS Token | sas_token = "..." |
†There are sometimes more options needed for successful authentication. The variable shown is the one that triggers the backend to use a given authentication scenario. You can see examples of each option below.
This method is not suitable for automation since it only supports a User Principal. To check which tenant and subscription you are pointed to, run az account show
.
Connect to Storage Account with Access Key
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
}
}
Connect to Storage Account with Azure Active Directory authentication
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
use_azuread_auth = true # Can also be set via `ARM_USE_AZUREAD` environment variable.
}
}
You can use an App Registration (Service Principal) or a User Assigned Managed Identity to configure federated credentials. You must supply the Client ID of the principal.
Connect to Storage Account with Access Key
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
use_oidc = true # Can also be set via `ARM_USE_OIDC` environment variable.
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
}
}
Connect to Storage Account with Azure Active Directory authentication
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
use_oidc = true # Can also be set via `ARM_USE_OIDC` environment variable.
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
use_azuread_auth = true # Can also be set via `ARM_USE_AZUREAD` environment variable.
}
}
You can use a User Assigned Managed Identity as well as a System Assigned Managed Identity on your agent / runner compute environment. However the backend does not currently support specifying the Client ID of the User Assigned Managed Identity, so you can only supply one per compute instance.
Connect to Storage Account with Access Key
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
use_msi = true # Can also be set via `ARM_USE_MSI` environment variable.
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
}
}
Connect to Storage Account with Azure Active Directory authentication
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
use_msi = true # Can also be set via `ARM_USE_MSI` environment variable.
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
use_azuread_auth = true # Can also be set via `ARM_USE_AZUREAD` environment variable.
}
}
Connect to Storage Account with Access Key
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
client_secret = "************************************" # Can also be set via `ARM_CLIENT_SECRET` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
}
}
Connect to Storage Account with Azure Active Directory authentication
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
client_secret = "************************************" # Can also be set via `ARM_CLIENT_SECRET` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
use_azuread_auth = true # Can also be set via `ARM_USE_AZUREAD` environment variable.
}
}
Connect to Storage Account with Access Key
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
client_certificate_path = "/path/to/bundle.pfx" # Can also be set via `ARM_CLIENT_CERTIFICATE_PATH` environment variable.
client_certificate_password = "************************************" # Can also be set via `ARM_CLIENT_CERTIFICATE_PASSWORD` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
}
}
Connect to Storage Account with Azure Active Directory authentication
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
client_certificate_path = "/path/to/bundle.pfx" # Can also be set via `ARM_CLIENT_CERTIFICATE_PATH` environment variable.
client_certificate_password = "************************************" # Can also be set via `ARM_CLIENT_CERTIFICATE_PASSWORD` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
use_azuread_auth = true # Can also be set via `ARM_USE_AZUREAD` environment variable.
}
}
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
access_key = "abcdefghijklmnopqrstuvwxyz0123456789..." # Can also be set via `ARM_ACCESS_KEY` environment variable.
}
}
terraform {
backend "azurerm" {
resource_group_name = "StorageAccount-ResourceGroup" # Can be passed via `-backend-config=`"resource_group_name=<resource group name>"` in the `init` command.
storage_account_name = "abcd1234" # Can be passed via `-backend-config=`"storage_account_name=<storage account name>"` in the `init` command.
container_name = "tfstate" # Can be passed via `-backend-config=`"container_name=<container name>"` in the `init` command.
key = "prod.terraform.tfstate" # Can be passed via `-backend-config=`"key=<blob key name>"` in the `init` command.
sas_token = "abcdefghijklmnopqrstuvwxyz0123456789..." # Can also be set via `ARM_SAS_TOKEN` environment variable.
}
}
This method is not suitable for automation since it only supports a User Principal. To check which tenant and subscription you are pointed to, run az account show
.
Connect to Storage Account with Access Key
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
}
}
Connect to Storage Account with Azure Active Directory authentication
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
use_azuread_auth = true # Can also be set via `ARM_USE_AZUREAD` environment variable.
}
}
You can use an App Registration (Service Principal) or a User Assigned Managed Identity to configure federated credentials. You must supply the Client ID of the principal.
Connect to Storage Account with Access Key
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
use_oidc = true # Can also be set via `ARM_USE_OIDC` environment variable.
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
}
}
Connect to Storage Account with Azure Active Directory authentication
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
use_oidc = true # Can also be set via `ARM_USE_OIDC` environment variable.
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
use_azuread_auth = true # Can also be set via `ARM_USE_AZUREAD` environment variable.
}
}
You can use a User Assigned Managed Identity as well as a System Assigned Managed Identity on your agent / runner compute environment. However the backend does not currently support specifying the Client ID of the User Assigned Managed Identity, so you can only supply one per compute instance.
Connect to Storage Account with Access Key
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
use_msi = true # Can also be set via `ARM_USE_MSI` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
}
}
Connect to Storage Account with Azure Active Directory authentication
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
use_msi = true # Can also be set via `ARM_USE_MSI` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
use_azuread_auth = true # Can also be set via `ARM_USE_AZUREAD` environment variable.
}
}
Connect to Storage Account with Access Key
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
client_secret = "************************************" # Can also be set via `ARM_CLIENT_SECRET` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
}
}
Connect to Storage Account with Azure Active Directory authentication
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
client_secret = "************************************" # Can also be set via `ARM_CLIENT_SECRET` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
use_azuread_auth = true # Can also be set via `ARM_USE_AZUREAD` environment variable.
}
}
Connect to Storage Account with Access Key
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
client_certificate_path = "/path/to/bundle.pfx" # Can also be set via `ARM_CLIENT_CERTIFICATE_PATH` environment variable.
client_certificate_password = "************************************" # Can also be set via `ARM_CLIENT_CERTIFICATE_PASSWORD` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
}
}
Connect to Storage Account with Azure Active Directory authentication
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
client_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_CLIENT_ID` environment variable.
client_certificate_path = "/path/to/bundle.pfx" # Can also be set via `ARM_CLIENT_CERTIFICATE_PATH` environment variable.
client_certificate_password = "************************************" # Can also be set via `ARM_CLIENT_CERTIFICATE_PASSWORD` environment variable.
subscription_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_SUBSCRIPTION_ID` environment variable.
tenant_id = "00000000-0000-0000-0000-000000000000" # Can also be set via `ARM_TENANT_ID` environment variable.
use_azuread_auth = true # Can also be set via `ARM_USE_AZUREAD` environment variable.
}
}
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
access_key = "abcdefghijklmnopqrstuvwxyz0123456789..." # Can also be set via `ARM_ACCESS_KEY` environment variable.
}
}
data "terraform_remote_state" "foo" {
backend = "azurerm"
config = {
resource_group_name = "StorageAccount-ResourceGroup"
storage_account_name = "terraform123abc"
container_name = "tfstate"
key = "prod.terraform.tfstate"
sas_token = "abcdefghijklmnopqrstuvwxyz0123456789..." # Can also be set via `ARM_SAS_TOKEN` environment variable.
}
}
The following configuration options are supported:
storage_account_name
- (Required) The Name of the Storage Account.
container_name
- (Required) The Name of the Storage Container within the Storage Account.
key
- (Required) The name of the Blob used to retrieve/store Terraform's State file inside the Storage Container.
environment
- (Optional) The Azure Environment which should be used. This can also be sourced from the ARM_ENVIRONMENT
environment variable. Possible values are public
, china
, german
, stack
and usgovernment
. Defaults to public
.
endpoint
- (Optional) The Custom Endpoint for Azure Resource Manager. This can also be sourced from the ARM_ENDPOINT
environment variable.
metadata_host
- (Optional) The Hostname of the Azure Metadata Service (for example management.azure.com
), used to obtain the Cloud Environment when using a Custom Azure Environment. This can also be sourced from the ARM_METADATA_HOSTNAME
Environment Variable.
snapshot
- (Optional) Should the Blob used to store the Terraform Statefile be snapshotted before use? Defaults to false
. This value can also be sourced from the ARM_SNAPSHOT
environment variable.
When authenticating using a Managed Identity (MSI) - the following fields are also supported:
resource_group_name
- (Required) The Name of the Resource Group in which the Storage Account exists.
msi_endpoint
- (Optional) The path to a custom Managed Service Identity endpoint which is automatically determined if not specified. This can also be sourced from the ARM_MSI_ENDPOINT
environment variable.
subscription_id
- (Optional) The Subscription ID in which the Storage Account exists. This can also be sourced from the ARM_SUBSCRIPTION_ID
environment variable.
tenant_id
- (Optional) The Tenant ID in which the Subscription exists. This can also be sourced from the ARM_TENANT_ID
environment variable.
use_msi
- (Optional) Should Managed Service Identity authentication be used? This can also be sourced from the ARM_USE_MSI
environment variable.
When authenticating using a Service Principal with OpenID Connect (OIDC / Workload Identity Federation) - the following fields are also supported:
oidc_request_url
- (Optional) The URL for the OIDC provider from which to request an ID token. This can also be sourced from the ARM_OIDC_REQUEST_URL
or ACTIONS_ID_TOKEN_REQUEST_URL
environment variables.
oidc_request_token
- (Optional) The bearer token for the request to the OIDC provider. This can also be sourced from the ARM_OIDC_REQUEST_TOKEN
or ACTIONS_ID_TOKEN_REQUEST_TOKEN
environment variables.
oidc_token
- (Optional) The ID token when authenticating using OpenID Connect (OIDC). This can also be sourced from the ARM_OIDC_TOKEN
environment variable.
oidc_token_file_path
- (Optional) The path to a file containing an ID token when authenticating using OpenID Connect (OIDC). This can also be sourced from the ARM_OIDC_TOKEN_FILE_PATH
environment variable.
use_oidc
- (Optional) Should OIDC authentication be used? This can also be sourced from the ARM_USE_OIDC
environment variable.
When authenticating using a SAS Token associated with the Storage Account - the following fields are also supported:
sas_token
- (Optional) The SAS Token used to access the Blob Storage Account. This can also be sourced from the ARM_SAS_TOKEN
environment variable.When authenticating using the Storage Account's Access Key - the following fields are also supported:
access_key
- (Optional) The Access Key used to access the Blob Storage Account. This can also be sourced from the ARM_ACCESS_KEY
environment variable.When authenticating using an Azure AD Service Principal, you have the option to use Azure Active Directory authentication for the storage account (rather than by an Access Key or SAS Token) - the following fields are also supported:
use_azuread_auth
- (Optional) Whether Azure Active Directory Authentication should be used to access the Blob Storage Account. This can also be sourced from the ARM_USE_AZUREAD
environment variable.When authenticating using a Service Principal with a Client Certificate - the following fields are also supported:
resource_group_name
- (Required) The Name of the Resource Group in which the Storage Account exists.
client_id
- (Optional) The Client ID of the Service Principal. This can also be sourced from the ARM_CLIENT_ID
environment variable.
client_certificate_password
- (Optional) The password associated with the Client Certificate specified in client_certificate_path
. This can also be sourced from the ARM_CLIENT_CERTIFICATE_PASSWORD
environment variable.
client_certificate_path
- (Optional) The path to the PFX file used as the Client Certificate when authenticating as a Service Principal. This can also be sourced from the ARM_CLIENT_CERTIFICATE_PATH
environment variable.
subscription_id
- (Optional) The Subscription ID in which the Storage Account exists. This can also be sourced from the ARM_SUBSCRIPTION_ID
environment variable.
tenant_id
- (Optional) The Tenant ID in which the Subscription exists. This can also be sourced from the ARM_TENANT_ID
environment variable.
When authenticating using a Service Principal with a Client Secret - the following fields are also supported:
resource_group_name
- (Required) The Name of the Resource Group in which the Storage Account exists.
client_id
- (Optional) The Client ID of the Service Principal. This can also be sourced from the ARM_CLIENT_ID
environment variable.
client_secret
- (Optional) The Client Secret of the Service Principal. This can also be sourced from the ARM_CLIENT_SECRET
environment variable.
subscription_id
- (Optional) The Subscription ID in which the Storage Account exists. This can also be sourced from the ARM_SUBSCRIPTION_ID
environment variable.
tenant_id
- (Optional) The Tenant ID in which the Subscription exists. This can also be sourced from the ARM_TENANT_ID
environment variable.