Want to learn about running containers in Lambda? Join our free hands-on workshop. Register Now

This page documents the language specification for the azure package. If you're looking for help working with the inputs, outputs, or functions of azure resources in a Pulumi program, please see the resource documentation for examples and API reference.

core

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-azure repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-azurerm repo.

class pulumi_azure.core.AwaitableGetClientConfigResult(client_id=None, id=None, object_id=None, subscription_id=None, tenant_id=None)
class pulumi_azure.core.AwaitableGetResourceGroupResult(id=None, location=None, name=None, tags=None)
class pulumi_azure.core.AwaitableGetResourcesResult(id=None, name=None, required_tags=None, resource_group_name=None, resources=None, type=None)
class pulumi_azure.core.AwaitableGetSubscriptionResult(display_name=None, id=None, location_placement_id=None, quota_id=None, spending_limit=None, state=None, subscription_id=None, tenant_id=None)
class pulumi_azure.core.AwaitableGetSubscriptionsResult(display_name_contains=None, display_name_prefix=None, id=None, subscriptions=None)
class pulumi_azure.core.AwaitableGetUserAssignedIdentityResult(client_id=None, id=None, location=None, name=None, principal_id=None, resource_group_name=None, tags=None)
class pulumi_azure.core.CustomProvider(resource_name, opts=None, actions=None, location=None, name=None, resource_group_name=None, resource_types=None, tags=None, validations=None, __props__=None, __name__=None, __opts__=None)

Manages an Azure Custom Provider.

import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="northeurope")
example_custom_provider = azure.core.CustomProvider("exampleCustomProvider",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    resource_type=[{
        "name": "dEf1",
        "endpoint": "https://testendpoint.com/",
    }])
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • actions (pulumi.Input[list]) – Any number of action block as defined below. One of resource_type or action must be specified.

  • location (pulumi.Input[str]) – Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • name (pulumi.Input[str]) – Specifies the name of the Custom Provider. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which to create the Custom Provider.

  • resource_types (pulumi.Input[list]) – Any number of resource_type block as defined below. One of resource_type or action must be specified.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

  • validations (pulumi.Input[list]) – Any number of validation block as defined below.

The actions object supports the following:

  • endpoint (pulumi.Input[str]) - Specifies the endpoint of the action.

  • name (pulumi.Input[str]) - Specifies the name of the action.

The resource_types object supports the following:

  • endpoint (pulumi.Input[str]) - Specifies the endpoint of the route definition.

  • name (pulumi.Input[str]) - Specifies the name of the route definition.

  • routingType (pulumi.Input[str]) - The routing type that is supported for the resource request. Valid values are ResourceTypeRoutingProxy or ResourceTypeRoutingProxyCache. This value defaults to ResourceTypeRoutingProxy.

The validations object supports the following:

  • specification (pulumi.Input[str]) - The endpoint where the validation specification is located.

actions: pulumi.Output[list] = None

Any number of action block as defined below. One of resource_type or action must be specified.

  • endpoint (str) - Specifies the endpoint of the action.

  • name (str) - Specifies the name of the action.

location: pulumi.Output[str] = None

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

name: pulumi.Output[str] = None

Specifies the name of the Custom Provider. Changing this forces a new resource to be created.

resource_group_name: pulumi.Output[str] = None

The name of the resource group in which to create the Custom Provider.

resource_types: pulumi.Output[list] = None

Any number of resource_type block as defined below. One of resource_type or action must be specified.

  • endpoint (str) - Specifies the endpoint of the route definition.

  • name (str) - Specifies the name of the route definition.

  • routingType (str) - The routing type that is supported for the resource request. Valid values are ResourceTypeRoutingProxy or ResourceTypeRoutingProxyCache. This value defaults to ResourceTypeRoutingProxy.

tags: pulumi.Output[dict] = None

A mapping of tags to assign to the resource.

validations: pulumi.Output[list] = None

Any number of validation block as defined below.

  • specification (str) - The endpoint where the validation specification is located.

static get(resource_name, id, opts=None, actions=None, location=None, name=None, resource_group_name=None, resource_types=None, tags=None, validations=None)

Get an existing CustomProvider resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • actions (pulumi.Input[list]) – Any number of action block as defined below. One of resource_type or action must be specified.

  • location (pulumi.Input[str]) – Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • name (pulumi.Input[str]) – Specifies the name of the Custom Provider. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which to create the Custom Provider.

  • resource_types (pulumi.Input[list]) – Any number of resource_type block as defined below. One of resource_type or action must be specified.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

  • validations (pulumi.Input[list]) – Any number of validation block as defined below.

