|
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 |
3 | 9 | 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 |
5 | 18 | 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 = '' |
9 | 25 |
|
10 | | -module acrModule './modules/acr.bicep' = { |
11 | | - name: 'deployACR' |
| 26 | +// Deploy Azure Container Registry |
| 27 | +module containerRegistry 'modules/container-registry.bicep' = { |
| 28 | + name: 'containerRegistryDeployment' |
12 | 29 | params: { |
13 | | - name: acrName |
14 | | - location: acrLocation |
15 | | - acrAdminUserEnabled: true |
| 30 | + name: containerRegistryName |
| 31 | + location: location |
| 32 | + adminUserEnabled: acrAdminUserEnabled |
16 | 33 | } |
17 | 34 | } |
18 | 35 |
|
19 | | -module servicePlanModule './modules/servicePlan.bicep' = { |
20 | | - name: 'deployServicePlan' |
| 36 | +// Deploy Azure Service Plan |
| 37 | +module servicePlan 'modules/service-plan.bicep' = { |
| 38 | + name: 'servicePlanDeployment' |
21 | 39 | params: { |
22 | 40 | 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 |
31 | 43 | } |
32 | 44 | } |
33 | 45 |
|
34 | | -module webAppModule './modules/webApp.bicep' = { |
35 | | - name: 'deployWebApp' |
| 46 | +// Deploy Azure Web App |
| 47 | +module webApp 'modules/web-app.bicep' = { |
| 48 | + name: 'webAppDeployment' |
36 | 49 | params: { |
37 | 50 | 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 |
51 | 59 | } |
52 | 60 | } |
| 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