Fork me on GitHub

Microsoft Azure

The Azure provider for Pulumi can be used to provision any of the cloud resources available in Azure via Azure Resource Manager (ARM). The Azure provider must be configured with credentials to deploy and update resources in Azure.

See the full API documentation for complete details of the available Azure provider APIs.

Setup

The Azure provider supports several options for providing access to Azure credentials. See Azure installation page for details.

Getting Started

The easiest way to start with Azure is to follow one of these examples:

Example

const azure = require("@pulumi/azure")

const resourceGroupName = new azure.core.ResourceGroup("my-group", {
    location: "westus2",
});

You can find additional examples of using Azure in the Pulumi examples repo.

Libraries

The following packages are available in package managers:

The Azure provider is open source and available in the pulumi/pulumi-azure repo.

Configuration

The Azure provider accepts the following configuration settings. These can be provided to the default Azure provider via pulumi config set azure:<option>, or passed to the constructor of new azure.Provider to construct a specific instance of the Azure provider.

  • environment: (Required) The cloud environment to use. It can also be sourced from the ARM_ENVIRONMENT environment variable. Supported values are: public (default), usgovernment, german, china.
  • clientId: (Optional) The client ID to use. It can also be sourced from the ARM_CLIENT_ID environment variable.
  • clientSecret: (Optional) The client secret to use. It can also be sourced from the ARM_CLIENT_SECRET environment variable.
  • msiEndpoint: (Optional) The REST endpoint to retrieve an MSI token from. Terraform will attempt to discover this automatically but it can be specified manually here. It can also be sourced from the ARM_MSI_ENDPOINT environment variable.
  • skipCredentialsValidation: (Optional) Prevents the provider from validating the given credentials. When set to true, skip_provider_registration is assumed. It can also be sourced from the ARM_SKIP_CREDENTIALS_VALIDATION environment variable; defaults to false.
  • skipProviderRegistration: (Optional) Prevents the provider from registering the ARM provider namespaces, this can be used if you don’t wish to give the Active Directory Application permission to register resource providers. It can also be sourced from the ARM_SKIP_PROVIDER_REGISTRATION environment variable; defaults to false.
  • subscriptionId: (Optional) The subscription ID to use. It can also be sourced from the ARM_SUBSCRIPTION_ID environment variable.
  • tenantId: (Optional) The tenant ID to use. It can also be sourced from the ARM_TENANT_ID environment variable.
  • useMsi: (Optional) Set to true to authenticate using managed service identity. It can also be sourced from the ARM_USE_MSI environment variable.