Git Product home page Git Product logo

pulumi-azure's Introduction

Actions Status Slack NPM version Python version NuGet version PkgGoDev License

Microsoft Azure Resource Provider

NOTE: We recommend using the Azure Native provider to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates because it’s built and automatically from the Azure Resource Manager API.

Azure Classic is based on the Terraform azurerm provider. It has fewer resources and resource options and receives new Azure features more slowly than Azure Native. However, Azure Classic remains fully-supported for existing usage.

The Azure Classic resource provider for Pulumi lets you use Azure resources in your cloud programs. To use this package, please install the Pulumi CLI first. For a streamlined Pulumi walkthrough, including language runtime installation and Azure configuration, select "Get Started" below.

Installing

This package is available in many languages in the standard packaging formats.

Node.js (Java/TypeScript)

To use from JavaScript or TypeScript in Node.js, install using either npm:

$ npm install @pulumi/azure

or yarn:

$ yarn add @pulumi/azure

Python

To use from Python, install using pip:

$ pip install pulumi_azure

Go

To use from Go, use go get to grab the latest version of the library

$ go get github.com/pulumi/pulumi-azure/sdk/v5

.NET

To use from .NET, install using dotnet add package:

$ dotnet add package Pulumi.Azure

Concepts

The @pulumi/azure package provides a strongly-typed means to build cloud applications that create and interact closely with Azure resources. Resources are exposed for the entire Azure surface area, including (but not limited to), 'appinsights', 'compute', 'cosmosdb', 'keyvault', and more.

Configuring credentials

There are a variety of ways credentials may be configured for the Azure provider, appropriate for different use cases. Refer to the Azure configuration options.

Reference

For further information, visit Azure in the Pulumi Registry or for detailed API reference documentation, visit Azure API Docs in the Pulumi Registry.

pulumi-azure's People

Contributors

aaronfriel avatar aq17 avatar christianeder avatar christianeder-z avatar cyrusnajmabadi avatar danielrbradley avatar dependabot[bot] avatar ellismg avatar evanboyle avatar guineveresaenger avatar infin8x avatar iwahbe avatar jaxxstorm avatar jen20 avatar jkodroff avatar joeduffy avatar justinvp avatar komalali avatar kpitzen avatar lukehoban avatar mikhailshilkov avatar pgavlin avatar pulumi-bot avatar rquitales avatar squaremo avatar stack72 avatar subhabh avatar t0yv0 avatar thomas11 avatar venelinmartinov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pulumi-azure's Issues

Refreshing a Resource Group with deleted resources fails

If you manually delete a resource from your Azure Resource Group in the console, we should be able to recover simply by running pulumi refresh. Unfortunately, doing so fails:

    error: refreshing urn:pulumi:joe-ts-func::azure-functions::azure:HttpFunction$azure:appservice/functionApp:FunctionApp::fn-app's state: rpc error: code = Unknown desc = refreshing urn:pulumi:joe-ts-func::azure-functions::azure:HttpFunction$azure:appservice/functionApp:FunctionApp::fn-app: Error making Read request on AzureRM Function App AppSettings "fn-app67f7247a": web.AppsClient#ListApplicationSettings: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.Web/sites/fn-app67f7247a' under resource group 'fn-rgfeb8e772' was not found."

Notice the relevant bit, wherein some Azure SDK failure occurs due to the deleted resource having gone missing: The Resource 'Microsoft.Web/sites/fn-app67f7247a' under resource group 'fn-rgfeb8e772' was not found."

I believe this must be due to some bug in the underlying resource provider.

Azure role assignment name needs to be GUID

When trying to assign a role to a service principal, the name needs to be a GUID.

The following code -

 let roleAssignment = new azure.role.assignment("ra", {
      principalId: servicePrincipal.id,
      roleDefinitionName: "Contributor",
      scope: `/subscriptions/${azure.config.subscriptionId}`
})

Will return a 400 error from azure saying that the name must be a valid GUID.

I tested with the uuid package and it worked, however this will trigger a change every time pulumi up is ran.

import * as uuid from "uuid"
let role = new azure.role.assignment("ra", {
     name: uuid.v4(),
     principalId: _sp.id,
     roleDefinitionName: "Contributor",
     scope: `/subscriptions/${azure.config.subscriptionId}`
})

master failing due to test errors