The actions object supports the following:

  • endpoint (pulumi.Input[str]) - Specifies the endpoint of the action.

  • name (pulumi.Input[str]) - Specifies the name of the action.

The resource_types object supports the following:

  • endpoint (pulumi.Input[str]) - Specifies the endpoint of the route definition.

  • name (pulumi.Input[str]) - Specifies the name of the route definition.

  • routingType (pulumi.Input[str]) - The routing type that is supported for the resource request. Valid values are ResourceTypeRoutingProxy or ResourceTypeRoutingProxyCache. This value defaults to ResourceTypeRoutingProxy.

The validations object supports the following:

  • specification (pulumi.Input[str]) - The endpoint where the validation specification is located.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_azure.core.GetClientConfigResult(client_id=None, id=None, object_id=None, subscription_id=None, tenant_id=None)

A collection of values returned by getClientConfig.

id = None

The provider-assigned unique ID for this managed resource.

class pulumi_azure.core.GetResourceGroupResult(id=None, location=None, name=None, tags=None)

A collection of values returned by getResourceGroup.

id = None

The provider-assigned unique ID for this managed resource.

location = None

The Azure Region where the Resource Group exists.

tags = None

A mapping of tags assigned to the Resource Group.

class pulumi_azure.core.GetResourcesResult(id=None, name=None, required_tags=None, resource_group_name=None, resources=None, type=None)

A collection of values returned by getResources.

id = None

The provider-assigned unique ID for this managed resource.

name = None

The name of this Resource.

resources = None

One or more resource blocks as defined below.

type = None

The type of this Resource. (e.g. Microsoft.Network/virtualNetworks).

class pulumi_azure.core.GetSubscriptionResult(display_name=None, id=None, location_placement_id=None, quota_id=None, spending_limit=None, state=None, subscription_id=None, tenant_id=None)

A collection of values returned by getSubscription.

display_name = None

The subscription display name.

id = None

The provider-assigned unique ID for this managed resource.

location_placement_id = None

The subscription location placement ID.

quota_id = None

The subscription quota ID.

spending_limit = None

The subscription spending limit.

state = None

The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.

subscription_id = None

The subscription GUID.

tenant_id = None

The subscription tenant ID.

class pulumi_azure.core.GetSubscriptionsResult(display_name_contains=None, display_name_prefix=None, id=None, subscriptions=None)

A collection of values returned by getSubscriptions.

id = None

The provider-assigned unique ID for this managed resource.

subscriptions = None

One or more subscription blocks as defined below.

class pulumi_azure.core.GetUserAssignedIdentityResult(client_id=None, id=None, location=None, name=None, principal_id=None, resource_group_name=None, tags=None)

A collection of values returned by getUserAssignedIdentity.

client_id = None

The Client ID of the User Assigned Identity.

id = None

The provider-assigned unique ID for this managed resource.

location = None

The Azure location where the User Assigned Identity exists.

principal_id = None

The Service Principal ID of the User Assigned Identity.

tags = None

A mapping of tags assigned to the User Assigned Identity.

class pulumi_azure.core.ResourceGroup(resource_name, opts=None, location=None, name=None, tags=None, __props__=None, __name__=None, __opts__=None)

Manages a Resource Group.

import pulumi
import pulumi_azure as azure

example = azure.core.ResourceGroup("example", location="West Europe")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • location (pulumi.Input[str]) – The Azure Region where the Resource Group should exist. Changing this forces a new Resource Group to be created.

  • name (pulumi.Input[str]) – The Name which should be used for this Resource Group. Changing this forces a new Resource Group to be created.

  • tags (pulumi.Input[dict]) – A mapping of tags which should be assigned to the Resource Group.

location: pulumi.Output[str] = None

The Azure Region where the Resource Group should exist. Changing this forces a new Resource Group to be created.

name: pulumi.Output[str] = None

The Name which should be used for this Resource Group. Changing this forces a new Resource Group to be created.

tags: pulumi.Output[dict] = None

A mapping of tags which should be assigned to the Resource Group.

static get(resource_name, id, opts=None, location=None, name=None, tags=None)

