Hi @ Asko Kauppinen
Since you've already found the fix for your requirement, I'm posting the solution for the community's benefit.
The issue you are facing is due to a typo caused by Bicep's string interpolation behavior.
privateDnsZoneName: 'privatelink.${environment().suffixes.sqlServerHostname}'
To resolve the issue, remove the dot (.
) inside the interpolation brackets. Bicep interprets it as property access rather than a string. Instead, access sqlServerHostname
within suffixes
using the environment()
function. For more details, refer to Deployment functions for Bicep.
privateDnsZoneName: 'privatelink${environment().suffixes.sqlServerHostname}'
Here is the updated code with the correct format for privateDnsZoneName
module sub_pe_dns_record './networking/module_privatednszone_record.bicep' = if (deployPepSql) {
name: 'deployPeZoneDnsRecord'
params: {
privateDnsZoneName: 'privatelink${environment().suffixes.sqlServerHostname}'
privateEndpointResourceName: sub_pe_azure_sql.outputs.privateEndpointName
privateDnsZoneSubscriptionId: networkingSubsId
privateDnsZoneResourceGroup: networkingRG
privateDnsZoneGroupName: 'default'
privateDnsZoneGroupConfigName: 'privatelink_database_windows_net'
}
}
Reference: Scope to subscription in bicep
I really appreciate your feedback. It’s valuable to us. Please click Accept Answer on this post to assist other community members facing similar issues in finding the correct solution.