-
Notifications
You must be signed in to change notification settings - Fork 9
/
step3.ts
35 lines (30 loc) · 1.22 KB
/
step3.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import * as pulumi from "@pulumi/pulumi";
import * as resources from "@pulumi/azure-nextgen/resources/latest";
import * as storage from "@pulumi/azure-nextgen/storage/latest";
import * as web from "@pulumi/azure-nextgen/web/latest";
const resourceGroup = new resources.ResourceGroup("my-group", {
resourceGroupName: "my-group",
location: "westus",
});
const storageAccount = new storage.StorageAccount("mystorage", {
resourceGroupName: resourceGroup.name,
accountName: "myuniquename",
location: resourceGroup.location,
sku: {
name: "Standard_LRS",
},
kind: "StorageV2",
});
const plan = new web.AppServicePlan("asp", {
resourceGroupName: resourceGroup.name,
name: "consumption-plan",
location: resourceGroup.location,
sku: {
name: "Y1",
tier: "Dynamic",
},
});
const storageAccountKeys = pulumi.all([resourceGroup.name, storageAccount.name]).apply(([resourceGroupName, accountName]) =>
storage.listStorageAccountKeys({ resourceGroupName, accountName }));
const primaryStorageKey = storageAccountKeys.keys[0].value;
const storageConnectionString = pulumi.interpolate`DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${primaryStorageKey}`;