Skip to content

Commit 48256a0

Browse files
author
Jan Mallo
committed
[u] update storage acct creation to include storageInfrastructureEncryption property
1 parent 9b4dfae commit 48256a0

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

infra/core/storage/storage-account.bicep

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@ param publicNetworkAccess string = 'Enabled'
2525
param sku object = { name: 'Standard_LRS' }
2626
@allowed([ 'None', 'AzureServices' ])
2727
param bypass string = 'AzureServices'
28+
param storageInfrastructureEncryption string = 'Disabled'
2829

2930
var networkAcls = (publicNetworkAccess == 'Enabled') ? {
3031
bypass: bypass
3132
defaultAction: 'Allow'
3233
} : { defaultAction: 'Deny' }
3334

35+
var encryption = (storageInfrastructureEncryption == 'Enabled') ? {
36+
requireInfrastructureEncryption: true
37+
} : {
38+
requireInfrastructureEncryption: false
39+
}
40+
3441
resource storage 'Microsoft.Storage/storageAccounts@2022-05-01' = {
3542
name: name
3643
location: location
@@ -49,6 +56,7 @@ resource storage 'Microsoft.Storage/storageAccounts@2022-05-01' = {
4956
networkAcls: networkAcls
5057
publicNetworkAccess: publicNetworkAccess
5158
supportsHttpsTrafficOnly: supportsHttpsTrafficOnly
59+
encryption: encryption
5260
}
5361

5462
resource blobServices 'blobServices' = if (!empty(containers)) {

infra/main.bicep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ param storageResourceGroupName string = '' // Set in main.parameters.json
3636
param storageResourceGroupLocation string = location
3737
param storageContainerName string = 'content'
3838
param storageSkuName string // Set in main.parameters.json
39+
param storageInfrastructureEncryption string // Set in main.parameters.json
3940

4041
param userStorageAccountName string = ''
4142
param userStorageContainerName string = 'user-content'
@@ -662,6 +663,7 @@ module storage 'core/storage/storage-account.bicep' = {
662663
publicAccess: 'None'
663664
}
664665
]
666+
storageInfrastructureEncryption: storageInfrastructureEncryption
665667
}
666668
}
667669

@@ -688,6 +690,7 @@ module userStorage 'core/storage/storage-account.bicep' = if (useUserUpload) {
688690
publicAccess: 'None'
689691
}
690692
]
693+
storageInfrastructureEncryption: storageInfrastructureEncryption
691694
}
692695
}
693696

infra/main.parameters.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@
8080
"storageSkuName": {
8181
"value": "${AZURE_STORAGE_SKU=Standard_LRS}"
8282
},
83+
"storageInfrastructureEncryption": {
84+
"value": "${AZURE_STORAGE_INFRA_ENCRYPTION}"
85+
},
8386
"appServicePlanName": {
8487
"value": "${AZURE_APP_SERVICE_PLAN}"
8588
},

0 commit comments

Comments
 (0)