Skip to content

Commit 4a60122

Browse files
Copilotcsharpfritz
andcommitted
Add CacheRefresh__ApiKey parameter to bicep deployment configuration
Co-authored-by: csharpfritz <[email protected]>
1 parent 9bdbf2d commit 4a60122

5 files changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/azure-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
2929
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
3030
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
31+
CACHE_REFRESH_API_KEY: ${{ secrets.CACHE_REFRESH_API_KEY }}
3132

3233
steps:
3334
- name: Checkout

AppHost/infra/web.tmpl.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ properties:
3030
secrets:
3131
- name: connectionstrings--tables
3232
value: '{{ .Env.AZURE_STORAGE_TABLEENDPOINT }}'
33+
- name: cacherefresh--apikey
34+
value: '{{ .Env.CACHE_REFRESH_API_KEY }}'
3335
template:
3436
containers:
3537
- image: {{ .Image }}
@@ -49,6 +51,8 @@ properties:
4951
value: in_memory
5052
- name: ConnectionStrings__tables
5153
secretRef: connectionstrings--tables
54+
- name: CacheRefresh__ApiKey
55+
secretRef: cacherefresh--apikey
5256
scale:
5357
minReplicas: 1
5458
tags:

infra/main.bicep

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ param location string
1212
@description('Id of the user or app to assign application roles')
1313
param principalId string = ''
1414

15+
@description('API key for cache refresh endpoint security')
16+
@secure()
17+
param cacheRefreshApiKey string = ''
18+
1519

1620
var tags = {
1721
'azd-env-name': environmentName
@@ -29,6 +33,7 @@ module resources 'resources.bicep' = {
2933
location: location
3034
tags: tags
3135
principalId: principalId
36+
cacheRefreshApiKey: cacheRefreshApiKey
3237
}
3338
}
3439

infra/main.parameters.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
},
1111
"location": {
1212
"value": "${AZURE_LOCATION}"
13+
},
14+
"cacheRefreshApiKey": {
15+
"value": "${CACHE_REFRESH_API_KEY}"
1316
}
1417
}
1518
}

infra/resources.bicep

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ param location string = resourceGroup().location
33
@description('Id of the user or app to assign application roles')
44
param principalId string = ''
55

6+
@description('API key for cache refresh endpoint security')
7+
@secure()
8+
param cacheRefreshApiKey string = ''
9+
610

711
@description('Tags that will be applied to all resources')
812
param tags object = {}

0 commit comments

Comments
 (0)