Networking
DNS Private Resolver
Connects DNS resolution between Azure virtual networks and other networks through resolver endpoints.
Naming rules
- Abbreviation
- Length
- 1-80
- Allowed characters
- Alphanumerics, underscores, and hyphens. Start and end with alphanumeric.
- Uniqueness scope
- resource group
Azure Verified Modules naming utility v0.3.0 · AVM naming key dns_resolver
Code examples
Adapt the examples to your environment and supply referenced resources and variables.
Terraform
Terraform documentationhcl
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
version = "~> 2.0"
}
}
}
variable "location" {
type = string
}
variable "name" {
type = string
}
variable "virtualNetworkId" {
type = string
}
variable "parent_id" {
description = "Full Azure resource ID of the parent resource or resource group."
type = string
}
resource "azapi_resource" "example" {
type = "Microsoft.Network/dnsResolvers@2025-05-01"
name = var.name
parent_id = var.parent_id
location = var.location
body = {
properties = {
virtualNetwork = {
id = var.virtualNetworkId
}
}
}
}
Bicep
Bicep documentationbicep
param location string
param name string
param virtualNetworkId string
resource example 'Microsoft.Network/dnsResolvers@2025-05-01' = {
name: name
location: location
properties: {
virtualNetwork: {
id: virtualNetworkId
}
}
}
ARM template
ARM template documentationjson
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string"
},
"name": {
"type": "string"
},
"virtualNetworkId": {
"type": "string"
}
},
"resources": [
{
"type": "Microsoft.Network/dnsResolvers",
"apiVersion": "2025-05-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"properties": {
"virtualNetwork": {
"id": "[parameters('virtualNetworkId')]"
}
}
}
]
}