Skip to content

Instantly share code, notes, and snippets.

@AdoraNwodo

AdoraNwodo/index.ts

Last active May 16, 2020
Embed
What would you like to do?
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const environment = pulumi.getStack();
const location = "WestEurope";
const resourceGroupName = "tutorial-rg";
const appservicePlanName = "tutorial-plan";
const storageAccountName = "tutorialstore";
const functionAppName = "tutorial-app";
// Create Resource Group
export const resourceGroup = new azure.core.ResourceGroup(resourceGroupName,
{
location,
name: resourceGroupName,
tags: {
environment
}
});
// Create app service plan
export const asp = new azure.appservice.Plan(appservicePlanName, {
kind: "App",
location,
name: appservicePlanName,
resourceGroupName: resourceGroup.name,
sku: {
size: "S1",
tier: "Premium V2"
},
maximumElasticWorkerCount: 1
});
// Storage account for the function app
export const store = new azure.storage.Account(storageAccountName, {
name: storageAccountName,
accountReplicationType: "LRS",
accountTier: "Standard",
location: resourceGroup.location,
accountKind: "StorageV2",
resourceGroupName: resourceGroup.name,
tags: {
environment
}
});
// Create function app
export const app = new azure.appservice.FunctionApp(functionAppName, {
appServicePlanId: asp.id,
location: resourceGroup.location,
resourceGroupName: resourceGroup.name,
storageAccountName: store.name,
storageAccountAccessKey: store.primaryAccessKey,
identity: {
type: "SystemAssigned"
},
appSettings: {
CLOUD_SERVICE_CONFIG: environment
},
siteConfig: {
alwaysOn: true,
use32BitWorkerProcess: false,
websocketsEnabled: false
},
version: "~3",
tags: {
environment
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.