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 setup page for details.
Getting Started
The quickest way to get started with Azure is to follow the Get Started guide.
Additionally, a tutorial is available to follow:
- Azure Container Instances Web Server: Create an NGINX web server Azure Container Instance
In addition to the tutorial, several interesting examples are available complete with instructions:
- Azure Function Apps: Create a serverless function
- Azure AppService with SQL and AppInsights: Build an AppService web application that uses SQL and AppInsights
- Azure Kubernetes Service (AKS) Cluster: Create an AKS cluster and deploy a Helm Chart into it
- Azure CosmosDB, AKS and Node.js: Stands up an AKS cluster and a MongoDB-flavored instance of CosmosDB used by a Node.js application.
Example
const azure = require("@pulumi/azure")
const resourceGroupName = new azure.core.ResourceGroup("my-group", {
location: "westus2",
});
Above is one example of an Azure resource group using Pulumi. You can find additional examples in the Pulumi examples repo.
Libraries
The following packages are available in package managers:
- JavaScript/TypeScript:
@pulumi/azure - Python:
pulumi-azure - Go:
github.com/pulumi/pulumi-azure/sdk/go/azure - .NET:
Pulumi.Azure
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.location: (Optional) The location to use. ResourceGroups will consult this property for a default location, if one was not supplied explicitly.clientId: (Optional) The client ID to use. It can also be sourced from theARM_CLIENT_IDenvironment variable.clientSecret: (Optional) The client secret to use. It can also be sourced from theARM_CLIENT_SECRETenvironment variable.msiEndpoint: (Optional) The REST endpoint to retrieve an MSI token from. Pulumi will attempt to discover this automatically but it can be specified manually here. It can also be sourced from theARM_MSI_ENDPOINTenvironment variable.skipCredentialsValidation: (Optional) Prevents the provider from validating the given credentials. When set to true,skip_provider_registrationis assumed. It can also be sourced from theARM_SKIP_CREDENTIALS_VALIDATIONenvironment variable; defaults tofalse.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 theARM_SKIP_PROVIDER_REGISTRATIONenvironment variable; defaults tofalse.subscriptionId: (Optional) The subscription ID to use. It can also be sourced from theARM_SUBSCRIPTION_IDenvironment variable.tenantId: (Optional) The tenant ID to use. It can also be sourced from theARM_TENANT_IDenvironment variable.useMsi: (Optional) Set to true to authenticate using managed service identity. It can also be sourced from theARM_USE_MSIenvironment variable.
For Pulumi support and troubleshooting, click the links in the sidebar on the left of the page.