Skip to content

Commit 7a2b71d

Browse files
authored
Merge pull request #15 from fwickert/Redis-cache
Add Redis Cache resource to Bicep template
2 parents 89aa775 + e355a10 commit 7a2b71d

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

src/InfrastructureAsCode/main.bicep

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,25 @@ var registryName = '${uniqueString(resourceGroup().id)}mpnpreg'
1313
var registrySku = 'Standard'
1414
var imageName = 'techexcel/dotnetcoreapp'
1515
var startupCommand = ''
16+
var redisCacheName = '${uniqueString(resourceGroup().id)}-mpnp-redis'
17+
var redisCacheSku = 'Basic'
1618

19+
resource redisCache 'Microsoft.Cache/Redis@2023-08-01' = {
20+
name: redisCacheName
21+
location: location
22+
properties: {
23+
sku: {
24+
name: redisCacheSku
25+
family: 'C'
26+
capacity: 0
27+
}
28+
enableNonSslPort: false
29+
minimumTlsVersion: '1.2'
30+
redisConfiguration: {
31+
'maxmemory-policy': 'volatile-lru'
32+
}
33+
}
34+
}
1735

1836
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = {
1937
name: logAnalyticsName
@@ -29,18 +47,6 @@ resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-12
2947
}
3048
}
3149

32-
resource redisCache 'Microsoft.Cache/Redis@2020-06-01' = {
33-
name: 'myRedisCachefw' // Replace with your Redis cache name
34-
location: resourceGroup().location
35-
sku: {
36-
name: 'Basic'
37-
family: 'C'
38-
capacity: 0
39-
}
40-
properties: {
41-
enableNonSslPort: false
42-
}
43-
}
4450

4551

4652
resource appInsights 'Microsoft.Insights/components@2020-02-02-preview' = {

0 commit comments

Comments
 (0)