Module core

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.

Resources

Functions

Others

Resources

Resource CustomProvider

class CustomProvider extends CustomResource

Manages an Azure Custom Provider.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "northeurope"});
const exampleCustomProvider = new azure.core.CustomProvider("exampleCustomProvider", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    resource_type: [{
        name: "dEf1",
        endpoint: "https://testendpoint.com/",
    }],
});

constructor

new CustomProvider(name: string, args: CustomProviderArgs, opts?: pulumi.CustomResourceOptions)

Create a CustomProvider resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: CustomProviderState, opts?: pulumi.CustomResourceOptions): CustomProvider

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is CustomProvider

Returns true if the given object is an instance of CustomProvider. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property actions

public actions: pulumi.Output<CustomProviderAction[] | undefined>;

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

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property location

public location: pulumi.Output<string>;

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

property name

public name: pulumi.Output<string>;

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

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

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

property resourceTypes

public resourceTypes: pulumi.Output<CustomProviderResourceType[] | undefined>;

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

property tags

public tags: pulumi.Output<{[key: string]: string} | undefined>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property validations

public validations: pulumi.Output<CustomProviderValidation[] | undefined>;

Any number of validation block as defined below.

Resource ResourceGroup

class ResourceGroup extends CustomResource

Manages a Resource Group.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = new azure.core.ResourceGroup("example", {
    location: "West Europe",
});

constructor

new ResourceGroup(name: string, args?: ResourceGroupArgs, opts?: pulumi.CustomResourceOptions)

Create a ResourceGroup resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ResourceGroupState, opts?: pulumi.CustomResourceOptions): ResourceGroup

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is ResourceGroup

Returns true if the given object is an instance of ResourceGroup. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property location

public location: pulumi.Output<string>;

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

property name

public name: pulumi.Output<string>;

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

property tags

public tags: pulumi.Output<{[key: string]: string} | undefined>;

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

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Resource TemplateDeployment

