Skip to content

Commit 466bee7

Browse files
fix: update container registry module to reference VNet and DNS zone …
2 parents 7ffec45 + 8a591b4 commit 466bee7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

infra/main.bicep

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ module containerRegistry './modules/containerRegistry.bicep' = {
245245
networkRuleBypassOptions: 'AzureServices'
246246
// WAF: host the registry private endpoint in the backend subnet and link it
247247
// to the privatelink.azurecr.io DNS zone so image pulls resolve privately.
248-
// Use deterministic resource IDs here so non-private deployments do not
249-
// pick up unconditional dependencies on the conditional network modules.
250-
privateEndpointSubnetResourceId: enablePrivateNetworking ? resourceId(resourceGroup().name, 'Microsoft.Network/virtualNetworks/subnets', 'vnet-${solutionSuffix}', 'backend') : ''
251-
privateDnsZoneResourceId: enablePrivateNetworking ? resourceId(resourceGroup().name, 'Microsoft.Network/privateDnsZones', 'privatelink.azurecr.io') : ''
248+
// Reference the VNet and DNS zone outputs directly to avoid case-sensitivity
249+
// issues with manually constructed resource IDs.
250+
privateEndpointSubnetResourceId: enablePrivateNetworking ? virtualNetwork!.outputs.backendSubnetResourceId : ''
251+
privateDnsZoneResourceId: enablePrivateNetworking ? avmPrivateDnsZones[dnsZoneIndex.containerRegistry]!.outputs.resourceId : ''
252252
// Application managed identity gets AcrPull for identity-based image pulls.
253253
acrPullPrincipalIds: [
254254
appIdentity.outputs.principalId

0 commit comments

Comments
 (0)