Skip to content

Commit 95c4528

Browse files
Merge pull request #1 from alnaimi-github/deploy-keyvault
Add Azure Key Vault module and integrate into Bicep deployment
2 parents ba4ff66 + 6699be5 commit 95c4528

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ az ad sp create-for-rbac --name "Github-Actions-SP" \
2929
```powershell
3030
az ad sp create-for-rbac --name "Github-Actions-SP" `
3131
--role contributor `
32-
--scopes /subscriptions/c19b5a5a-e3a7-495b-b6e3-14dbafe30ebd `
32+
--scopes /subscriptions/c39b5a5a-e3a7-495b-b6e3-84dbafe30ebd `
3333
--sdk-auth
3434
```
3535

infrastructure/main.bicep

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ param location string = resourceGroup().location
22

33
var uniqueId = uniqueString(resourceGroup().id)
44

5-
module apiService 'modules/compute/appservice.bicep'= {
5+
module keyVault './modules/secrets/keyvault.bicep' = {
6+
name: 'keyVaultDeployment'
7+
params: {
8+
vaultName: 'kv-${uniqueId}'
9+
location: location
10+
}
11+
}
12+
13+
module apiService 'modules/compute/appservice.bicep' = {
614
name: 'apiDeployment'
715
params: {
816
location: location
917
appName: 'api-${uniqueId}'
1018
appServiceplanName: 'plan-api-${uniqueId}'
1119
}
1220
}
13-
14-
15-
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
param location string = resourceGroup().location
2+
param vaultName string
3+
4+
resource keyVault 'Microsoft.KeyVault/vaults@2023-07-01' = {
5+
name: vaultName
6+
location: location
7+
properties: {
8+
sku: {
9+
family: 'A'
10+
name: 'standard'
11+
}
12+
enableRbacAuthorization: true
13+
tenantId: subscription().tenantId
14+
15+
}
16+
}
17+
18+
19+
output id string = keyVault.id
20+
output name string = keyVault.name

0 commit comments

Comments
 (0)