Hello David Vanden Bussche,
You will need to use the Microsoft.Network/privateDnsZones
resource and include inside it the virtual network link to your vnet that will resolve the name.
Take on consideration the private dns zone name from the list of documentation:
https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-dns
Example: privatelink.azurewebsites.net
resource privateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' = {
//Include the dns zone name
name: privateDnsZoneName
location: 'global'
// You require this section to link the Private Dns Zone to vnet
resource privateDnsZoneVirtualNetworkLink 'virtualNetworkLinks@2020-06-01' = {
name: vnetLinkName
location: 'global'
properties: {
// This is a bool value
registrationEnabled: autoregistrationEnabled
virtualNetwork: {
// Use the your vnet Id
id: virtualNetworkId
}
}
}
}
// Create PrivateEndpointDnsZoneGroup service
resource privateEndpointDsnZoneGroupResource 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2020-07-01' = {
name: '<YOUR PRIVATE ENDPOINT NAME>/default'
properties: {
privateDnsZoneConfigs: [
{
name: privateDnsZoneName
properties: {
privateDnsZoneId: privateDnsZone.Id
}
}
]
}
dependsOn: [
<Your private Endpoint resource or module>
]
}
Here additional documentation:
https://learn.microsoft.com/en-us/azure/templates/microsoft.network/privatednszones?pivots=deployment-language-bicep https://learn.microsoft.com/en-us/azure/templates/microsoft.network/privatednszones/virtualnetworklinks?pivots=deployment-language-bicep
Note:
Your private endpoint bicep code need to consider the privateLinkServiceId
Let me know if you need additional help.
Luis.