[ ulumi-azure/examples/webserver ] $ tsc
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 14     addressSpace: ["10.0.0.0/16"],
[ ulumi-azure/examples/webserver ]        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(14,5): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; addressSpace: string[]; subnet: { ...' is not assignable to parameter of type 'VirtualNetworkArgs'.
[ ulumi-azure/examples/webserver ]   Object literal may only specify known properties, and 'addressSpace' does not exist in type 'VirtualNetworkArgs'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ]  33     ipConfiguration: [{
[ ulumi-azure/examples/webserver ]         ~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ]  34         name: "webserveripcfg",
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] ... 
[ ulumi-azure/examples/webserver ]  36         privateIpAddressAllocation: "dynamic",
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ]  37     }],
[ ulumi-azure/examples/webserver ]     ~~~~~~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(33,5): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; ipConfiguration: { name: string; s...' is not assignable to parameter of type 'NetworkInterfaceArgs'.
[ ulumi-azure/examples/webserver ]   Object literal may only specify known properties, and 'ipConfiguration' does not exist in type 'NetworkInterfaceArgs'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ]  40 let vm = new azure.compute.VirtualMachine("webservervm", {
[ ulumi-azure/examples/webserver ]                                                              ~
[ ulumi-azure/examples/webserver ]  41     resourceGroupName: resourceGroup.name,
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] ... 
[ ulumi-azure/examples/webserver ]  64     }],
[ ulumi-azure/examples/webserver ]     ~~~~~~~
[ ulumi-azure/examples/webserver ]  65 });
[ ulumi-azure/examples/webserver ]     ~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(40,58): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; networkInterfaceIds: any[]; vmSize...' is not assignable to parameter of type 'VirtualMachineArgs'.
[ ulumi-azure/examples/webserver ]   Types of property 'osProfile' are incompatible.
[ ulumi-azure/examples/webserver ]     Type '{ computerName: string; adminUsername: string; adminPassword: string; }[]' is not assignable to type '{ adminPassword?: string | Promise<string> | Output<string> | undefined; adminUsername: Input<str...'.
[ ulumi-azure/examples/webserver ]       Type '{ computerName: string; adminUsername: string; adminPassword: string; }[]' is not assignable to type 'Output<{ adminPassword?: string | Promise<string> | Output<string> | undefined; adminUsername: In...'.
[ ulumi-azure/examples/webserver ]         Property 'apply' is missing in type '{ computerName: string; adminUsername: string; adminPassword: string; }[]'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] error Command failed with exit code 2.
[ ulumi-azure/examples/webserver ] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] Wrote output to /tmp/p-it-travis-job-webserver-398577416/command-output/yarn-build.20180310-211643.177cb.log
[ ulumi-azure/examples/webserver ] **** Invoke '/home/travis/.yarn/bin/yarn run build' in '/tmp/p-it-travis-job-webserver-398577416'
[ /pulumi-azure/examples/minimal ] Wrote output to /tmp/p-it-travis-job-minimal-409970445/command-output/pulumi-update-empty.20180310-211644.abe91.log
[ /pulumi-azure/examples/minimal ] Destroying stack
[ /pulumi-azure/examples/minimal ] **** Invoke '/opt/pulumi/bin/pulumi destroy --yes' in '/tmp/p-it-travis-job-minimal-409970445'
[ /pulumi-azure/examples/minimal ] Wrote output to /tmp/p-it-travis-job-minimal-409970445/command-output/pulumi-destroy.20180310-211644.d0097.log
[ /pulumi-azure/examples/minimal ] **** Invoke '/opt/pulumi/bin/pulumi stack rm --yes p-it-travis-job-minimal' in '/tmp/p-it-travis-job-minimal-409970445'
[ /pulumi-azure/examples/minimal ] Wrote output to /tmp/p-it-travis-job-minimal-409970445/command-output/pulumi-stack-rm.20180310-211644.48729.log
[ ulumi-azure/examples/webserver ] Invoke '/home/travis/.yarn/bin/yarn run build' failed: exit status 1
[ ulumi-azure/examples/webserver ] yarn run v1.2.1
[ ulumi-azure/examples/webserver ] $ tsc
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 14     addressSpace: ["10.0.0.0/16"],
[ ulumi-azure/examples/webserver ]        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(14,5): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; addressSpace: string[]; subnet: { ...' is not assignable to parameter of type 'VirtualNetworkArgs'.
[ ulumi-azure/examples/webserver ]   Object literal may only specify known properties, and 'addressSpace' does not exist in type 'VirtualNetworkArgs'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ]  33     ipConfiguration: [{
[ ulumi-azure/examples/webserver ]         ~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ]  34         name: "webserveripcfg",
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] ... 
[ ulumi-azure/examples/webserver ]  36         privateIpAddressAllocation: "dynamic",
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ]  37     }],
[ ulumi-azure/examples/webserver ]     ~~~~~~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(33,5): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; ipConfiguration: { name: string; s...' is not assignable to parameter of type 'NetworkInterfaceArgs'.
[ ulumi-azure/examples/webserver ]   Object literal may only specify known properties, and 'ipConfiguration' does not exist in type 'NetworkInterfaceArgs'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ]  40 let vm = new azure.compute.VirtualMachine("webservervm", {
[ ulumi-azure/examples/webserver ]                                                              ~
[ ulumi-azure/examples/webserver ]  41     resourceGroupName: resourceGroup.name,
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] ... 
[ ulumi-azure/examples/webserver ]  64     }],
[ ulumi-azure/examples/webserver ]     ~~~~~~~
[ ulumi-azure/examples/webserver ]  65 });
[ ulumi-azure/examples/webserver ]     ~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(40,58): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; networkInterfaceIds: any[]; vmSize...' is not assignable to parameter of type 'VirtualMachineArgs'.
[ ulumi-azure/examples/webserver ]   Types of property 'osProfile' are incompatible.
[ ulumi-azure/examples/webserver ]     Type '{ computerName: string; adminUsername: string; adminPassword: string; }[]' is not assignable to type '{ adminPassword?: string | Promise<string> | Output<string> | undefined; adminUsername: Input<str...'.
[ ulumi-azure/examples/webserver ]       Type '{ computerName: string; adminUsername: string; adminPassword: string; }[]' is not assignable to type 'Output<{ adminPassword?: string | Promise<string> | Output<string> | undefined; adminUsername: In...'.
[ ulumi-azure/examples/webserver ]         Property 'apply' is missing in type '{ computerName: string; adminUsername: string; adminPassword: string; }[]'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] error Command failed with exit code 2.
[ ulumi-azure/examples/webserver ] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] Wrote output to /tmp/p-it-travis-job-webserver-398577416/command-output/yarn-build.20180310-211647.09044.log
[ ulumi-azure/examples/webserver ] **** Invoke '/home/travis/.yarn/bin/yarn run build' in '/tmp/p-it-travis-job-webserver-398577416'
[ ulumi-azure/examples/webserver ] Invoke '/home/travis/.yarn/bin/yarn run build' failed: exit status 1
[ ulumi-azure/examples/webserver ] yarn run v1.2.1
[ ulumi-azure/examples/webserver ] $ tsc
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 14     addressSpace: ["10.0.0.0/16"],
[ ulumi-azure/examples/webserver ]        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(14,5): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; addressSpace: string[]; subnet: { ...' is not assignable to parameter of type 'VirtualNetworkArgs'.
[ ulumi-azure/examples/webserver ]   Object literal may only specify known properties, and 'addressSpace' does not exist in type 'VirtualNetworkArgs'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ]  33     ipConfiguration: [{
[ ulumi-azure/examples/webserver ]         ~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ]  34         name: "webserveripcfg",
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] ... 
[ ulumi-azure/examples/webserver ]  36         privateIpAddressAllocation: "dynamic",
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ]  37     }],
[ ulumi-azure/examples/webserver ]     ~~~~~~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(33,5): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; ipConfiguration: { name: string; s...' is not assignable to parameter of type 'NetworkInterfaceArgs'.
[ ulumi-azure/examples/webserver ]   Object literal may only specify known properties, and 'ipConfiguration' does not exist in type 'NetworkInterfaceArgs'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ]  40 let vm = new azure.compute.VirtualMachine("webservervm", {
[ ulumi-azure/examples/webserver ]                                                              ~
[ ulumi-azure/examples/webserver ]  41     resourceGroupName: resourceGroup.name,
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] ... 
[ ulumi-azure/examples/webserver ]  64     }],
[ ulumi-azure/examples/webserver ]     ~~~~~~~
[ ulumi-azure/examples/webserver ]  65 });
[ ulumi-azure/examples/webserver ]     ~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(40,58): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; networkInterfaceIds: any[]; vmSize...' is not assignable to parameter of type 'VirtualMachineArgs'.
[ ulumi-azure/examples/webserver ]   Types of property 'osProfile' are incompatible.
[ ulumi-azure/examples/webserver ]     Type '{ computerName: string; adminUsername: string; adminPassword: string; }[]' is not assignable to type '{ adminPassword?: string | Promise<string> | Output<string> | undefined; adminUsername: Input<str...'.
[ ulumi-azure/examples/webserver ]       Type '{ computerName: string; adminUsername: string; adminPassword: string; }[]' is not assignable to type 'Output<{ adminPassword?: string | Promise<string> | Output<string> | undefined; adminUsername: In...'.
[ ulumi-azure/examples/webserver ]         Property 'apply' is missing in type '{ computerName: string; adminUsername: string; adminPassword: string; }[]'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] error Command failed with exit code 2.
[ ulumi-azure/examples/webserver ] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] Wrote output to /tmp/p-it-travis-job-webserver-398577416/command-output/yarn-build.20180310-211651.84636.log
[ ulumi-azure/examples/webserver ] **** Invoke '/home/travis/.yarn/bin/yarn run build' in '/tmp/p-it-travis-job-webserver-398577416'
[ ulumi-azure/examples/webserver ] Invoke '/home/travis/.yarn/bin/yarn run build' failed: exit status 1
[ ulumi-azure/examples/webserver ] yarn run v1.2.1
[ ulumi-azure/examples/webserver ] $ tsc
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 14     addressSpace: ["10.0.0.0/16"],
[ ulumi-azure/examples/webserver ]        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(14,5): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; addressSpace: string[]; subnet: { ...' is not assignable to parameter of type 'VirtualNetworkArgs'.
[ ulumi-azure/examples/webserver ]   Object literal may only specify known properties, and 'addressSpace' does not exist in type 'VirtualNetworkArgs'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ]  33     ipConfiguration: [{
[ ulumi-azure/examples/webserver ]         ~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ]  34         name: "webserveripcfg",
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] ... 
[ ulumi-azure/examples/webserver ]  36         privateIpAddressAllocation: "dynamic",
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ]  37     }],
[ ulumi-azure/examples/webserver ]     ~~~~~~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(33,5): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; ipConfiguration: { name: string; s...' is not assignable to parameter of type 'NetworkInterfaceArgs'.
[ ulumi-azure/examples/webserver ]   Object literal may only specify known properties, and 'ipConfiguration' does not exist in type 'NetworkInterfaceArgs'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ]  40 let vm = new azure.compute.VirtualMachine("webservervm", {
[ ulumi-azure/examples/webserver ]                                                              ~
[ ulumi-azure/examples/webserver ]  41     resourceGroupName: resourceGroup.name,
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] ... 
[ ulumi-azure/examples/webserver ]  64     }],
[ ulumi-azure/examples/webserver ]     ~~~~~~~
[ ulumi-azure/examples/webserver ]  65 });
[ ulumi-azure/examples/webserver ]     ~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(40,58): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; networkInterfaceIds: any[]; vmSize...' is not assignable to parameter of type 'VirtualMachineArgs'.
[ ulumi-azure/examples/webserver ]   Types of property 'osProfile' are incompatible.
[ ulumi-azure/examples/webserver ]     Type '{ computerName: string; adminUsername: string; adminPassword: string; }[]' is not assignable to type '{ adminPassword?: string | Promise<string> | Output<string> | undefined; adminUsername: Input<str...'.
[ ulumi-azure/examples/webserver ]       Type '{ computerName: string; adminUsername: string; adminPassword: string; }[]' is not assignable to type 'Output<{ adminPassword?: string | Promise<string> | Output<string> | undefined; adminUsername: In...'.
[ ulumi-azure/examples/webserver ]         Property 'apply' is missing in type '{ computerName: string; adminUsername: string; adminPassword: string; }[]'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] error Command failed with exit code 2.
[ ulumi-azure/examples/webserver ] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] Wrote output to /tmp/p-it-travis-job-webserver-398577416/command-output/yarn-build.20180310-211655.656df.log
[ ulumi-azure/examples/webserver ] **** Invoke '/home/travis/.yarn/bin/yarn run build' in '/tmp/p-it-travis-job-webserver-398577416'
[ ulumi-azure/examples/webserver ] Invoke '/home/travis/.yarn/bin/yarn run build' failed: exit status 1
[ ulumi-azure/examples/webserver ] yarn run v1.2.1
[ ulumi-azure/examples/webserver ] $ tsc
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 14     addressSpace: ["10.0.0.0/16"],
[ ulumi-azure/examples/webserver ]        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(14,5): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; addressSpace: string[]; subnet: { ...' is not assignable to parameter of type 'VirtualNetworkArgs'.
[ ulumi-azure/examples/webserver ]   Object literal may only specify known properties, and 'addressSpace' does not exist in type 'VirtualNetworkArgs'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ]  33     ipConfiguration: [{
[ ulumi-azure/examples/webserver ]         ~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ]  34         name: "webserveripcfg",
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] ... 
[ ulumi-azure/examples/webserver ]  36         privateIpAddressAllocation: "dynamic",
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ]  37     }],
[ ulumi-azure/examples/webserver ]     ~~~~~~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(33,5): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; ipConfiguration: { name: string; s...' is not assignable to parameter of type 'NetworkInterfaceArgs'.
[ ulumi-azure/examples/webserver ]   Object literal may only specify known properties, and 'ipConfiguration' does not exist in type 'NetworkInterfaceArgs'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ]  40 let vm = new azure.compute.VirtualMachine("webservervm", {
[ ulumi-azure/examples/webserver ]                                                              ~
[ ulumi-azure/examples/webserver ]  41     resourceGroupName: resourceGroup.name,
[ ulumi-azure/examples/webserver ]     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ulumi-azure/examples/webserver ] ... 
[ ulumi-azure/examples/webserver ]  64     }],
[ ulumi-azure/examples/webserver ]     ~~~~~~~
[ ulumi-azure/examples/webserver ]  65 });
[ ulumi-azure/examples/webserver ]     ~
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] index.ts(40,58): error TS2345: Argument of type '{ resourceGroupName: Output<string>; location: Output<string>; networkInterfaceIds: any[]; vmSize...' is not assignable to parameter of type 'VirtualMachineArgs'.
[ ulumi-azure/examples/webserver ]   Types of property 'osProfile' are incompatible.
[ ulumi-azure/examples/webserver ]     Type '{ computerName: string; adminUsername: string; adminPassword: string; }[]' is not assignable to type '{ adminPassword?: string | Promise<string> | Output<string> | undefined; adminUsername: Input<str...'.
[ ulumi-azure/examples/webserver ]       Type '{ computerName: string; adminUsername: string; adminPassword: string; }[]' is not assignable to type 'Output<{ adminPassword?: string | Promise<string> | Output<string> | undefined; adminUsername: In...'.
[ ulumi-azure/examples/webserver ]         Property 'apply' is missing in type '{ computerName: string; adminUsername: string; adminPassword: string; }[]'.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] error Command failed with exit code 2.
[ ulumi-azure/examples/webserver ] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[ ulumi-azure/examples/webserver ] 
[ ulumi-azure/examples/webserver ] Wrote output to /tmp/p-it-travis-job-webserver-398577416/command-output/yarn-build.20180310-211659.2f532.log
--- FAIL: TestExamples (0.00s)
    --- PASS: TestExamples//home/travis/gopath/src/github.com/pulumi/pulumi-azure/examples/minimal (12.53s)
    --- FAIL: TestExamples//home/travis/gopath/src/github.com/pulumi/pulumi-azure/examples/webserver (27.36s)
	Error Trace:	program.go:290
			examples_test.go:48
	Error:		Received unexpected error [/home/travis/.yarn/bin/yarn run build] did not complete after 4 tries
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration.(*programTester).runYarnCommand.func1
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration/program.go:372
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/util/retry.Until
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/util/retry/until.go:72
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration.(*programTester).runYarnCommand
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration/program.go:364
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration.(*programTester).prepareProject
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration/program.go:830
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration.(*programTester).copyTestToTemporaryDirectory
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration/program.go:780
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration.(*programTester).testLifeCycleInitAndDestroy
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration/program.go:386
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration.ProgramTest
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration/program.go:289
    			github.com/pulumi/pulumi-azure/examples.TestExamples.func1
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/examples/examples_test.go:48
    			testing.tRunner
    				/home/travis/.gimme/versions/go1.9.linux.amd64/src/testing/testing.go:746
    			runtime.goexit
    				/home/travis/.gimme/versions/go1.9.linux.amd64/src/runtime/asm_amd64.s:2337
    			Failed to prepare /tmp/p-it-travis-job-webserver-398577416
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration.(*programTester).copyTestToTemporaryDirectory
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration/program.go:782
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration.(*programTester).testLifeCycleInitAndDestroy
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration/program.go:386
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration.ProgramTest
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration/program.go:289
    			github.com/pulumi/pulumi-azure/examples.TestExamples.func1
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/examples/examples_test.go:48
    			testing.tRunner
    				/home/travis/.gimme/versions/go1.9.linux.amd64/src/testing/testing.go:746
    			runtime.goexit
    				/home/travis/.gimme/versions/go1.9.linux.amd64/src/runtime/asm_amd64.s:2337
    			copying test to temp dir
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration.(*programTester).testLifeCycleInitAndDestroy
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration/program.go:388
    			github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration.ProgramTest
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/testing/integration/program.go:289
    			github.com/pulumi/pulumi-azure/examples.TestExamples.func1
    				/home/travis/gopath/src/github.com/pulumi/pulumi-azure/examples/examples_test.go:48
    			testing.tRunner
    				/home/travis/.gimme/versions/go1.9.linux.amd64/src/testing/testing.go:746
    			runtime.goexit
    				/home/travis/.gimme/versions/go1.9.linux.amd64/src/runtime/asm_amd64.s:2337
    		
