Skip to content

Instantly share code, notes, and snippets.

Created June 4, 2020 07:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import * as azure from "@pulumi/azure";
import * as azuread from "@pulumi/azuread";
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
export const app = new azuread.Application('pulumi', {
availableToOtherTenants: false,
homepage: "",
identifierUris: [""],
oauth2AllowImplicitFlow: true,
replyUrls: [""],
export const sp = new azuread.ServicePrincipal('pulumi', {
applicationId: app.applicationId,
var password = new random.RandomPassword('pulumi-pass', {
length: 20,
special: true,
var servicePrincipalPassword = new azuread.ServicePrincipalPassword('pulumi-sp-pass', {
endDate: '2099-01-01T00:00:00Z',
value: password.result,
const subscription = azure.core.getSubscription({});
new azure.authorization.Assignment('pulumi-contributor', {
principalId: sp.objectId,
scope: subscription.then(p =>,
roleDefinitionName: 'Contributor',
export const appID = app.applicationId;
export const spID =;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment