Data disks creation data output #12794
GBCSIM1
started this conversation in
Authoring Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
Based upon this article: https://www.bluefini.com/azure-bicep-how-to-set-os-disks-networking-to-allowprivate-private-endpoint-through-disk-access/
i have managed to set OS disk public access to be DenyAll.
I am looking to try the same with data disks.
I have a module: dataquery
@description('Required. Name of the Virtual Machine.')
@maxlength(15)
param vmName string
@description('Optional. Specifies the data disks. For security reasons, it is recommended to specify DiskEncryptionSet into the dataDisk object. Restrictions: DiskEncryptionSet cannot be enabled if Azure Disk Encryption (guest-VM encryption using bitlocker/DM-Crypt) is enabled on your VMs.')
param dataDisks array = []
resource rdataDisk 'Microsoft.Compute/disks@2023-04-02' existing = [for (dataDisk, index) in dataDisks: {
name: '${vmName}-disk-data-${padLeft((index + 1), 2, '0')}'
}
]
output DiskCreationData1 array = [for (dataDisk, i) in dataDisks: {
diskcreation: rdataDisk[i].properties.creationData
Next is my main code:
module dataDiskQuery '.bicep/queryDataDisk.bicep' = [for (dataDisk, index) in dataDisks: {
name: '${index}'
params: {
vmName: vm.name
}
}
]
resource rDataDisk 'Microsoft.Compute/disks@2023-04-02' = [for (dataDisk, index) in dataDisks: {
name: '${vmName}-disk-data-${padLeft((index + 1), 2, '0')}'
location: location
sku: {
name: 'Standard_LRS'
}
zones: []
properties: {
creationData: dataDiskQuery[index].outputs.DiskCreationData1
networkAccessPolicy: 'DenyAll'
publicNetworkAccess: 'Disabled'
}
}
]
the error i am getting on Bold Line: creationData: dataDiskQuery[index].outputs.DiskCreationData1
The property "creationData" expected a value of type "CreationData" but the provided value is of type "array". If this is an inaccuracy in the documentation, please report it to the Bicep
How do i export the creation data from the output from the module file with an array.
thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions