azure 如何编写不应硬编码在Bicep文件中的环境URL?

flseospp  于 2023-01-14  发布在  其他
关注(0)|答案(1)|浏览(94)

如何编写不应硬编码在Bicep文件中的环境URL?
在本例中,为storageProfile URI和id。
非常感谢!
我的代码在二头肌:

resource galleries_nicoGallery_name_nicoImageDef_-_-----_---- 'Microsoft.Compute/galleries/images/versions@2022-03-03' = {
  parent: galleries_nicoGallery_name_nicoImageDef
  name: '-.-----.----'
  location: location
  tags: {
    baseosimg: 'ubuntu1804'
    correlationId: '00000000-0000-0000-0000-000000000000'
    source: 'azureVmImageBuilder'
  }
  properties: {
    publishingProfile: {
      targetRegions: [
        {
          name: 'France Central'
          regionalReplicaCount: 1
          storageAccountType: 'Standard_LRS'
        }
        {
          name: 'West Europe'
          regionalReplicaCount: 1
          storageAccountType: 'Standard_LRS'
        }
      ]
      replicaCount: 1
      excludeFromLatest: false
      storageAccountType: 'Standard_LRS'
    }
    storageProfile: {
      osDiskImage: {
        hostCaching: 'ReadWrite'
        source: {
          uri: 'https://000000000000000000000000.blob.core.windows.net/vhds/00000000-0000-0000-0000-000000000000.vhd'
          id: storageAccounts_000000000000000000000000_externalid
        }
      }
    }
    safetyProfile: {
      allowDeletionOfReplicatedLocations: true
    }
  }
}

我尝试硬编码,但这不是一个好的做法。

92vpleto

92vpleto1#

您可以尝试使用参数和变量文件来满足此类需求,请浏览here上的步骤。

相关问题