Skip to content

Commit 09ebb9e

Browse files
committed
updated bicep
1 parent abacc64 commit 09ebb9e

File tree

1 file changed

+65
-31
lines changed

1 file changed

+65
-31
lines changed

src/InfrastructureAsCode/main.bicep

Lines changed: 65 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,64 +8,98 @@ var webAppName = '${uniqueString(resourceGroup().id)}-${environment}'
88
var appServicePlanName = '${uniqueString(resourceGroup().id)}-mpnp-asp'
99
var logAnalyticsName = '${uniqueString(resourceGroup().id)}-mpnp-la'
1010
var appInsightsName = '${uniqueString(resourceGroup().id)}-mpnp-ai'
11-
var sku = 'S1'
11+
var sku = 'P0V3'
1212
var registryName = '${uniqueString(resourceGroup().id)}mpnpreg'
1313
var registrySku = 'Standard'
1414
var imageName = 'techexcel/dotnetcoreapp'
1515
var startupCommand = ''
1616

17-
// TODO: complete this script
18-
resource appServicePlan 'Microsoft.Web/serverfarms@2021-02-01' = {
19-
name: appServicePlanName
20-
location: location
21-
sku: {
22-
name: sku
23-
tier: 'Standard'
24-
}
25-
properties: {
26-
reserved: true
27-
}
28-
}
2917

30-
resource webApp 'Microsoft.Web/sites@2021-02-01' = {
31-
name: webAppName
18+
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = {
19+
name: logAnalyticsName
3220
location: location
3321
properties: {
34-
serverFarmId: appServicePlan.id
35-
siteConfig: {
36-
linuxFxVersion: 'DOCKER|${imageName}'
37-
appCommandLine: startupCommand
22+
sku: {
23+
name: 'PerGB2018'
24+
}
25+
retentionInDays: 90
26+
workspaceCapping: {
27+
dailyQuotaGb: 1
3828
}
3929
}
4030
}
4131

42-
resource appInsights 'Microsoft.Insights/components@2020-02-02' = {
32+
resource appInsights 'Microsoft.Insights/components@2020-02-02-preview' = {
4333
name: appInsightsName
4434
location: location
4535
kind: 'web'
4636
properties: {
4737
Application_Type: 'web'
38+
WorkspaceResourceId: logAnalyticsWorkspace.id
4839
}
4940
}
5041

51-
resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-06-01' = {
52-
name: logAnalyticsName
42+
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2020-11-01-preview' = {
43+
name: registryName
5344
location: location
45+
sku: {
46+
name: registrySku
47+
}
5448
properties: {
55-
sku: {
56-
name: 'PerGB2018'
57-
}
58-
retentionInDays: 30
49+
adminUserEnabled: true
5950
}
6051
}
6152

62-
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2021-06-01-preview' = {
63-
name: registryName
53+
resource appServicePlan 'Microsoft.Web/serverFarms@2022-09-01' = {
54+
name: appServicePlanName
6455
location: location
56+
kind: 'linux'
57+
properties: {
58+
reserved: true
59+
}
6560
sku: {
66-
name: registrySku
61+
name: sku
6762
}
63+
}
64+
65+
resource appServiceApp 'Microsoft.Web/sites@2020-12-01' = {
66+
name: webAppName
67+
location: location
6868
properties: {
69-
adminUserEnabled: true
70-
}
69+
serverFarmId: appServicePlan.id
70+
httpsOnly: true
71+
clientAffinityEnabled: false
72+
siteConfig: {
73+
linuxFxVersion: 'DOCKER|${containerRegistry.name}.azurecr.io/${uniqueString(resourceGroup().id)}/${imageName}'
74+
http20Enabled: true
75+
minTlsVersion: '1.2'
76+
appCommandLine: startupCommand
77+
appSettings: [
78+
{
79+
name: 'WEBSITES_ENABLE_APP_SERVICE_STORAGE'
80+
value: 'false'
81+
}
82+
{
83+
name: 'DOCKER_REGISTRY_SERVER_URL'
84+
value: 'https://${containerRegistry.name}.azurecr.io'
85+
}
86+
{
87+
name: 'DOCKER_REGISTRY_SERVER_USERNAME'
88+
value: containerRegistry.name
89+
}
90+
{
91+
name: 'DOCKER_REGISTRY_SERVER_PASSWORD'
92+
value: containerRegistry.listCredentials().passwords[0].value
93+
}
94+
{
95+
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
96+
value: appInsights.properties.InstrumentationKey
97+
}
98+
]
99+
}
100+
}
71101
}
102+
103+
output application_name string = appServiceApp.name
104+
output application_url string = appServiceApp.properties.hostNames[0]
105+
output container_registry_name string = containerRegistry.name

0 commit comments

Comments
 (0)