FAIL
coverage: 0.0% of statements
exit status 1
FAIL	github.com/pulumi/pulumi-azure/examples	27.371s
make: *** [test_all] Error 1

name length rule for AppService is more strict than in azure

AppService has the same naming restriction as FunctionApp in Azure (1-60 characters, case insensitive, alphanumeric and hyphen) but pulumi will reject it if larger than 24.

Could not make instance of 'azure:appservice/appService:AppService'.: name 'collab-dir-projector-' plus 8 random chars is longer than maximum length 24

For some reason AppService isn't in the naming rules list, but I could confirm they are the same manually by spamming numbers at the end of the name I tried to use until it complained:
image

FunctionApp too strict about version

I'm trying to set Function App version to ~2:

const v2js = new azure.appservice.FunctionApp(`${name}-v1js`, {
    ...resourceGroupArgs,

    appServicePlanId: appServicePlan.id,
    storageConnectionString: storageAccount.primaryConnectionString,

    appSettings: {
        "WEBSITE_RUN_FROM_ZIP": codeBlobUrl
    },

    version: "~2"
});

but I get an error back:

error: azure:appservice/functionApp:FunctionApp resource '...' has a problem: 
expected version to be one of [~1 beta], got ~2

~2 is a valid version, see docs.

Moreover, I should be able to pin my app to a specific version like 2.0.11961-alpha.

Get Pulumi-azure to work

  • Rename package from azurerm to azure to be consistent
  • Finalize the namespaces. Currently it is not standardized. We can either follow the pattern outlined in Go sdk for Azure or follow Terraform's organization of resources. We need to make a decision and implement.
  • Integrate with Travis to run Azure as part of daily build
  • Make changes to SDK package to include Azure and make it install as part of the installation.
  • Verify installation on all platforms

Write an opinionated guide to how to authenticate for different scenarios

Azure provides many different ways to authenticate, which are appropriate in different circumstances. We should have a document which explains which types of credentials are appropriate in which situation (e.g. Pulumi on a dev machine, in CI, on an Azure VM etc) with specific instructions on how to find the relevant pieces of information.

Missing file fails install (python)

https://github.com/pulumi/pulumi-azure/blob/master/sdk/python/setup.py#L14

    Traceback (most recent call last):                                                                                                                                                                       
      File "<string>", line 1, in <module>                                                                                                                                                                   
      File "/Users/user/Development/pulumi/pulumi-azure/sdk/python/setup.py", line 20, in <module>                                                                                                       
        long_description=readme(),                                                                                                                                                                           
      File "/Users/user/Development/pulumi/pulumi-azure/sdk/python/setup.py", line 14, in readme                                                                                                         
        with open('README.rst') as f:                                                                                                                                                                        
    IOError: [Errno 2] No such file or directory: 'README.rst'   

Also, looks like you need to push a new pypi version, I'm still seeing role.assignment.assignment instead of role.assignment.Assignment

I'd be willing to push a PR for this fix, but it seems maybe it should be fixed in the tfgen repo instead? Seems the setup is generated also by tfgen, should dump a README.rst in the folder if so.

Create an "Azure reference architecture" example

We agreed recently, when talking to a recent customer, to create an "Azure reference architecture" example. This would simply provision the basic networking components and Kubernetes cluster -- ACS Engine-like -- and then deploy some services on top.

Eventually, we know we want a more first class ACS Engine component, but to get started we can probably just import it as an ARM template. We also want to demonstrate deploying Helm charts, but until we have pulumi/pulumi-kubernetes#54, we can simply deploy Kubernetes resources manually atop our provisioned cluster.

We agreed to get back to the customer in about two weeks' time, so this should go early in M16.

Created resource-group gets extra random string

Since the resource groups are an important building block, as the docs state it should be unique: https://github.com/pulumi/pulumi-azure/blob/master/sdk/python/pulumi_azure/core/resource_group.py#L39