Get an existing ResourceGroup resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • location (pulumi.Input[str]) – The Azure Region where the Resource Group should exist. Changing this forces a new Resource Group to be created.

  • name (pulumi.Input[str]) – The Name which should be used for this Resource Group. Changing this forces a new Resource Group to be created.

  • tags (pulumi.Input[dict]) – A mapping of tags which should be assigned to the Resource Group.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_azure.core.TemplateDeployment(resource_name, opts=None, deployment_mode=None, name=None, parameters=None, parameters_body=None, resource_group_name=None, template_body=None, __props__=None, __name__=None, __opts__=None)

Manages a template deployment of resources

Note on ARM Template Deployments: Due to the way the underlying Azure API is designed, this provider can only manage the deployment of the ARM Template - and not any resources which are created by it. This means that when deleting the core.TemplateDeployment resource, this provider will only remove the reference to the deployment, whilst leaving any resources created by that ARM Template Deployment. One workaround for this is to use a unique Resource Group for each ARM Template Deployment, which means deleting the Resource Group would contain any resources created within it - however this isn’t ideal. More information.

import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US")
example_template_deployment = azure.core.TemplateDeployment("exampleTemplateDeployment",
    resource_group_name=example_resource_group.name,
    template_body="""{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "storageAccountType": {
      "type": "string",
      "defaultValue": "Standard_LRS",
      "allowedValues": [
        "Standard_LRS",
        "Standard_GRS",
        "Standard_ZRS"
      ],
      "metadata": {
        "description": "Storage Account type"
      }
    }
  },
  "variables": {
    "location": "[resourceGroup().location]",
    "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'storage')]",
    "publicIPAddressName": "[concat('myPublicIp', uniquestring(resourceGroup().id))]",
    "publicIPAddressType": "Dynamic",
    "apiVersion": "2015-06-15",
    "dnsLabelPrefix": "example-acctest"
  },
  "resources": [
    {
      "type": "Microsoft.Storage/storageAccounts",
      "name": "[variables('storageAccountName')]",
      "apiVersion": "[variables('apiVersion')]",
      "location": "[variables('location')]",
      "properties": {
        "accountType": "[parameters('storageAccountType')]"
      }
    },
    {
      "type": "Microsoft.Network/publicIPAddresses",
      "apiVersion": "[variables('apiVersion')]",
      "name": "[variables('publicIPAddressName')]",
      "location": "[variables('location')]",
      "properties": {
        "publicIPAllocationMethod": "[variables('publicIPAddressType')]",
        "dnsSettings": {
          "domainNameLabel": "[variables('dnsLabelPrefix')]"
        }
      }
    }
  ],
  "outputs": {
    "storageAccountName": {
      "type": "string",
      "value": "[variables('storageAccountName')]"
    }
  }
}
""",
    parameters={
        "storageAccountType": "Standard_GRS",
    },
    deployment_mode="Incremental")
pulumi.export("storageAccountName", example_template_deployment.outputs["storageAccountName"])

This provider does not know about the individual resources created by Azure using a deployment template and therefore cannot delete these resources during a destroy. Destroying a template deployment removes the associated deployment operations, but will not delete the Azure resources created by the deployment. In order to delete these resources, the containing resource group must also be destroyed. More information.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • deployment_mode (pulumi.Input[str]) – Specifies the mode that is used to deploy resources. This value could be either Incremental or Complete. Note that you will almost always want this to be set to Incremental otherwise the deployment will destroy all infrastructure not specified within the template, and this provider will not be aware of this.

  • name (pulumi.Input[str]) – Specifies the name of the template deployment. Changing this forces a new resource to be created.

  • parameters (pulumi.Input[dict]) – Specifies the name and value pairs that define the deployment parameters for the template.

  • parameters_body (pulumi.Input[str]) – Specifies a valid Azure JSON parameters file that define the deployment parameters. It can contain KeyVault references

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which to create the template deployment.

  • template_body (pulumi.Input[str]) – Specifies the JSON definition for the template.

deployment_mode: pulumi.Output[str] = None

Specifies the mode that is used to deploy resources. This value could be either Incremental or Complete. Note that you will almost always want this to be set to Incremental otherwise the deployment will destroy all infrastructure not specified within the template, and this provider will not be aware of this.

name: pulumi.Output[str] = None

Specifies the name of the template deployment. Changing this forces a new resource to be created.

outputs: pulumi.Output[dict] = None

