Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed subnet for storage private endpoints #979

Merged
merged 5 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bicep/mlz.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -664,13 +664,13 @@ module storage 'modules/storage.bicep' = {
params: {
blobsPrivateDnsZoneResourceId: networking.outputs.privateDnsZoneResourceIds.blob
deployIdentity: deployIdentity
deploymentNameSuffix: deploymentNameSuffix
keyVaultUri: customerManagedKeys.outputs.keyVaultUri
location: location
logStorageSkuName: logStorageSkuName
networks: logic.outputs.networks
serviceToken: namingConvention.outputs.tokens.service
storageEncryptionKeyName: customerManagedKeys.outputs.storageKeyName
subnetResourceId: networking.outputs.hubSubnetResourceId
tablesPrivateDnsZoneResourceId: networking.outputs.privateDnsZoneResourceIds.table
tags: calculatedTags
userAssignedIdentityResourceId: customerManagedKeys.outputs.userAssignedIdentityResourceId
Expand Down
20 changes: 10 additions & 10 deletions src/bicep/mlz.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "1355067641298547562"
"templateHash": "8517140824352958187"
}
},
"parameters": {
Expand Down Expand Up @@ -6953,6 +6953,9 @@
"deployIdentity": {
"value": "[parameters('deployIdentity')]"
},
"deploymentNameSuffix": {
"value": "[parameters('deploymentNameSuffix')]"
},
"keyVaultUri": {
"value": "[reference(subscriptionResourceId('Microsoft.Resources/deployments', format('deploy-cmk-hub-{0}', parameters('deploymentNameSuffix'))), '2022-09-01').outputs.keyVaultUri.value]"
},
Expand All @@ -6971,9 +6974,6 @@
"storageEncryptionKeyName": {
"value": "[reference(subscriptionResourceId('Microsoft.Resources/deployments', format('deploy-cmk-hub-{0}', parameters('deploymentNameSuffix'))), '2022-09-01').outputs.storageKeyName.value]"
},
"subnetResourceId": {
"value": "[reference(subscriptionResourceId('Microsoft.Resources/deployments', format('deploy-networking-{0}', parameters('deploymentNameSuffix'))), '2022-09-01').outputs.hubSubnetResourceId.value]"
},
"tablesPrivateDnsZoneResourceId": {
"value": "[reference(subscriptionResourceId('Microsoft.Resources/deployments', format('deploy-networking-{0}', parameters('deploymentNameSuffix'))), '2022-09-01').outputs.privateDnsZoneResourceIds.value.table]"
},
Expand All @@ -6991,7 +6991,7 @@
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "15215887488033870389"
"templateHash": "7112897434917924784"
}
},
"parameters": {
Expand All @@ -7001,6 +7001,9 @@
"deployIdentity": {
"type": "bool"
},
"deploymentNameSuffix": {
"type": "string"
},
"keyVaultUri": {
"type": "string"
},
Expand All @@ -7019,9 +7022,6 @@
"storageEncryptionKeyName": {
"type": "string"
},
"subnetResourceId": {
"type": "string"
},
"tablesPrivateDnsZoneResourceId": {
"type": "string"
},
Expand All @@ -7040,7 +7040,7 @@
},
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "storage",
"name": "[format('deploy-storage-account-{0}-{1}', parameters('networks')[copyIndex()].name, parameters('deploymentNameSuffix'))]",
"subscriptionId": "[parameters('networks')[copyIndex()].subscriptionId]",
"resourceGroup": "[parameters('networks')[copyIndex()].resourceGroupName]",
"properties": {
Expand Down Expand Up @@ -7077,7 +7077,7 @@
"value": "[parameters('storageEncryptionKeyName')]"
},
"subnetResourceId": {
"value": "[parameters('subnetResourceId')]"
"value": "[resourceId(parameters('networks')[copyIndex()].subscriptionId, parameters('networks')[copyIndex()].resourceGroupName, 'Microsoft.Network/virtualNetworks/subnets', parameters('networks')[copyIndex()].virtualNetworkName, parameters('networks')[copyIndex()].subnetName)]"
},
"tablesPrivateDnsZoneResourceId": {
"value": "[parameters('tablesPrivateDnsZoneResourceId')]"
Expand Down
6 changes: 3 additions & 3 deletions src/bicep/modules/storage.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ targetScope = 'subscription'

param blobsPrivateDnsZoneResourceId string
param deployIdentity bool
param deploymentNameSuffix string
param keyVaultUri string
param logStorageSkuName string
param location string
param networks array
param serviceToken string
param storageEncryptionKeyName string
param subnetResourceId string
param tablesPrivateDnsZoneResourceId string
param tags object
param userAssignedIdentityResourceId string

module storageAccount 'storage-account.bicep' = [for (network, i) in networks: {
name: 'storage'
name: 'deploy-storage-account-${network.name}-${deploymentNameSuffix}'
scope: resourceGroup(network.subscriptionId, network.resourceGroupName)
params: {
blobsPrivateDnsZoneResourceId: blobsPrivateDnsZoneResourceId
Expand All @@ -30,7 +30,7 @@ module storageAccount 'storage-account.bicep' = [for (network, i) in networks: {
storageAccountNetworkInterfaceNamePrefix: network.logStorageAccountNetworkInterfaceNamePrefix
storageAccountPrivateEndpointNamePrefix: network.logStorageAccountPrivateEndpointNamePrefix
storageEncryptionKeyName: storageEncryptionKeyName
subnetResourceId: subnetResourceId
subnetResourceId: resourceId(network.subscriptionId, network.resourceGroupName, 'Microsoft.Network/virtualNetworks/subnets', network.virtualNetworkName, network.subnetName)
tablesPrivateDnsZoneResourceId: tablesPrivateDnsZoneResourceId
tags: tags
userAssignedIdentityResourceId: userAssignedIdentityResourceId
Expand Down