Skip to content

Commit b1cf0ac

Browse files
committed
Update main.bicep with new resource definitions
1 parent bd79bd4 commit b1cf0ac

File tree

1 file changed

+89
-2
lines changed

1 file changed

+89
-2
lines changed

src/InfrastructureAsCode/main.bicep

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,97 @@ 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
17+
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = {
18+
name: logAnalyticsName
19+
location: location
20+
properties: {
21+
sku: {
22+
name: 'PerGB2018'
23+
}
24+
retentionInDays: 90
25+
workspaceCapping: {
26+
dailyQuotaGb: 1
27+
}
28+
}
29+
}
30+
31+
resource appInsights 'Microsoft.Insights/components@2020-02-02-preview' = {
32+
name: appInsightsName
33+
location: location
34+
kind: 'web'
35+
properties: {
36+
Application_Type: 'web'
37+
WorkspaceResourceId: logAnalyticsWorkspace.id
38+
}
39+
}
40+
41+
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2020-11-01-preview' = {
42+
name: registryName
43+
location: location
44+
sku: {
45+
name: registrySku
46+
}
47+
properties: {
48+
adminUserEnabled: true
49+
}
50+
}
51+
52+
resource appServicePlan 'Microsoft.Web/serverFarms@2022-09-01' = {
53+
name: appServicePlanName
54+
location: location
55+
kind: 'linux'
56+
properties: {
57+
reserved: true
58+
}
59+
sku: {
60+
name: sku
61+
}
62+
}
63+
64+
resource appServiceApp 'Microsoft.Web/sites@2020-12-01' = {
65+
name: webAppName
66+
location: location
67+
properties: {
68+
serverFarmId: appServicePlan.id
69+
httpsOnly: true
70+
clientAffinityEnabled: false
71+
siteConfig: {
72+
linuxFxVersion: 'DOCKER|${containerRegistry.name}.azurecr.io/${uniqueString(resourceGroup().id)}/${imageName}'
73+
http20Enabled: true
74+
minTlsVersion: '1.2'
75+
appCommandLine: startupCommand
76+
appSettings: [
77+
{
78+
name: 'WEBSITES_ENABLE_APP_SERVICE_STORAGE'
79+
value: 'false'
80+
}
81+
{
82+
name: 'DOCKER_REGISTRY_SERVER_URL'
83+
value: 'https://${containerRegistry.name}.azurecr.io'
84+
}
85+
{
86+
name: 'DOCKER_REGISTRY_SERVER_USERNAME'
87+
value: containerRegistry.name
88+
}
89+
{
90+
name: 'DOCKER_REGISTRY_SERVER_PASSWORD'
91+
value: containerRegistry.listCredentials().passwords[0].value
92+
}
93+
{
94+
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
95+
value: appInsights.properties.InstrumentationKey
96+
}
97+
]
98+
}
99+
}
100+
}
101+
102+
output application_name string = appServiceApp.name
103+
output application_url string = appServiceApp.properties.hostNames[0]
104+
output container_registry_name string = containerRegistry.name

0 commit comments

Comments
 (0)