forked from MicrosoftLearning/eShopOnWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aci.bicep
102 lines (90 loc) · 2.37 KB
/
aci.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
@description('Name for the container group')
param name string = 'eshopcontainer'
@description('Location for all resources.')
param location string = resourceGroup().location
@description('Container image to deploy. Should be of the form repoName/imagename:tag for images stored in public Docker Hub, or a fully qualified URI for other registries. Images from private registries require additional registry credentials.')
param image string = 'mcr.microsoft.com/azuredocs/aci-helloworld'
@description('Port to open on the container and the public IP address.')
param port int = 5106
@description('The number of CPU cores to allocate to the container.')
param cpuCores int = 1
@description('The amount of memory to allocate to the container in gigabytes.')
param memoryInGb int = 2
@description('The behavior of Azure runtime if container has stopped.')
@allowed([
'Always'
'Never'
'OnFailure'
])
param restartPolicy string = 'Always'
@secure()
param password string
param username string
param server string
resource containerGroup 'Microsoft.ContainerInstance/containerGroups@2021-09-01' = {
name: name
location: location
properties: {
containers: [
{
name: name
properties: {
image: image
ports: [
{
port: port
protocol: 'TCP'
}
{
port: 80
protocol: 'TCP'
}
]
resources: {
requests: {
cpu: cpuCores
memoryInGB: memoryInGb
}
}
environmentVariables: [
{
name: 'ASPNETCORE_ENVIRONMENT'
value: 'Docker'
}
{
name: 'UseOnlyInMemoryDatabase'
value: 'true'
}
{
name: 'ASPNETCORE_HTTP_PORTS'
value: '80'
}
]
}
}
]
osType: 'Linux'
restartPolicy: restartPolicy
ipAddress: {
type: 'Public'
ports: [
{
port: port
protocol: 'TCP'
}
{
port: 80
protocol: 'TCP'
}
]
}
imageRegistryCredentials: [
{
password: password
server: server
username: username
}
]
}
}
output containerIPv4Address string = containerGroup.properties.ipAddress.ip