Skip to content

Commit fa82d46

Browse files
Karacs PéterKaracs Péter
authored andcommitted
deploy infra
1 parent a8c6f98 commit fa82d46

1 file changed

Lines changed: 50 additions & 36 deletions

File tree

‎main.bicep‎

Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,66 @@
1-
param acrName string
2-
param acrLocation string
1+
// Parameters
2+
param location string = resourceGroup().location
3+
4+
// Container Registry Parameters
5+
param containerRegistryName string
6+
param acrAdminUserEnabled bool = true
7+
8+
// Service Plan Parameters
39
param servicePlanName string
4-
param servicePlanLocation string
10+
var servicePlanSku = {
11+
name: 'B1'
12+
tier: 'Basic'
13+
family: 'B'
14+
capacity: 1
15+
}
16+
17+
// Web App Parameters
518
param webAppName string
6-
param webAppLocation string
7-
param containerRegistryImageName string
8-
param containerRegistryImageVersion string
19+
param dockerRegistryServerUserName string
20+
@secure()
21+
param dockerRegistryServerPassword string
22+
param dockerRegistryImageName string
23+
param dockerRegistryImageVersion string = 'latest'
24+
param webAppCommandLine string = ''
925

10-
module acrModule './modules/acr.bicep' = {
11-
name: 'deployACR'
26+
// Deploy Azure Container Registry
27+
module containerRegistry 'modules/container-registry.bicep' = {
28+
name: 'containerRegistryDeployment'
1229
params: {
13-
name: acrName
14-
location: acrLocation
15-
acrAdminUserEnabled: true
30+
name: containerRegistryName
31+
location: location
32+
adminUserEnabled: acrAdminUserEnabled
1633
}
1734
}
1835

19-
module servicePlanModule './modules/servicePlan.bicep' = {
20-
name: 'deployServicePlan'
36+
// Deploy Azure Service Plan
37+
module servicePlan 'modules/service-plan.bicep' = {
38+
name: 'servicePlanDeployment'
2139
params: {
2240
name: servicePlanName
23-
location: servicePlanLocation
24-
sku: {
25-
capacity: 1
26-
family: 'B'
27-
name: 'B1'
28-
size: 'B1'
29-
tier: 'Basic'
30-
}
41+
location: location
42+
sku: servicePlanSku
3143
}
3244
}
3345

34-
module webAppModule './modules/webApp.bicep' = {
35-
name: 'deployWebApp'
46+
// Deploy Azure Web App
47+
module webApp 'modules/web-app.bicep' = {
48+
name: 'webAppDeployment'
3649
params: {
3750
name: webAppName
38-
location: webAppLocation
39-
kind: 'app'
40-
serverFarmResourceId: servicePlanModule.outputs.servicePlanId
41-
siteConfig: {
42-
linuxFxVersion: 'DOCKER|${acrModule.outputs.registryLoginServer}/${containerRegistryImageName}:${containerRegistryImageVersion}'
43-
appCommandLine: ''
44-
}
45-
appSettingsKeyValuePairs: {
46-
WEBSITES_ENABLE_APP_SERVICE_STORAGE: false
47-
DOCKER_REGISTRY_SERVER_URL: acrModule.outputs.registryLoginServer
48-
DOCKER_REGISTRY_SERVER_USERNAME: acrModule.outputs.adminUsername
49-
DOCKER_REGISTRY_SERVER_PASSWORD: acrModule.outputs.adminPassword
50-
}
51+
location: location
52+
appServicePlanId: servicePlan.outputs.id
53+
dockerRegistryName: containerRegistryName
54+
dockerRegistryServerUserName: dockerRegistryServerUserName
55+
dockerRegistryServerPassword: dockerRegistryServerPassword
56+
dockerRegistryImageName: dockerRegistryImageName
57+
dockerRegistryImageVersion: dockerRegistryImageVersion
58+
appCommandLine: webAppCommandLine
5159
}
5260
}
61+
62+
// Outputs
63+
output containerRegistryName string = containerRegistry.outputs.containerRegistryName
64+
output containerRegistryLoginServer string = containerRegistry.outputs.containerRegistryLoginServer
65+
output appServicePlanId string = servicePlan.outputs.id
66+
output webAppHostName string = webApp.outputs.appServiceAppHostName

0 commit comments

Comments
 (0)