Loading...

Build an Azure Logic App to send an alert when the provisioning state changes for your Azure VWAN

Build an Azure Logic App to send an alert when the provisioning state changes for your Azure VWAN

Prerequisites:

Before diving into the implementation, make sure you have the following in place:

Step 1:

Begin by navigating to the Azure portal and creating a new Logic App. Select a resource group, provide a unique name, choose the appropriate region, select the plan (Standard or Consumption), and leave the Zone redundancy to ‘disabled’. You should have something like this:

 

Mo_Elaryan_0-1706225225228.png

 

Step 2:

Set up a System-Assigned Managed Identity to allow the logic app to query the provisioning status for the Virtual WAN.

Step 3:

Configure and run your Logic App by navigating to the code view of your Logic App within the Azure Portal and paste the following:

{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"HTTP_2": {
"inputs": {
"authentication": {
"type": "ManagedServiceIdentity"
},
"body": {
"query": "resources | where type == 'microsoft.network/virtualwans' | extend provisioningState = tostring(properties.provisioningState) | project name,provisioningState"
},
"headers": {
"Content-Type": "application/json"
},
"method": "POST",
"queries": {
"api-version": "2021-03-01"
},
"uri": "https://management.azure.com/providers/Microsoft.ResourceGraph/resources"
},
"runAfter": {},
"type": "Http"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {
"Recurrence": {
"recurrence": {
"frequency": "Minute",
"interval": 1
},
"type": "Recurrence"
}
}
},
"parameters": {}
}

Note: If you would like to monitor the provisioning state of your virtual hubs instead, you can change the query line above to be the following:

"query": "resources | where type == 'microsoft.network/virtualhubs' | extend provisioningState = tostring(properties.provisioningState) | project name,provisioningState"

Step 4:

After you have run your Logic App, navigate to the run history, click on the recent run, click on the “HTTP” step, scroll down to copy the “body” section and paste it in a Notepad (We will need it in the next step to Parse the output of the HTTP response). See image below:

 

Mo_Elaryan_1-1706225225315.png

 

Step 5:

Navigate to the Logic app designer, click on new step and search for “Parse JSON” (You should be able to see it as the first option under Actions). Click on Parse JSON. In the Content field, select “Body” and in the Schema field, click on “Use Sample Payload to generate Schema” and paste the body you copied from the previous step in the box as shown below:

 

Mo_Elaryan_2-1706225225101.png

 

Step 6:

Click on new step and search for “Condition” under the Built-in connectors. Under Condition, select “Provisioning State” is not equal to “Succeeded”. Under “True”, search for Send an email (V2), fill out the necessary fields for example: Body, Subject, To, etc. as shown below then hit save.

 

Mo_Elaryan_3-1706225225076.png

 

At the end, your logic app designer should look similar to this:

 

Mo_Elaryan_4-1706225225114.png

 

Step 7:

Let’s test the Azure Logic App and simulate a “Failed” state for your Azure Virtual WAN.

Note: You may need to repeat steps 3 & 4 again but this time you will enable the branch-to-branch configuration and hit save.

5. You should be able to see the status changes to “Failed” for your Azure Virtual WAN and an alert has been sent to the email you specified in the Logic App.

Note: This is only for testing purposes, please use caution while testing this in your production environment.

6. If you would like to bring your Azure Virtual WAN to the “Succeeded” provisioning state, please run the following PowerShell command after making the necessary changes to the name, and the resource group name:

Get-AzVirtualWan -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Update-AzVirtualWan

Conclusion:

Using the Azure Logic App to notify you when a provisioning state changes in your Azure Virtual WAN can help you to proactively address potential issues and minimize downtime. This automated approach enhances your operational efficiency and allows you to monitor your Azure Virtual WAN estate.

Published on:

Learn more
Azure Networking Blog articles
Azure Networking Blog articles

Azure Networking Blog articles

Share post:

Related posts

Routing options for VMs from Private Subnets

Virtual Machines deployed in Azure used to have Default Outbound Internet Access. Until today, this allows virtual machines to connect to...

1 year ago

Secure, High-Performance Networking for Data-Intensive Kubernetes Workloads

The intersection of Generative AI and cloud computing has been transforming how organizations build and manage their infrastructure. The deman...

1 year ago

Network Connectivity for RISE with SAP S/4HANA Cloud Private Edition on Azure

In this article, we will explore different ways to connect to RISE with SAP S/4HANA Cloud Private Edition deployment on Azure, guiding yo...

1 year ago

Optimize Azure Landing Zone with Azure Virtual Network Manager IP Address Management

Optimize Azure Landing Zone with Azure Virtual Network Manager IP Address Management What you will learn from this blog This blog explores how...

1 year ago

ExpressRoute Metro is now generally available!!

We are excited to announce general availability of ExpressRoute Metro, a new private connectivity architecture designed to enhance network res...

1 year ago

ExpressRoute guided configuration of multi-site circuits and connections is generally available

ExpressRoute guided experience for configuring multi-site resiliency circuits and connections is generally available in Azure public cloud. Th...

1 year ago

Manage NSG association on Subnets via Azure Policy

  In this blog article, we will cover how to deny the creation of a subnet in a Virtual Network if the subnet does not have a Network Sec...

1 year ago

Effortless Private Endpoint Management in Azure Landing Zones: A Streamlined and Compliant Approach

1. Challenge In Azure Landing Zones, the network infrastructure, including components like VNET Gateways and ExpressRoute circuits, is part of...

1 year ago

Unlocking Secure VM Connectivity with Azure Bastion

In today’s digital landscape, where security breaches are an unfortunate reality, safeguarding sensitive data and infrastructure has become mo...

1 year ago

Use cases of Advanced Network Observability for your Azure Kubernetes Service clusters

Introduction  Advanced Network Observability is the inaugural feature of the Advanced Container Networking Services (ACNS) suite bringing...

2 years ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.