-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazdeploy.bicep
57 lines (49 loc) · 1.35 KB
/
azdeploy.bicep
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
targetScope = 'subscription'
@description('Specifies the location for resources.')
param region string = 'West Europe'
@allowed([ 'dev', 'stage', 'test', 'prod' ])
@description('Specifies the environment to provision resources')
param env string = 'dev'
@description('The default principal to have access to the Key Vault')
param demoUser string = '<create-your-demo-user-in-azure-ad>'
// run: az ad user show --id your-user-email
var me = '<you-user-object-id-in-AAD>'
resource rgDemoBicep 'Microsoft.Resources/resourceGroups@2022-09-01' = {
name: 'rg-${env}-demo-bicep'
location: region
tags: {
environment: env
}
}
module myAzureKeyVault './azure-keyvault.bicep' = {
name: 'demo-key-vault-deployment'
scope: rgDemoBicep
params: {
region: region
env: env
principalIds: [ demoUser, me, myWebApp.outputs.PrincipalId ]
}
}
module myAppConfiguration './azure-app-configuration.bicep' = {
scope: rgDemoBicep
name: 'demo-app-configuration-deployment'
params: {
region: region
env: env
principals: [
{ id: demoUser, type: 'User' }
{ id: me, type: 'User' }
{ id: myWebApp.outputs.PrincipalId, type: 'ServicePrincipal' }
]
}
}
module myWebApp './app-plan.bicep' = {
name: 'my-web-app-demo'
scope: rgDemoBicep
params: {
location: region
webAppName: 'sample-demo'
sku: 'B1'
env: env
}
}