I'm attempting to create some resource groups in one project with known names that will be foundations for items to attach to in other projects. I was not expecting the names of the actual resource to be different than the names I assigned. I do not believe this should be the case in practice.

Code:

    for region in yaml_data['regions']:
        resource_group = core.ResourceGroup(
            "{}-{}-{}".format(
                resource_type,
                env_id,
                region['id']
            ), location=region['name']
        )

Output from Pulumi:

     +   ├─ azure:core:ResourceGroup  kv-1-eus                            created     
     +   ├─ azure:core:ResourceGroup  kv-1-eas                            created     
     +   ├─ azure:core:ResourceGroup  kv-1-weu                            created     
     +   ├─ azure:core:ResourceGroup  kv-1-scus                           created     
     +   ├─ azure:core:ResourceGroup  kv-1-uks                            created     
     +   ├─ azure:core:ResourceGroup  kv-1-cae                            created     
     +   └─ azure:core:ResourceGroup  kv-1-eus2                           created 

Actual names in Azure:

 NAME
 SUBSCRIPTION
 LOCATION	
 kv-1-cae7b69e1e8	Pay-as-you-go	Canada East	
 kv-1-eas75babc06	Pay-as-you-go	East Asia	
 kv-1-eus2cd3e4c75	Pay-as-you-go	East US 2	
 kv-1-euse1adf400	Pay-as-you-go	East US	

Adding a `customData` to `VirtualMachine` doesn't do anything

I have a VirtualMachine deployed - based on
https://github.com/pulumi/examples/tree/master/azure-js-webserver.

let vm = new azure.compute.VirtualMachine("server-vm", {
    resourceGroupName: resourceGroup.name,
    location: resourceGroup.location,
    networkInterfaceIds: [networkInterface.id],
    vmSize: "Standard_A0",
    deleteDataDisksOnTermination: true,
    deleteOsDiskOnTermination: true,
    osProfile: {
        computerName: "hostname",
        adminUsername: "pulumi",
        adminPassword: "aA1$aA1$aA1$aA1$",
        // customData: "something",
    },
    osProfileLinuxConfig: {
        disablePasswordAuthentication: false,
    },
    storageOsDisk: {
        createOption: "FromImage",
        name: "myosdisk1",
    },
    storageImageReference: {
        publisher: "canonical",
        offer: "UbuntuServer",
        sku: "16.04-LTS",
        version: "latest",
    },
});

If I uncomment the customData: "something", piece, and re-run update, pulumi shows me no diff at all!

$ pulumi up
Previewing update (azurewebserver-dev):

     Type                 Name                               Plan
     pulumi:pulumi:Stack  azurewebserver-azurewebserver-dev

Resources:
    7 unchanged

Do you want to perform this update? details
  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:azurewebserver-dev::azurewebserver::pulumi:pulumi:Stack::azurewebserver-azurewebserver-dev]

Do you want to perform this update? no

In contrast, destroying and recreating with this value of customData works as expected.

Race condition with msi.UserAssignedIdentity and role.Assignment

If I create a new UserAssignedIdentity then immediately try to assign it a role it complains that the principalId doesn't exist in the directory.

I assume this is a bug / peculiarity with Azure itself because the dependency chain looks fine... is there a way of working around this?

Thanks,

export function createManagedIdentity(
    name: string,
    resourceGroup: azure.core.ResourceGroup,
    location: string | Output<string>
) {
    const azIdentity = new azure.msi.UserAssignedIdentity(
        `msi-${name}`,
        {
            name: `msi-${name}`,
            location: location,
            resourceGroupName: resourceGroup.name
        }
    );
    return {
        identity: azIdentity
    }
}
    const name = "app";
    const msi = createManagedIdentity(name, resourceGroup, config.location);

    new azure.role.Assignment(`${name}-kv-role`, {
        principalId: msi.identity.principalId,
        scope: keyVault.id,
        roleDefinitionName: "Reader"
    });
2018-11-08T15:36:56.3485999Z  +  azure:msi:UserAssignedIdentity msi-app creating 
2018-11-08T15:36:57.8096273Z  +  azure:msi:UserAssignedIdentity msi-app created 
2018-11-08T15:36:58.0442362Z  +  azure:role:Assignment app-kv-role creating 
2018-11-08T15:37:00.1007517Z  +  azure:role:Assignment app-kv-role creating error: Plan apply failed: authorization.RoleAssignmentsClient#Create: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="PrincipalNotFound" Message="Principal 12bd9f9c9c1541b8a727c892ed19e1f2 does not exist in the directory ***."
2018-11-08T15:37:00.1014845Z  +  azure:role:Assignment app-kv-role **creating failed** error: Plan apply failed: authorization.RoleAssignmentsClient#Create: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="PrincipalNotFound" Message="Principal 12bd9f9c9c1541b8a727c892ed19e1f2 does not exist in the directory ***."

Pulumi preview fails on Windows with Minimist module not found

  1. Build Windows version of the sdk on a Windows box (Home\Scripts\Build-sdk.cmd)
  2. Download and extract the resulting package
  3. Run install.cmd and follow steps to install the sdk on a Windows box.
  4. Build pulumi-azure/examples/webserver sample
  5. Run 'Pulumi Preview'
    Error: Can not find module 'minimist'
    Problem persist even if we install minimist.
    Seems npm install is not installing the dependency modules.

Problems updating `AppService.appSettings`

  1. It seems updating/adding a value on an AppService's appSettings does not work. I get the following error:
PS D:\Code\pulumi-test> pulumi update
Previewing update of stack 'pulumi-test'
Previewing changes:

     Type                         Name     Plan       Info
 ~   azure:appservice:AppService  testApp  update     changes: ~ appSettings

info: 1 change previewed:
    ~ 1 resource to update
      7 resources unchanged

Do you want to perform this update? yes
Updating stack 'pulumi-test'
Performing changes:

     Type                         Name     Status                  Info
 ~   azure:appservice:AppService  testApp  **updating failed**     changes: ~ appSettings, 2 errors

Diagnostics:
  azure:appservice:AppService: testApp
    error: Plan apply failed: updating urn:pulumi:pulumi-test::pulumi-test::azure:appservice/appService:AppService::testApp: web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=409 -- Original Error: failed request: autorest/azure: Service returned an error. Status=<nil> <nil>

    error: update failed

info: no changes required:
      7 resources unchanged

Permalink: https://app.pulumi.com/loic-sharma/pulumi-test/updates/11
error: update failed

I can get around this by doing pulumi destroy followed by a pulumi update.

  1. It seems that changing an AppService's appSettings's value from a string to an Output<string> doesn't get detected. Example from:
appSettings: {
  "Hello": "World"
}

Example to:

appSettings: {
  "Hello": all([output1, output2]).apply(([a, b]) => `${a} ${b}`)
}

Running pulumi update will result in a preview of no changes.

Preview fails when setting FunctionApp/AppService siteConfig.use32BitWorkerProcess property

Preview fails when setting siteConfig.use32BitWorkerProcess property on a FunctionApp or AppService. It looks like the tf mapping is off by a character based on the error message: error: azure:appservice/appService:AppService resource 'abc-stage-clbdir' has a problem: site_config.0: invalid or unknown key: use32_bit_worker_process

use32_bit_worker_process looks like it should be passed down as use_32_bit_worker_process

Unmapped resources

Several recently added resources are note currently mapped into the Pulumi API:

warning: resource azurerm_firewall not found in provider map; skipping
warning: resource azurerm_firewall_network_rule_collection not found in provider map; skipping
warning: resource azurerm_management_group not found in provider map; skipping
warning: resource azurerm_mysql_virtual_network_rule not found in provider map; skipping
warning: resource azurerm_postgresql_virtual_network_rule not found in provider map; skipping
warning: Could not find docs for resource azurerm_storage_zipblob; consider overriding doc source location
warning: data source azurerm_management_group not found in provider map; skipping

Use terraform-provider-azurerm v1.18.0.

Terraform-provider-azurerm v1.18.0 was released on the 2nd November. v1.17.0 was mid Oct.

https://github.com/terraform-providers/terraform-provider-azurerm/releases/tag/v1.18.0

I have a very minor patch merged into v1.17.0 which I need to be able to use managed identities (it exposes the clientId property).

Is there any info about when this might be done - I've tried a few workarounds but none of them work both locally and on VSTS/DevOps and it's a blocker for me.

Many thanks!

AKS service principal creation not handling async

When running the AKS example for the first time I got the following error:

error: Plan apply failed: containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="ServicePrincipalNotFound" Message="Service principal clientID: ****-****-****-**** not found in Active Directory tenant ****-****-****-****, Please see https://aka.ms/acs-sp-help for more details."