class TemplateDeployment extends CustomResource

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 azure.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.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"});
const exampleTemplateDeployment = new azure.core.TemplateDeployment("exampleTemplateDeployment", {
    resourceGroupName: exampleResourceGroup.name,
    templateBody: `{
  "$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",
    },
    deploymentMode: "Incremental",
});
export const storageAccountName = exampleTemplateDeployment.outputs.storageAccountName;

Note

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.

constructor

new TemplateDeployment(name: string, args: TemplateDeploymentArgs, opts?: pulumi.CustomResourceOptions)

Create a TemplateDeployment resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TemplateDeploymentState, opts?: pulumi.CustomResourceOptions): TemplateDeployment

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is TemplateDeployment

Returns true if the given object is an instance of TemplateDeployment. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property deploymentMode

public deploymentMode: pulumi.Output<string>;

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.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

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

property outputs

public outputs: pulumi.Output<{[key: string]: string}>;

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"].

property parameters

public parameters: pulumi.Output<{[key: string]: string} | undefined>;

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

property parametersBody

public parametersBody: pulumi.Output<string | undefined>;

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

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

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

property templateBody

public templateBody: pulumi.Output<string>;

Specifies the JSON definition for the template.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Functions

Function getClientConfig

getClientConfig(opts?: pulumi.InvokeOptions): Promise<GetClientConfigResult>

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const current = azure.core.getClientConfig({});
export const accountId = current.then(current => current.clientId);

Function getResourceGroup

getResourceGroup(args: GetResourceGroupArgs, opts?: pulumi.InvokeOptions): Promise<GetResourceGroupResult>

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.core.getResourceGroup({
    name: "existing",
});
export const id = example.then(example => example.id);

Function getResources

getResources(args?: GetResourcesArgs, opts?: pulumi.InvokeOptions): Promise<GetResourcesResult>

Use this data source to access information about existing resources.

Function getSubscription

getSubscription(args?: GetSubscriptionArgs, opts?: pulumi.InvokeOptions): Promise<GetSubscriptionResult>

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const current = azure.core.getSubscription({});
export const currentSubscriptionDisplayName = current.then(current => current.displayName);

Function getSubscriptions

getSubscriptions(args?: GetSubscriptionsArgs, opts?: pulumi.InvokeOptions): Promise<GetSubscriptionsResult>

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const available = azure.core.getSubscriptions({});
export const availableSubscriptions = available.then(available => available.subscriptions);
export const firstAvailableSubscriptionDisplayName = available.then(available => available.subscriptions[0].displayName);

Function getUserAssignedIdentity

DEPRECATED azure.core.getUserAssignedIdentity has been deprecated in favor of azure.authorization.getUserAssignedIdentity
getUserAssignedIdentity(args: GetUserAssignedIdentityArgs, opts?: pulumi.InvokeOptions): Promise<GetUserAssignedIdentityResult>

Others

interface CustomProviderArgs

interface CustomProviderArgs

The set of arguments for constructing a CustomProvider resource.

property actions

actions?: pulumi.Input<pulumi.Input<CustomProviderAction>[]>;

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

property location

location?: pulumi.Input<string>;

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

property name

name?: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

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

property resourceTypes

resourceTypes?: pulumi.Input<pulumi.Input<CustomProviderResourceType>[]>;

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

property tags

tags?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

A mapping of tags to assign to the resource.

property validations

validations?: pulumi.Input<pulumi.Input<CustomProviderValidation>[]>;

Any number of validation block as defined below.

interface CustomProviderState

interface CustomProviderState

Input properties used for looking up and filtering CustomProvider resources.

property actions

actions?: pulumi.Input<pulumi.Input<CustomProviderAction>[]>;

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

property location

location?: pulumi.Input<string>;

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

property name

name?: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

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

property resourceTypes

resourceTypes?: pulumi.Input<pulumi.Input<CustomProviderResourceType>[]>;

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

property tags

tags?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

A mapping of tags to assign to the resource.

property validations

validations?: pulumi.Input<pulumi.Input<CustomProviderValidation>[]>;

Any number of validation block as defined below.

interface GetClientConfigResult

interface GetClientConfigResult

A collection of values returned by getClientConfig.

property clientId

clientId: string;

property id

id: string;

The provider-assigned unique ID for this managed resource.

property objectId

objectId: string;

property subscriptionId

subscriptionId: string;

property tenantId

tenantId: string;

interface GetResourceGroupArgs

interface GetResourceGroupArgs

A collection of arguments for invoking getResourceGroup.

property name

name: string;

The Name of this Resource Group.

interface GetResourceGroupResult

interface GetResourceGroupResult

A collection of values returned by getResourceGroup.

property id

id: string;

The provider-assigned unique ID for this managed resource.

property location

location: string;

The Azure Region where the Resource Group exists.

property name

name: string;

property tags

tags: {[key: string]: string};

A mapping of tags assigned to the Resource Group.

interface GetResourcesArgs

interface GetResourcesArgs

A collection of arguments for invoking getResources.

property name

name?: undefined | string;

The name of the Resource.

property requiredTags

requiredTags?: undefined | {[key: string]: string};

A mapping of tags which the resource has to have in order to be included in the result.

property resourceGroupName

resourceGroupName?: undefined | string;

The name of the Resource group where the Resources are located.

property type

type?: undefined | string;

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.

interface GetResourcesResult

interface GetResourcesResult

A collection of values returned by getResources.

property id

id: string;

The provider-assigned unique ID for this managed resource.

property name

name: string;

The name of this Resource.

property requiredTags

requiredTags?: undefined | {[key: string]: string};

property resourceGroupName

resourceGroupName: string;

property resources

resources: GetResourcesResource[];

One or more resource blocks as defined below.

property type

type: string;

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

function getServiceClientCredentials

getServiceClientCredentials(): Promise<ServiceClientCredentials>

Obtain credentials to query Azure Management API. Depending on the environment configuration, this are either based on MSI, a service principal, or Azure CLI user credentials.

interface GetSubscriptionArgs

interface GetSubscriptionArgs

A collection of arguments for invoking getSubscription.

property subscriptionId

subscriptionId?: undefined | string;

Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used.

interface GetSubscriptionResult

interface GetSubscriptionResult

A collection of values returned by getSubscription.

property displayName

displayName: string;

The subscription display name.

property id

id: string;

The provider-assigned unique ID for this managed resource.

property locationPlacementId

locationPlacementId: string;

The subscription location placement ID.

property quotaId

quotaId: string;

The subscription quota ID.

property spendingLimit

spendingLimit: string;

The subscription spending limit.

property state

state: string;

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

property subscriptionId

subscriptionId: string;

The subscription GUID.

property tenantId

tenantId: string;

The subscription tenant ID.

interface GetSubscriptionsArgs

interface GetSubscriptionsArgs

A collection of arguments for invoking getSubscriptions.

property displayNameContains

displayNameContains?: undefined | string;

A case-insensitive value which must be contained within the displayName field, used to filter the results

property displayNamePrefix

displayNamePrefix?: undefined | string;

A case-insensitive prefix which can be used to filter on the displayName field

interface GetSubscriptionsResult

interface GetSubscriptionsResult

A collection of values returned by getSubscriptions.

property displayNameContains

displayNameContains?: undefined | string;

property displayNamePrefix

displayNamePrefix?: undefined | string;

property id

id: string;

The provider-assigned unique ID for this managed resource.

property subscriptions

subscriptions: GetSubscriptionsSubscription[];

One or more subscription blocks as defined below.

interface GetUserAssignedIdentityArgs

interface GetUserAssignedIdentityArgs

A collection of arguments for invoking getUserAssignedIdentity.

property name

name: string;

The name of the User Assigned Identity.

property resourceGroupName

resourceGroupName: string;

The name of the Resource Group in which the User Assigned Identity exists.

interface GetUserAssignedIdentityResult

interface GetUserAssignedIdentityResult

A collection of values returned by getUserAssignedIdentity.

property clientId

clientId: string;

The Client ID of the User Assigned Identity.

property id

id: string;

The provider-assigned unique ID for this managed resource.

property location

location: string;

The Azure location where the User Assigned Identity exists.

property name

name: string;

property principalId

principalId: string;

The Service Principal ID of the User Assigned Identity.

property resourceGroupName

resourceGroupName: string;

property tags

tags: {[key: string]: string};

A mapping of tags assigned to the User Assigned Identity.

interface ResourceGroupArgs

interface ResourceGroupArgs

The set of arguments for constructing a ResourceGroup resource.

property location

location?: pulumi.Input<string>;

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

property name

name?: pulumi.Input<string>;

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

property tags

tags?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

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

interface ResourceGroupState

interface ResourceGroupState

Input properties used for looking up and filtering ResourceGroup resources.

property location

location?: pulumi.Input<string>;

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

property name

name?: pulumi.Input<string>;

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

property tags

tags?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

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

interface TemplateDeploymentArgs

interface TemplateDeploymentArgs

The set of arguments for constructing a TemplateDeployment resource.

property deploymentMode

deploymentMode: pulumi.Input<string>;

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.

property name

name?: pulumi.Input<string>;

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

property parameters

parameters?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

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

property parametersBody

parametersBody?: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

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

property templateBody

templateBody?: pulumi.Input<string>;

Specifies the JSON definition for the template.

interface TemplateDeploymentState

interface TemplateDeploymentState

Input properties used for looking up and filtering TemplateDeployment resources.

property deploymentMode

deploymentMode?: pulumi.Input<string>;

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.

property name

name?: pulumi.Input<string>;

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

property outputs

outputs?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

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"].

property parameters

parameters?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

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

property parametersBody

parametersBody?: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

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

property templateBody

templateBody?: pulumi.Input<string>;

Specifies the JSON definition for the template.