Skip to content

Commit 7294e53

Browse files
Merge pull request #11 from briandenicola/azure-redis
🎲 Wed Oct 23 19:01:31 UTC 2024
2 parents 91c4cac + 26b6c15 commit 7294e53

File tree

1 file changed

+38
-22
lines changed

1 file changed

+38
-22
lines changed

src/InfrastructureAsCode/main.bicep

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ var logAnalyticsName = '${uniqueString(resourceGroup().id)}-mpnp-la'
1010
var appInsightsName = '${uniqueString(resourceGroup().id)}-mpnp-ai'
1111
var sku = 'S1'
1212
var registryName = '${uniqueString(resourceGroup().id)}mpnpreg'
13+
var redisCacheName = '${uniqueString(resourceGroup().id)}-mpnp-cache'
14+
1315
var registrySku = 'Standard'
1416
var imageName = 'techexcel/dotnetcoreapp'
1517
var startupCommand = ''
@@ -64,27 +66,41 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2022-09-01' = {
6466
// Generate bicep code to create an Azure Web App using docker image name imageName and startup command of startupCommand
6567

6668
resource webApp 'Microsoft.Web/sites@2022-09-01' = {
67-
name: webAppName
68-
location: location
69-
properties: {
70-
serverFarmId: appServicePlan.id
71-
siteConfig: {
72-
linuxFxVersion: 'DOCKER|${imageName}'
73-
appCommandLine: startupCommand
74-
appSettings: [
75-
{
76-
name: 'WEBSITES_PORT'
77-
value: '8080'
78-
}
79-
{
80-
name: 'WEBSITES_ENABLE_APP_SERVICE_STORAGE'
81-
value: 'false'
82-
}
83-
{
84-
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
85-
value: appInsights.properties.InstrumentationKey
86-
}
87-
]
88-
}
69+
name: webAppName
70+
location: location
71+
properties: {
72+
serverFarmId: appServicePlan.id
73+
siteConfig: {
74+
linuxFxVersion: 'DOCKER|${imageName}'
75+
appCommandLine: startupCommand
76+
appSettings: [
77+
{
78+
name: 'WEBSITES_PORT'
79+
value: '8080'
80+
}
81+
{
82+
name: 'WEBSITES_ENABLE_APP_SERVICE_STORAGE'
83+
value: 'false'
84+
}
85+
{
86+
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
87+
value: appInsights.properties.InstrumentationKey
88+
}
89+
]
8990
}
9091
}
92+
}
93+
94+
// Resource: Azure Redis Cache
95+
resource redisCache 'Microsoft.Cache/Redis@2021-06-01' = {
96+
name: redisCacheName
97+
location: location
98+
properties: {
99+
sku: {
100+
name: 'Basic'
101+
family: 'C'
102+
capacity: '0'
103+
}
104+
enableNonSslPort: false
105+
}
106+
}

0 commit comments

Comments
 (0)