Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

Azure-Native

The native 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 native 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.

From there, you can dive deeper with additional Azure examples:

Migration

The differences between the classic Azure provider and the native Azure provider and the process of migration are outlined in the Migration Guide guide.

If you are migrating from Azure Resource Manager templates, read our Migrate From Azure Resource Manager guide.

Example

import * as resources from "@pulumi/azure-native/resources";

const resourceGroup = new resources.ResourceGroup("resourceGroup");
import pulumi_azure_native as azure_native

resource_group = azure_native.resources.ResourceGroup("resourceGroup")
using Pulumi;
using Pulumi.AzureNative.Resources;

class MyStack : Stack
{
    public MyStack()
    {
        var resourceGroup = new ResourceGroup("resourceGroup");
    }

}

class Program
{
    static Task<int> Main(string[] args) => Deployment.RunAsync<MyStack>();
}
package main

import (
    "github.com/pulumi/pulumi-azure-native/sdk/go/azure/resources"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := resources.NewResourceGroup(ctx, "resourceGroup", nil)
        if err != nil {
            return err
        }
        return nil
    })
}

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:

The native Azure provider SDKs are open source and available in the pulumi/pulumi-azure-native repo.

Configuration

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

  • auxiliaryTenantIds: (Optional) It can also be sourced from the following environment variable: ARM_AUXILIARY_TENANT_IDS
  • clientCertificatePassword: (Optional) The password associated with the Client Certificate. For use when authenticating as a Service Principal using a Client Certificate It can also be sourced from the following environment variable: ARM_CLIENT_CERTIFICATE_PASSWORD
  • clientCertificatePath: (Optional) The path to the Client Certificate associated with the Service Principal for use when authenticating as a Service Principal using a Client Certificate. It can also be sourced from the following environment variable: ARM_CLIENT_CERTIFICATE_PATH
  • clientId: (Optional) The Client ID which should be used. It can also be sourced from the following environment variable: ARM_CLIENT_ID
  • clientSecret: (Optional) The Client Secret which should be used. For use When authenticating as a Service Principal using a Client Secret. It can also be sourced from the following environment variable: ARM_CLIENT_SECRET
  • disablePulumiPartnerId: (Optional) This will disable the Pulumi Partner ID which is used if a custom partnerId isn’t specified. It can also be sourced from the following environment variable: ARM_DISABLE_PULUMI_PARTNER_ID
  • environment: (Optional) The Cloud Environment which should be used. Possible values are public, usgovernment, german, and china. Defaults to public. It can also be sourced from the following environment variable: ARM_ENVIRONMENT
  • msiEndpoint: (Optional) The path to a custom endpoint for Managed Service Identity - in most circumstances this should be detected automatically. It can also be sourced from the following environment variable: ARM_MSI_ENDPOINT
  • partnerId: (Optional) A GUID/UUID that is registered with Microsoft to facilitate partner resource usage attribution. It can also be sourced from the following environment variable: ARM_PARTNER_ID
  • subscriptionId: (Optional) The Subscription ID which should be used. It can also be sourced from the following environment variable: ARM_SUBSCRIPTION_ID
  • tenantId: (Optional) The Tenant ID which should be used. It can also be sourced from the following environment variable: ARM_TENANT_ID
  • useMsi: (Optional) Allowed Managed Service Identity be used for Authentication. It can also be sourced from the following environment variable: ARM_USE_MSI

For Pulumi support and troubleshooting, click the links in the sidebar on the left of the page.