When I re-ran pulumi up it worked. I believe this is due to the asynchronous nature of AAD service principal creation and propagation rather than a bug in the dependency graph. AAD is a particularly problematic resource and I believe has an SLA of ~2 mins for entity availability. It'd be worth having some validate and retry logic such as that in the Azure CLI (Azure/azure-cli#1499) before returning from the create method.

Add explicit top level type for tag structure

Similar to how the AWS provider (now) has aws.Tags defined as a dictionary object, we should add an explicit type to the Azure provider to avoid having to use any in various places.

Add constants for locations

Location names should likely be constants and a union type, however attention needs to be paid to what the error messages would look like if an invalid location name is passed in via config (as a string).

KeyVault.name is incorrectly documented.

The name property on KeyVault is documented as :

keyvault.ts

    /**
     * SKU name to specify whether the key vault is a `standard`
     * or `premium` vault.
     */
    readonly name: pulumi.Output<string>;

However it really is the name you'd expect it to be :

let appKeyVault = new azure.keyvault.KeyVault("big-bag-of-secrets", {
    name: "big-bag-of-secrets",
    resourceGroupName: resourceGroup.name,
    location: config.location,
    sku: { name: "standard" },
    tenantId: config.azureAdTenantId
});
appKeyVault.name.apply(x => console.log(x));
Diagnostics:
  pulumi:pulumi:Stack: dev-dev
    info: big-bag-of-secrets

Support for AAD integration for RBAC Enabled K8s Clusters

I've been attempting to see if it's possible to provision an AKS cluster using Pulumi that would be able to integrate properly with AAD as outlined in the Microsoft Docs.

Using the Pulumi Typescript SDK it doesn't appear that the necessary configuration for the aadProfile is currently exposed. After creating the cluster with RBAC enabled and inspecting the generated resource on Azure there is no configuration setting for aadProfile and attempting to add it manually after the fact with something like this:

"aadProfile": {
 "clientAppID": "7ee598bb-0000-0000-0000-83692e2d717e",
 "serverAppID": "7ee598bb-0000-0000-0000-83692e2d717e",
 "tenantID": "72f988bf-0000-0000-0000-2d7cd011db47"
}

returns an error message that the propery cannot be changed:

{
  "code": "PropertyChangeNotAllowed",
  "message": "Changing property 'aadProfile' is not allowed.",
  "target": "aadProfile"
}

Are there plans to be able to support this scenario in the near future?

Provider does not automatically pick up credentials in Azure Shell

When using the Azure Shell in the Azure Portal (or from VS Code), you get ambient credentials for you Azure subscription which allow tools like az to work without need for additional login/configuration.

However, the Pulumi Azure Provider does not appear to pick these up automatically:

luke@Azure:~/examples/azure-js-webserver$ pulumi up
Previewing update of stack 'testme'
Previewing changes:

     Type                    Name                    Plan          Info
 *   global                  global                  no change     1 error
 +   └─ pulumi:pulumi:Stack  webserver-azure-testme  create

Diagnostics:
  global: global
    error: Azure CLI Authorization Tokens were not found. Please ensure the Azure CLI is installed and then log-in with `az login`.

error: an error occurred while advancing the preview
luke@Azure:~/examples/azure-js-webserver$ az login
Cloud Shell is automatically authenticated under the initial account signed-in with. Run 'az login' only if you need to use a different account
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code SOMESTRING to authenticate.

GetZoneResult doesn't contain the 'name' property

I'm trying to add records to an existing DNS zone but I have to specify the zone name twice - once to retrieve it and again to create the record.

GetZoneArgs requires name and resourceGroupName
GetZoneResult only has resourceGroupName.

ARecordArgs requires zoneName and resourceGroupName.

AKS cluster missing from state after 201 response and error

The azure-ts-aks-multicluster example linked in the branch below creates two AKS clusters in the same Azure region. For a new Azure account with low account limits (i.e. max of 10 cores), this app will fail with the error:

error: Plan apply failed: Error waiting for completion of Managed Kubernetes Cluster "akscluster-east3884a058" (Resource Group "aks222b5260"): Code="OperationNotAllowed" Message="Operation results in exceeding quota limits of Core. Maximum allowed: 10, Current in use: 10, Additional requested: 2. Please read more about quota increase at https://aka.ms/ProdportalCRP/?#create/Microsoft.Support/Parameters/{\"subId\":\"dad1da46-e543-4a91-b7b4-3740c8411c30\",\"pesId\":\"15621\",\"supportTopicId\":\"32447243\"}."

The akscluster-east3884a058 resource will actually be created but will be absent from Pulumi's state and pulumi stack export. Subsequent pulumi runs will fail with the same erorr but end up creating a new AKS cluster each time. A pulumi destroy will destroy all of them because destroying the resource group destroys all resources in it too.

https://github.com/pulumi/examples/tree/clstokes/azure-ts-aks-multicluster-state-orphan/azure-ts-aks-multicluster

Steps to reproduce:

  1. Clone/init the specific branch above
  2. pulumi up with an Azure account that has "Total Regional vCPUs" limited to 10.
  3. Observe error
  4. Check pulumi stack export for AKS clusters
  5. Run pulumi up again to see new AKS cluster get created and still be missing from state
  6. pulumi destroy to clean up
