-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.bicep
65 lines (58 loc) · 1.68 KB
/
main.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
58
59
60
61
62
63
64
65
param name string = 'site001'
param location string = resourceGroup().location
param acrName string = 'myAcr'
param dockerUsername string = 'adminUser'
param dockerImageAndTag string = 'app/frontend:latest'
param acrResourceGroup string = resourceGroup().name
param acrSubscription string = subscription().subscriptionId
// external ACR info
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2019-05-01' existing = {
scope: resourceGroup(acrSubscription, acrResourceGroup)
name: acrName
}
var websiteName = '${name}-site'
resource site 'microsoft.web/sites@2020-06-01' = {
name: websiteName
location: location
properties: {
siteConfig: {
appSettings: [
{
name: 'DOCKER_REGISTRY_SERVER_URL'
value: 'https://${acrName}.azurecr.io'
}
{
name: 'DOCKER_REGISTRY_SERVER_USERNAME'
value: dockerUsername
}
{
name: 'DOCKER_REGISTRY_SERVER_PASSWORD'
value: containerRegistry.listCredentials().passwords[0].value
}
{
name: 'WEBSITES_ENABLE_APP_SERVICE_STORAGE'
value: 'false'
}
]
linuxFxVersion: 'DOCKER|${acrName}.azurecr.io/${dockerImageAndTag}'
}
serverFarmId: farm.id
}
}
var farmName = '${name}-farm'
resource farm 'microsoft.web/serverFarms@2020-06-01' = {
name: farmName
location: location
sku: {
name: 'B1'
tier: 'Basic'
}
kind: 'linux'
properties: {
targetWorkerSizeId: 0
targetWorkerCount: 1
reserved: true
}
}
output publicUrl string = site.properties.defaultHostName
output ftpUser string = any(site.properties).ftpUsername // TODO: workaround for missing property definition