A map of supported scalar output types returned from the deployment (currently, Azure Template Deployment outputs of type String, Int and Bool are supported, and are converted to strings - others will be ignored) and can be accessed using .outputs["name"].

parameters: pulumi.Output[dict] = None

Specifies the name and value pairs that define the deployment parameters for the template.

parameters_body: pulumi.Output[str] = None

Specifies a valid Azure JSON parameters file that define the deployment parameters. It can contain KeyVault references

resource_group_name: pulumi.Output[str] = None

The name of the resource group in which to create the template deployment.

template_body: pulumi.Output[str] = None

Specifies the JSON definition for the template.

static get(resource_name, id, opts=None, deployment_mode=None, name=None, outputs=None, parameters=None, parameters_body=None, resource_group_name=None, template_body=None)

Get an existing TemplateDeployment resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • deployment_mode (pulumi.Input[str]) – Specifies the mode that is used to deploy resources. This value could be either Incremental or Complete. Note that you will almost always want this to be set to Incremental otherwise the deployment will destroy all infrastructure not specified within the template, and this provider will not be aware of this.

  • name (pulumi.Input[str]) – Specifies the name of the template deployment. Changing this forces a new resource to be created.

  • outputs (pulumi.Input[dict]) – A map of supported scalar output types returned from the deployment (currently, Azure Template Deployment outputs of type String, Int and Bool are supported, and are converted to strings - others will be ignored) and can be accessed using .outputs["name"].

  • parameters (pulumi.Input[dict]) – Specifies the name and value pairs that define the deployment parameters for the template.

  • parameters_body (pulumi.Input[str]) – Specifies a valid Azure JSON parameters file that define the deployment parameters. It can contain KeyVault references

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which to create the template deployment.

  • template_body (pulumi.Input[str]) – Specifies the JSON definition for the template.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

pulumi_azure.core.get_client_config(opts=None)

Use this data source to access the configuration of the AzureRM provider.

import pulumi
import pulumi_azure as azure

current = azure.core.get_client_config()
pulumi.export("accountId", current.client_id)
pulumi_azure.core.get_resource_group(name=None, opts=None)

Use this data source to access information about an existing Resource Group.

import pulumi
import pulumi_azure as azure

example = azure.core.get_resource_group(name="existing")
pulumi.export("id", example.id)
Parameters

name (str) – The Name of this Resource Group.

pulumi_azure.core.get_resources(name=None, required_tags=None, resource_group_name=None, type=None, opts=None)

Use this data source to access information about existing resources.

Parameters
  • name (str) – The name of the Resource.

  • required_tags (dict) – A mapping of tags which the resource has to have in order to be included in the result.

  • resource_group_name (str) – The name of the Resource group where the Resources are located.

  • type (str) – The Resource Type of the Resources you want to list (e.g. Microsoft.Network/virtualNetworks). A full list of available Resource Types can be found here.

pulumi_azure.core.get_subscription(subscription_id=None, opts=None)

Use this data source to access information about an existing Subscription.

import pulumi
import pulumi_azure as azure

current = azure.core.get_subscription()
pulumi.export("currentSubscriptionDisplayName", current.display_name)
Parameters

subscription_id (str) – Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used.

pulumi_azure.core.get_subscriptions(display_name_contains=None, display_name_prefix=None, opts=None)

Use this data source to access information about all the Subscriptions currently available.

import pulumi
import pulumi_azure as azure

available = azure.core.get_subscriptions()
pulumi.export("availableSubscriptions", available.subscriptions)
pulumi.export("firstAvailableSubscriptionDisplayName", available.subscriptions[0]["display_name"])
Parameters
  • display_name_contains (str) – A case-insensitive value which must be contained within the display_name field, used to filter the results

  • display_name_prefix (str) – A case-insensitive prefix which can be used to filter on the display_name field

pulumi_azure.core.get_user_assigned_identity(name=None, resource_group_name=None, opts=None)

Use this data source to access information about an existing User Assigned Identity.

import pulumi
import pulumi_azure as azure

example = azure.authorization.get_user_assigned_identity(name="name_of_user_assigned_identity",
    resource_group_name="name_of_resource_group")
pulumi.export("uaiClientId", example.client_id)
pulumi.export("uaiPrincipalId", example.principal_id)
Parameters
  • name (str) – The name of the User Assigned Identity.

  • resource_group_name (str) – The name of the Resource Group in which the User Assigned Identity exists.