Seemingly relevant verbose log messsages:
I1212 21:27:58.165177    1285 eventsink.go:60] AzureRM Request: 
I1212 21:27:58.203446    1285 eventsink.go:60] PUT /subscriptions/dad1da46-e543-4a91-b7b4-3740c8411c30/resourceGroups/aks088c8fde/providers/Microsoft.ContainerService/managedClusters/akscluster-weste1f5ab1b?api-version=2018-03-31 HTTP/1.1
I1212 21:27:58.237948    1285 eventsink.go:60] Host: management.azure.com
I1212 21:27:58.275976    1285 eventsink.go:60] User-Agent: Go/go1.11 (amd64-darwin) go-autorest/v10.15.5 Azure-SDK-For-Go/v21.3.0 containerservice/2018-03-31 Terraform/0.11.10 terraform-provider-azurerm/dev
I1212 21:27:58.318765    1285 eventsink.go:60] Content-Length: 913
I1212 21:27:58.363721    1285 eventsink.go:60] Content-Type: application/json; charset=utf-8
I1212 21:27:58.399767    1285 eventsink.go:60] Accept-Encoding: gzip
I1212 21:27:58.436406    1285 eventsink.go:60] 
I1212 21:27:58.484214    1285 eventsink.go:60] {"location":"westus","name":"akscluster-weste1f5ab1b","properties":{"agentPoolProfiles":[{"name":"aksagentpool","count":5,"vmSize":"Standard_D2_v2","osDiskSizeGB":0,"storageProfile":"ManagedDisks","osType":"Linux"}],"dnsPrefix":"azure-ts-aks-multicluster-kube","enableRBAC":false,"kubernetesVersion":"","linuxProfile":{"adminUsername":"aksuser","ssh":{"publicKeys":[{"keyData":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDuLQkZYOP0AQGhE/XBCK3ImBIevuTf89OGxujqKfkrFX/icuhE3LV9x1rrIuaqvQ/eQ9AnI4ZOvZDQFJjuyhD3uqW7Jzp3NakX4YY5hi8P14zp+4QPVIyphC9deqCBzGFKdPvy/VuYZwdmKAulZ9KdojuXyBNcA7BAzHMzHw3yu4WNqB0BJJ+jIHoM+EiPVCVxFNSilw1D6kUAvAr0wIKhgCjpED4ftiYJWRbvw14X9CPw+liTaHwd6BYDoEu9+DJcdQL1obEgxvZJfwgIYxXJOxdHsJsfMpA39qRvDYC18j6H/vBe7Zl+C0+JCuILGOjdMAwLkL1fJ08BZAzPROHT [email protected]"}]}},"servicePrincipalProfile":{"clientId":"4a7791e1-254b-4c4c-b738-c59dba24611d","secret":"asdfasdfasdf"}},"tags":{}}
...
I1212 21:28:06.001047    1285 eventsink.go:60] AzureRM Response for https://management.azure.com/subscriptions/dad1da46-e543-4a91-b7b4-3740c8411c30/resourceGroups/aks088c8fde/providers/Microsoft.ContainerService/managedClusters/akscluster-weste1f5ab1b?api-version=2018-03-31: 
I1212 21:28:06.043795    1285 eventsink.go:60] HTTP/1.1 201 Created
I1212 21:28:06.089103    1285 eventsink.go:60] Content-Length: 1609
I1212 21:28:06.120889    1285 eventsink.go:60] Azure-Asyncoperation: https://management.azure.com/subscriptions/dad1da46-e543-4a91-b7b4-3740c8411c30/providers/Microsoft.ContainerService/locations/westus/operations/90b9bf0b-6935-490c-89fa-70f46d7489db?api-version=2017-08-31
I1212 21:28:06.159560    1285 eventsink.go:60] Cache-Control: no-cache
I1212 21:28:06.203407    1285 eventsink.go:60] Content-Type: application/json
I1212 21:28:06.243587    1285 eventsink.go:60] Date: Thu, 13 Dec 2018 05:28:03 GMT
I1212 21:28:06.278096    1285 eventsink.go:60] Expires: -1
I1212 21:28:06.312905    1285 eventsink.go:60] Pragma: no-cache
I1212 21:28:06.353392    1285 eventsink.go:60] Server: nginx
I1212 21:28:06.399675    1285 eventsink.go:60] Strict-Transport-Security: max-age=31536000; includeSubDomains
I1212 21:28:06.431047    1285 eventsink.go:60] X-Content-Type-Options: nosniff
I1212 21:28:06.462443    1285 eventsink.go:60] X-Ms-Correlation-Request-Id: 75584373-c87d-47c8-a0bf-96b02e45c9c6
I1212 21:28:06.504115    1285 eventsink.go:60] X-Ms-Ratelimit-Remaining-Subscription-Writes: 1199
I1212 21:28:06.550362    1285 eventsink.go:60] X-Ms-Request-Id: 90b9bf0b-6935-490c-89fa-70f46d7489db
I1212 21:28:06.588664    1285 eventsink.go:60] X-Ms-Routing-Request-Id: CANADACENTRAL:20181213T052803Z:75584373-c87d-47c8-a0bf-96b02e45c9c6
I1212 21:28:06.631465    1285 eventsink.go:60] 
I1212 21:28:06.689541    1285 eventsink.go:60] {
I1212 21:28:06.730158    1285 eventsink.go:60]   "id": "/subscriptions/dad1da46-e543-4a91-b7b4-3740c8411c30/resourcegroups/aks088c8fde/providers/Microsoft.ContainerService/managedClusters/akscluster-weste1f5ab1b",
I1212 21:28:06.773601    1285 eventsink.go:60]   "location": "westus",
I1212 21:28:06.829538    1285 eventsink.go:60]   "name": "akscluster-weste1f5ab1b",
I1212 21:28:06.877652    1285 eventsink.go:60]   "type": "Microsoft.ContainerService/ManagedClusters",
I1212 21:28:06.918311    1285 eventsink.go:60]   "properties": {
I1212 21:28:06.954750    1285 eventsink.go:60]    "provisioningState": "Creating",
I1212 21:28:06.994994    1285 eventsink.go:60]    "kubernetesVersion": "1.9.11",
I1212 21:28:07.033487    1285 eventsink.go:60]    "dnsPrefix": "azure-ts-aks-multicluster-kube",
I1212 21:28:07.073459    1285 eventsink.go:60]    "agentPoolProfiles": [
I1212 21:28:07.111959    1285 eventsink.go:60]     {
I1212 21:28:07.150380    1285 eventsink.go:60]      "name": "aksagentpool",
I1212 21:28:07.189755    1285 eventsink.go:60]      "count": 5,
I1212 21:28:07.235973    1285 eventsink.go:60]      "vmSize": "Standard_D2_v2",
I1212 21:28:07.272242    1285 eventsink.go:60]      "osDiskSizeGB": 30,
I1212 21:28:07.308567    1285 eventsink.go:60]      "storageProfile": "ManagedDisks",
I1212 21:28:07.348632    1285 eventsink.go:60]      "maxPods": 110,
I1212 21:28:07.412119    1285 eventsink.go:60]      "osType": "Linux"
I1212 21:28:07.463634    1285 eventsink.go:60]     }
I1212 21:28:07.506484    1285 eventsink.go:60]    ],
I1212 21:28:07.545354    1285 eventsink.go:60]    "linuxProfile": {
I1212 21:28:07.582288    1285 eventsink.go:60]     "adminUsername": "aksuser",
I1212 21:28:07.618236    1285 eventsink.go:60]     "ssh": {
I1212 21:28:07.656452    1285 eventsink.go:60]      "publicKeys": [
I1212 21:28:07.693329    1285 eventsink.go:60]       {
I1212 21:28:07.732470    1285 eventsink.go:60]        "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDuLQkZYOP0AQGhE/XBCK3ImBIevuTf89OGxujqKfkrFX/icuhE3LV9x1rrIuaqvQ/eQ9AnI4ZOvZDQFJjuyhD3uqW7Jzp3NakX4YY5hi8P14zp+4QPVIyphC9deqCBzGFKdPvy/VuYZwdmKAulZ9KdojuXyBNcA7BAzHMzHw3yu4WNqB0BJJ+jIHoM+EiPVCVxFNSilw1D6kUAvAr0wIKhgCjpED4ftiYJWRbvw14X9CPw+liTaHwd6BYDoEu9+DJcdQL1obEgxvZJfwgIYxXJOxdHsJsfMpA39qRvDYC18j6H/vBe7Zl+C0+JCuILGOjdMAwLkL1fJ08BZAzPROHT [email protected]"
I1212 21:28:07.764653    1285 eventsink.go:60]       }
I1212 21:28:07.797814    1285 eventsink.go:60]      ]
I1212 21:28:07.844843    1285 eventsink.go:60]     }
I1212 21:28:07.889690    1285 eventsink.go:60]    },
I1212 21:28:07.924423    1285 eventsink.go:60]    "servicePrincipalProfile": {
I1212 21:28:07.961003    1285 eventsink.go:60]     "clientId": "4a7791e1-254b-4c4c-b738-c59dba24611d"
I1212 21:28:08.029346    1285 eventsink.go:60]    },
I1212 21:28:08.077864    1285 eventsink.go:60]    "nodeResourceGroup": "MC_aks088c8fde_akscluster-weste1f5ab1b_westus",
I1212 21:28:08.118262    1285 eventsink.go:60]    "enableRBAC": false,
I1212 21:28:08.154825    1285 eventsink.go:60]    "networkProfile": {
I1212 21:28:08.194237    1285 eventsink.go:60]     "networkPlugin": "kubenet",
I1212 21:28:08.235239    1285 eventsink.go:60]     "podCidr": "10.244.0.0/16",
I1212 21:28:08.271901    1285 eventsink.go:60]     "serviceCidr": "10.0.0.0/16",
I1212 21:28:08.308091    1285 eventsink.go:60]     "dnsServiceIP": "10.0.0.10",
I1212 21:28:08.351193    1285 eventsink.go:60]     "dockerBridgeCidr": "172.17.0.1/16"
I1212 21:28:08.391109    1285 eventsink.go:60]    }
I1212 21:28:08.424925    1285 eventsink.go:60]   }
I1212 21:28:08.468261    1285 eventsink.go:60]  }
...
I1212 21:37:30.742732    1285 step_executor.go:310] StepExecutor worker(7): step create on urn:pulumi:azure-ts-aks-multicluster::azure-ts-aks-multicluster::azure:containerservice/kubernetesCluster:KubernetesCluster::aksCluster-west failed with an error: Error waiting for completion of Managed Kubernetes Cluster "akscluster-weste1f5ab1b" (Resource Group "aks088c8fde"): Code="OperationNotAllowed" Message="Operation results in exceeding quota limits of Core. Maximum allowed: 10, Current in use: 10, Additional requested: 2. Please read more about quota increase at https://aka.ms/ProdportalCRP/?#create/Microsoft.Support/Parameters/{\"subId\":\"dad1da46-e543-4a91-b7b4-3740c8411c30\",\"pesId\":\"15621\",\"supportTopicId\":\"32447243\"}."

Add more Azure examples

We have a dearth of Azure examples at the moment. This doesn't accurately reflect the completeness of the provider and gives the impression it isn't ready for prime time.

Let's spend some time beefing up core examples around the "Colada" triad -- containers, serverless, and infrastructure -- especially once #42 has landed.

Panic in Terraform Provider creating a CosmosDB account with multiple geoLocations

