Hello Ammar Asim,
While integrating a logic app with private endpoint in a virtual network, it is needed a create a DNS zone configuration attached to enable logic app to route through that specific created private endpoint.
To do that in bicep, add below code in your main bicep configuration. Below code contains a creation of DNS zone and also linking created DNS to a virtual network ( MSDoc ) .
param logicApp string = 'vnetlogicapp'
param vnetName string = 'windowsnew-vnet'
param logicAppSubnet string = 'vnetsub'
param dnsZoneName string = 'mynewdomain.org'
resource logic 'Microsoft.Web/sites@2024-04-01' existing = {
name: logicApp
}
resource existvnet 'Microsoft.Network/virtualNetworks@2024-05-01' existing = {
name: vnetName
}
resource subnet 'Microsoft.Network/virtualNetworks/subnets@2024-05-01' existing = {
parent: existvnet
name: logicAppSubnet
}
resource logicAppVnetIntegration 'Microsoft.Web/sites/networkConfig@2024-04-01' = {
parent: logic
name: 'virtualNetwork'
properties: {
subnetResourceId: subnet.id
swiftSupported: true
}
}
resource dnsZone 'Microsoft.Network/privateDnsZones@2024-06-01' = {
name: 'mydnsnew.com'
location: 'global'
}
resource vnetLink 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2020-06-01' = {
parent: dnsZone
location: 'global'
name: '${vnetName}-dnslink'
properties: {
registrationEnabled: false
virtualNetwork: {
id: existvnet.id
}
}
}
Deployment succeeded:
You can also refer this Blog by Fabrizio for more relevant information on integration.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.