How to deploy a routing configuration for Azure Virtual Network Manager using Terraform.

AndrewLaing-8619 20 Reputation points
2025-04-17T08:55:45.8033333+00:00

Terraform's azurerm provider does not currently support Azure Network Manager UDR Management
(Although an issue has been raised for it here)

Using the azapi provider I can create a routing configuration using the code below with attached rule collections and rules (not shown) on Azure but when I look at the configuration on the Azure Portal its deployment status is shown as "Not deployed".

I have looked in the API documentation for the routing configuration but can find no way of fixing this except pressing the deploy button on the Portal.

Can anybody provide me with some guidance. Thank you :)

resource "azapi_resource" "routing_configuration" {
type = "Microsoft.Network/networkManagers/routingConfigurations@2024-05-01"
parent_id = var.manager_id
name = var.config_name
body = {
properties = {
description = "AVNM Routing Configuration"
}
}
}

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,762 questions
{count} votes

Accepted answer
  1. Sindhuja Dasari 1,520 Reputation points Microsoft External Staff Moderator
    2025-04-17T12:28:55.2733333+00:00

    Hello Andrew Laing

    Yes, the azapi provider assists in creating routing configurations in the Network Manager, even if it's not supported in the Terraform azurerm provider.
    Refer this document:

    https://learn.microsoft.com/en-us/azure/templates/microsoft.network/networkmanagers/routingconfigurations?pivots=deployment-language-terraform

    We need to complete one last step before the routing configuration becomes operational, which is deploying the configuration. There isn't a good way to do this with the Terraform azapi provider.

    Our choices are limited to:

    Once the deployment is complete:

    In the Azure Portal, the routing config should change from "Not Deployed " to "Deployed"


    If above is unclear and/or you are unsure about something add a comment below.Should there be any follow-up questions or concerns, please let us know and we shall try to address them.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.