Diagnostics:
  pulumi:pulumi:Stack: <redacted>
    info: panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x26d03bf]
    goroutine 342 [running]:
    github.com/pulumi/pulumi-azure/vendor/github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmCosmosDBAccountRead(0xc420a6c070, 0x2d24da0, 0xc420710000, 0xc420570460, 0x0)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_cosmos_db_account.go:555 +0x180f
    github.com/pulumi/pulumi-azure/vendor/github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmCosmosDBAccountCreate(0xc420a6c070, 0x2d24da0, 0xc420710000, 0xc420a6c070, 0x0)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_cosmos_db_account.go:354 +0xdcb
    github.com/pulumi/pulumi-azure/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc420437110, 0xc420ac9450, 0xc4205274c0, 0x2d24da0, 0xc420710000, 0xc420527401, 0x0, 0x0)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:225 +0x364
    github.com/pulumi/pulumi-azure/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc420477ce0, 0xc420a59600, 0xc420ac9450, 0xc4205274c0, 0xc4205274c0, 0x0, 0x0)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:283 +0xa4
    github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge.(*Provider).Create(0xc4205ab590, 0x3dcf920, 0xc420920840, 0xc420b88540, 0xc4205ab590, 0x1, 0x1)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge/provider.go:469 +0x542
    github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go._ResourceProvider_Create_Handler.func1(0x3dcf920, 0xc420920840, 0x2c4f320, 0xc420b88540, 0x3dcf920, 0xc420920840, 0x3dd5e20, 0x3e747f0)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go/provider.pb.go:1229 +0x86
    github.com/pulumi/pulumi-azure/vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1(0x3dcf920, 0xc420920840, 0x2c4f320, 0xc420b88540, 0xc42052d620, 0xc42052d640, 0x0, 0x0, 0x3dbcd20, 0xc42021fbe0)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc/server.go:61 +0x326
    github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go._ResourceProvider_Create_Handler(0x2cf1a20, 0xc4205ab590, 0x3dcf920, 0xc420ec8930, 0xc420ac9400, 0xc420283800, 0x0, 0x0, 0xc420969ac0, 0xc420969ac8)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go/provider.pb.go:1231 +0x16d
    github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).processUnaryRPC(0xc4200c8000, 0x3dd45c0, 0xc420088000, 0xc42091a200, 0xc4204cb7d0, 0x3e48620, 0x0, 0x0, 0x0)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:826 +0xab4
    github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).handleStream(0xc4200c8000, 0x3dd45c0, 0xc420088000, 0xc42091a200, 0x0)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:1023 +0x1528
    github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc42043a120, 0xc4200c8000, 0x3dd45c0, 0xc420088000, 0xc42091a200)
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:572 +0x9f
    created by github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).serveStreams.func1
    	/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:570 +0xa1

  azure:containerservice:KubernetesCluster: aks-aks
    error: Plan apply failed: transport is closing

  azure:cosmosdb:Account: cosmosdb
    error: Plan apply failed: transport is closing

info: 25 changes performed:
    + 25 resources created
Update duration: 11m59.302509812s

Improve namespace structure

The namespacing being used is somewhat too “opinionated”, and doesn’t match the common namespace structure of Azure services as seen in SDKs. We should pick a stable reference point and cleanly align namespacing to ensure APIs are available with meaningful and correct fully qualified names.

Embedding pulumi-azure into my Go application

Hi there,

I've just been testing out pulumi within a Go application on Azure. Works great. I'm currently writing an application that needs to spin up/down infrastructure based on various events. Leveraging Pulumi here vs go sdk for Azure would give me all the goodness of using a regular programming language vs. json hell.

I'm wondering, however, if I can embed pulumi into my own application. At this stage, I'm running pulumi up or pulumi destroy to create/destroy Azure resources. What's the most appropriate way for me to invoke this from within a Go application ?

Thanks for any help in the right direction.

Sincerely,
Ameer Deen.

Some output properties are not populated correctly

When creating an azure.networking.PublicIP, the resulting public IP address is undefined.

let publicIP = new azure.network.PublicIp("server-ip", {
    resourceGroupName: resourceGroup.name,
    location: resourceGroup.location,
    publicIpAddressAllocation: "Dynamic",
});
    + azure:network/publicIp:PublicIp: (create)
        [urn=urn:pulumi:testing::webserver-azure::azure:network/publicIp:PublicIp::server-ip]
        location                 : "westus"
        name                     : "server-ipaca0172a"
        publicIpAddressAllocation: "Dynamic"
        resourceGroupName        : "server59ee5b4c"
    ---outputs:---
    id                       : "/subscriptions/8484c44e-3967-4ae7-abad-0c187c09e18e/resourceGroups/server59ee5b4c/providers/Microsoft.Network/publicIPAddresses/server-ipaca0172a"
    publicIpAddressAllocation: "dynamic"

Note that many of the expected output properties are not actually present here - zones - ipAddress and possibly more.

Not sure whether this is an issue in pulumi, in the TF bridge, or in the terraform-provider-azurerm.

Notes on bringing up a Functions example in Azure

Not a bug per se - just a story. (though the story ends with it being seemingly impossible to use Azure Functions from Terraform/Pulumi - which we certainly will want to figure out how to fix).

Azure docs tell us how to stand up Azure Functions: https://docs.microsoft.com/en-us/azure/azure-functions/functions-infrastructure-as-code.

Starting off is simple:

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

let name = "serverlessraw"

let resourceGroup = new azure.core.ResourceGroup(name, {
    location:"westus",
});

let storageAccount = new azure.storage.Account(name, {
    resourceGroupName: resourceGroup.name,
    location: resourceGroup.location,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});

This works like a charm!

Next we need what Azure docs call a HostingPlan (though it's name is actually serverFarm). We find a Plan type that looks right. Azure docs make it sound like we should pass magic constant "Dynamic" as SKU properties on this Plan. The names for TF are totally different than for AzureRM (and the names for the Azure SDK are different than either of these). All with unclear mappings between them (computeMode vs. name vs. size - which I think are actually all the same thing??).

$ yarn build && pulumi up
yarn run v1.3.2
$ tsc
✨  Done in 1.62s.
Performing changes:
* pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:local::serverless-raw::pulumi:pulumi:Stack::serverless-raw-local]
    + azurerm:appservice/plan:Plan: (create)
        [urn=urn:pulumi:local::serverless-raw::azurerm:appservice/plan:Plan::serverlessraw]
        kind             : "Windows"
        location         : "westus"
        name             : "serverlessraw2afa398e"
        resourceGroupName: "serverlessrawade85cd9"
        sku              : [
            [0]: {
                size: "Dynamic"
                tier: "Dynamic"
            }
        ]
