In this Azure PowerShell article, we will discuss the syntax and usage of the Add-AzRouteConfig PowerShell cmdlet with examples of how to use the Add-AzRouteConfig PowerShell command.
Add-AzRouteConfig
This is an excellent PowerShell command to add a route to a specified Azure route table.
Syntax
Below is the syntax of the Add-AzRouteConfig PowerShell command.
Now, let’s discuss an example of the usage of this command.
Example-1:
I ran the below PowerShell script to add a route named “RouteTI” to the “TsinfoRT” route table.
$myRouteTable = Get-AzRouteTable -ResourceGroupName "DEMORG1" -Name "TsinfoRT"
Add-AzRouteConfig -Name "RouteTI" -AddressPrefix 10.3.0.0/16 -NextHopType "VnetLocal" -RouteTable $myRouteTable
After executing the above script, I got the below output
Name : TsinfoRT
ResourceGroupName : DEMORG1
Location : northeurope
Id : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups
/DEMORG1/providers/Microsoft.Network/routeTables/TsinfoRT
Etag : W/"53bc26b8-c27b-4f38-bffe-2f9a6944914a"
ProvisioningState : Succeeded
Tags :
Routes : [
{
"Name": "RouteTI",
"AddressPrefix": "10.3.0.0/16",
"NextHopType": "VnetLocal"
}
]
Subnets : []
You can see the same output in the below screenshot.

Add-AzRouteConfig – Video Tutorial
Related articles
Conclusion
In this Azure PowerShell article, we discussed the syntax and usage of the Add-AzRouteConfig PowerShell command. Thanks for reading this article !!!