-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(azure): add redis resource (#518)
Related to #275 - Added Redis resource to infrastructure - Added `host name` to the key vault and app configuration to make it accessible to the container app. - Using managed identity to connect the web apis to Redis ~~Doesn't seem like managed identity is possible for apps that read/write to the redis instance. We could use a pre-defined role, but that would only enable control plane level permissions.. ¯\_(ツ)_/¯~~
- Loading branch information
Showing
17 changed files
with
178 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
param namePrefix string | ||
param location string | ||
@minLength(1) | ||
param environmentKeyVaultName string | ||
@minLength(1) | ||
param version string | ||
|
||
@export() | ||
type Sku = { | ||
name: 'Basic' | 'Standard' | 'Premium' | ||
family: 'C' | 'P' | ||
@minValue(1) | ||
capacity: int | ||
} | ||
param sku Sku | ||
|
||
// https://learn.microsoft.com/en-us/azure/templates/microsoft.cache/redis?pivots=deployment-language-bicep | ||
resource redis 'Microsoft.Cache/Redis@2023-08-01' = { | ||
name: '${namePrefix}-redis' | ||
location: location | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
properties: { | ||
sku: sku | ||
enableNonSslPort: false | ||
redisConfiguration: { | ||
'aad-enabled': 'true' | ||
'maxmemory-policy': 'allkeys-lru' | ||
} | ||
redisVersion: version | ||
} | ||
} | ||
|
||
module redisConnectionString '../keyvault/upsertSecret.bicep' = { | ||
name: 'redisHostName' | ||
params: { | ||
destKeyVaultName: environmentKeyVaultName | ||
secretName: 'dialogportenRedisHostName' | ||
// disable public access? Use vnet here maybe? | ||
secretValue: redis.properties.hostName | ||
} | ||
} | ||
|
||
output hostName string = redis.properties.hostName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.