error PU2003: Plan apply failed: rpc error: code = Unknown desc = web.AppServicePlansClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="The parameter SKU.Name has an invalid value." Details=[{"Message":"The parameter SKU.Name has an invalid value."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","Message":"The parameter SKU.Name has an invalid value.","MessageTemplate":"The parameter {0} has an invalid value.","Parameters":["SKU.Name"]}}]
Step #4 failed [create]: this failure was catastrophic and the provider cannot guarantee recovery
info: no changes required:
      3 resources unchanged
A catastrophic error occurred; resources states may be unknown
error: rpc error: code = Unknown desc = web.AppServicePlansClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="The parameter SKU.Name has an invalid value." Details=[{"Message":"The parameter SKU.Name has an invalid value."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","Message":"The parameter SKU.Name has an invalid value.","MessageTemplate":"The parameter {0} has an invalid value.","Parameters":["SKU.Name"]}}]

Okay - that didn't work. Googling we find hashicorp/terraform-provider-azurerm#131 (comment) which suggests we use Y1 instead of Dynamic. I'm serious. Y1. No explanation - just Y1.

$ yarn build && pulumi up
yarn run v1.3.2
$ tsc
✨  Done in 1.59s.
Performing changes:
* pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:local::serverless-raw::pulumi:pulumi:Stack::serverless-raw-local]
    + azurerm:appservice/plan:Plan: (create)
        [urn=urn:pulumi:local::serverless-raw::azurerm:appservice/plan:Plan::serverlessraw]
        kind             : "Windows"
        location         : "westus"
        name             : "serverlessraw0c900d59"
        resourceGroupName: "serverlessrawade85cd9"
        sku              : [
            [0]: {
                size: "Y1"
                tier: "Dynamic"
            }
        ]
        ---outputs:---
        id                    : "/subscriptions/8484c44e-3967-4ae7-abad-0c187c09e18e/resourceGroups/serverlessrawade85cd9/providers/Microsoft.Web/serverfarms/serverlessraw0c900d59"
        kind                  : "functionapp"
        maximumNumberOfWorkers: "0"
        properties            : [
            [0]: {
                perSiteScaling: false
                reserved      : false
            }
        ]
        sku                   : [
            [0]: {
                capacity: "0"
                size    : "Y1"
                tier    : "Dynamic"
            }
        ]
    + azurerm:appservice/appService:AppService: (create)
        [urn=urn:pulumi:local::serverless-raw::azurerm:appservice/appService:AppService::serverlessraw]
        appServicePlanId : "/subscriptions/8484c44e-3967-4ae7-abad-0c187c09e18e/resourceGroups/serverlessrawade85cd9/providers/Microsoft.Web/serverfarms/serverlessraw0c900d59"
        enabled          : true
        location         : "westus"
        name             : "serverlessraw645adfef"
        resourceGroupName: "serverlessrawade85cd9"
error PU2003: Plan apply failed: rpc error: code = Unknown desc = web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=409 -- Original Error: failed request: autorest/azure: Service returned an error. Status=<nil> <nil>
Step #5 failed [create]: this failure was catastrophic and the provider cannot guarantee recovery
info: 1 change performed:
    + 1 resource created
      3 resources unchanged
Update duration: 11.912547416s
A catastrophic error occurred; resources states may be unknown
error: rpc error: code = Unknown desc = web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=409 -- Original Error: failed request: autorest/azure: Service returned an error. Status=<nil> <nil>

And that worked! Except the next step failed.

Any guesses what that error means? Nope. And not a single piece of useful content there to help with googling. I suppose the <nil>s were probably where the useful information was supposed to be :-).

Let's look at TF sources to see if that helps: https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/resource_arm_app_service.go#L270.

        // NOTE: these seem like sensible defaults, in lieu of any better documentation.
	skipDNSRegistration := false
	forceDNSRegistration := false
	skipCustomDomainVerification := true
	ttlInSeconds := "60"
	_, createErr := client.CreateOrUpdate(resGroup, name, siteEnvelope, &skipDNSRegistration, &skipCustomDomainVerification, &forceDNSRegistration, ttlInSeconds, make(chan struct{}))
	err := <-createErr
	if err != nil {
		return err
	}

Well - that first section doesn't inspire confidence does it! Nothing obvious there, let's go back to the docs.

Well - the docs told me there were some required appSettings - let's try adding those:

"appSettings": [
    {
        "name": "AzureWebJobsStorage",
        "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
    },
    {
        "name": "AzureWebJobsDashboard",
        "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
    }

Hmm - what on earth is that listKeys thing. Even after reading the docs for 10 mins I can't figure out what the above is actually going to do. But there is a primaryAccessKey on the output properties of the resource we created earlier - let's just try using that.

async function getConnectionString() {
    let name = await storageAccount.name;
    let primaryAccessKey = await storageAccount.primaryAccessKey;
    return `DefaultEndpointsProtocol=https;AccountName=${name};AccountKey=${primaryAccessKey}`
}

let sites = new azure.appservice.AppService(name, {
    resourceGroupName: resourceGroup.name,
    location: resourceGroup.location,
    appServicePlanId: hostingPlan.id,
    appSettings: [{
        AzureWebJobsDashboard: getConnectionString(),
        AzureWebJobsStorage: getConnectionString(),
    }],    
})

Actually kind of nice how Pulumi let's us factor out that crazy connection string construction.

But results in the same error. :-(

Diving into the template linked from the the docs, we see they actually pass a bunch of other settings beyond what's listed in the docs. Let's try adding those:

let sites = new azure.appservice.AppService(name, {
    resourceGroupName: resourceGroup.name,
    location: resourceGroup.location,
    appServicePlanId: hostingPlan.id,
    enabled: true,
    appSettings: [{
        AzureWebJobsDashboard: getConnectionString(),
        AzureWebJobsStorage: getConnectionString(),
        WEBSITE_CONTENTAZUREFILECONNECTIONSTRING: getConnectionString(),
        WEBSITE_CONTENTSHARE: name,
        FUNCTIONS_EXTENSION_VERSION: "~1",
        WEBSITE_NODE_DEFAULT_VERSION: "6.5.0",
    }],
    
})

And updating:

$ yarn build && pulumi up
yarn run v1.3.2
$ tsc
✨  Done in 1.61s.
Performing changes:
* pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:local::serverless-raw::pulumi:pulumi:Stack::serverless-raw-local]
info: panic: fatal: An assertion has failed: Unexpected duplicate underscore: f_u_n_c_t_i_o_n_s__e_x_t_e_n_s_i_o_n__v_e_r_s_i_o_n
info:
info: goroutine 39 [running]:
info: github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/util/contract.failfast(0xc4200700e0, 0x6d)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/util/contract/failfast.go:11 +0xf3
info: github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/util/contract.Assertf(0x227c000, 0x25067c2, 0x23, 0xc420a10db8, 0x1, 0x1)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/pkg/util/contract/assert.go:21 +0x13d
info: github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge.TerraformToPulumiName(0xc4202fc780, 0x33, 0xc4202fc700, 0x33, 0x3009b80)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge/names.go:40 +0x23e
info: github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge.getInfoFromTerraformName(0xc4202fc780, 0x33, 0x0, 0x0, 0xc420236500, 0x4, 0xc420236360, 0x0, 0x0)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge/schema.go:453 +0x11f
info: github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge.MakeTerraformOutputs(0xc420236390, 0x0, 0x0, 0xc420a11000, 0x104722a)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge/schema.go:232 +0x12f
info: github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge.MakeTerraformOutput(0x2302ec0, 0xc420236390, 0x0, 0x0, 0x0, 0xc420663240, 0xb)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge/schema.go:299 +0x623
info: github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge.MakeTerraformOutput(0x22587a0, 0xc420616c80, 0xc420312c30, 0x0, 0xc420377a00, 0xc420663240, 0xb)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge/schema.go:285 +0x177
info: github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge.MakeTerraformOutputs(0xc420236360, 0xc42030e180, 0xc4203496e0, 0xc420236400, 0x0)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge/schema.go:236 +0x1ae
info: github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge.(*Provider).Check(0xc42038a200, 0x2f763e0, 0xc4202361e0, 0xc4206169e0, 0xc42038a200, 0x0, 0x0)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge/provider.go:246 +0x73b
info: github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go._ResourceProvider_Check_Handler.func1(0x2f763e0, 0xc4202361e0, 0x23dd780, 0xc4206169e0, 0x2f763e0, 0xc4202361e0, 0x2f7b0e0, 0xc4208e05a0)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go/provider.pb.go:567 +0x86
info: github.com/pulumi/pulumi-azure/vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1(0x2f763e0, 0xc4202361e0, 0x23dd780, 0xc4206169e0, 0xc420616a20, 0xc420616a40, 0x0, 0x0, 0x0, 0x0)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc/server.go:61 +0x326
info: github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go._ResourceProvider_Check_Handler(0x2469ba0, 0xc42038a200, 0x2f763e0, 0xc420236060, 0xc42011e070, 0xc420374940, 0x0, 0x0, 0x0, 0x0)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go/provider.pb.go:569 +0x16d
info: github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).processUnaryRPC(0xc420001c80, 0x2f79ee0, 0xc420278600, 0xc4208e6b40, 0xc4203732f0, 0x2fdd490, 0x0, 0x0, 0x0)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:900 +0x9d3
info: github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).handleStream(0xc420001c80, 0x2f79ee0, 0xc420278600, 0xc4208e6b40, 0x0)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:1122 +0x1528
info: github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc4203e8010, 0xc420001c80, 0x2f79ee0, 0xc420278600, 0xc4208e6b40)
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:617 +0x9f
info: created by github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).serveStreams.func1
info: 	/Users/luke/go/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:615 +0xa1
info: no changes required:
      4 resources unchanged
error: rpc error: code = Unavailable desc = transport is closing

f_u_n_c_t_i_o_n_s__e_x_t_e_n_s_i_o_n__v_e_r_s_i_o_n. Well that's fun :-). And this time it's our fault.

Reading the TF impl, it looks like these settings aren't even applied till after the initial Create succeeds, so let's try something else.

The docs mention setting "kind": "function". But there's no kind on the TF resource. And - indeed, the TF provider implementation does not offer any way to pass a value there. Perhaps that's why hashicorp/terraform-provider-azurerm#131 (comment) is still open :-).

Maybe this really is impossible in current state after all.

So, my current guess is that when you pick Y1 as your plan, it somehow requires you to set kind=function? But reports an unusable error message if you don't do that.

Oh well - maybe next time...

Don't require `location` everywhere

At the moment, most (every?) resources require an explicit location to be supplied. This feels unfortunate in comparison to how, say, the AWS and GCP providers work, which generally assume a single location per stack. It's admittedly nice to have the option to go multi-region within a single stack, but this certainly seems unlikely to be the common case. Furthermore, we already specify a location for ResourceGroups, one of which all resources are attached to.

We should consider adding a stack-wide configuration option, azure:location, that flows implicitly onto all Azure resources that get allocated within that stack, unless it's been explicitly overridden.

Note that we could also consider the same idea for ResourceGroups, since those too need to be explicitly set. This is less urgent than location IMHO simply because it's very common to allocate the ResourceGroup object itself in your Pulumi program, but could definitely be a quality of life improvement for some.

Add constants for instance sizes

It would be a good plan to add constants for the various instance sizes and a sum type to the various places that a size is accepted in a similar manner to the AWS provider.

Finalize namespace for Pulumi-Azure provider

Namespace for Azurerm it is not standardized. Current implementation follows the pattern outlined in Terraform document. Challenge is if it is not a standard supported by Azure. We should look deeply into the nodejs or python and/or Go SDK for Azure to derive our own namespaces. Let us try the existing one and write some samples to get some feedback on usability before deciding on the final namepsace.
Python SDK: http://azure-sdk-for-python.readthedocs.io/en/latest/resourcemanagementredis.html

Provider does not automatically pick up credentials with redirected desktop

I've mentioned this on Slack some time ago, still happens.

On one of the laptops (Windows), even though I login with az login, pulumi update will fail to find the credentials.

The workaround is to run robocopy "$env:userprofile\.azure" "$env:homeshare\.azure" and then everything works, until the next logout.

I've seen this advice in this issue in terraform provider repo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.