TLDR; You can grab the script from here

Automating Multi-Region Azure Virtual WAN Deployment Like a Boss! ๐Ÿš€ Link to heading

Hey there, cloud enthusiasts! Today, I’m super excited to share a nifty bash script that takes the pain out of deploying Azure Virtual WAN across multiple regions. If you’ve ever had to set up a complex networking infrastructure spanning different Azure regions, you know it can be quite the adventure. Well, get ready to turn that adventure into a smooth sailing journey! โ›ต

What’s This Script All About? ๐Ÿค” Link to heading

This script is your trusty companion for automating the deployment of:

  • An Azure Virtual WAN
  • Multiple Virtual Hubs across different regions
  • Resource Groups to keep everything organized

The best part? It does all of this while keeping track of what it creates and gives you a nice summary at the end. No more wondering what happened during the deployment!

Prerequisites ๐ŸŽฏ Link to heading

Before you dive in, make sure you have:

  • Azure CLI installed and logged in
  • Appropriate permissions across your target subscription
  • A cup of your favorite beverage (because automation is best enjoyed with coffee/tea! โ˜•)

The Configuration Magic โœจ Link to heading

Let’s look at how to configure the script. Here’s what you’ll need to modify:

# Your core vWAN settings
VWAN_SUBSCRIPTION="your-subscription-id"
TAGS="owner=yourteam environment=prod costcenter=12345"
VWAN_RG="your-vwan-rg"
VWAN_NAME="your-vwan-name"

# Your hub configurations
declare -A VHUBS=(
    ["vhub-east-prod-1"]="sub-1:rg-east:eastus:10.1.0.0/24"
    ["vhub-west-prod-1"]="sub-1:rg-west:westus:10.2.0.0/24"
    ["vhub-central-prod-1"]="sub-1:rg-central:centralus:10.3.0.0/24"
)

Each hub configuration follows this pattern:

[hub-name]="subscription:resource-group:location:address-prefix"

What Makes This Script Awesome? ๐ŸŒŸ Link to heading

1. Smart Resource Creation Link to heading

The script is pretty smart about what it creates:

  • Checks if resources already exist before trying to create them
  • Creates resource groups only when needed
  • Verifies subscription access before starting (nobody likes failing halfway through!)

2. Detailed Progress Tracking Link to heading

โœ… Resource group my-rg created successfully
โœ… Virtual WAN my-vwan created successfully
โœ… Virtual Hub my-hub creation initiated successfully

It’s like having a play-by-play commentator for your deployment!

3. Beautiful? ;) Summary Report Link to heading

At the end of the deployment, you get a nice summary that looks something like this:

#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
#    Deployment Summary       #
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#

Created Resource Groups:
----------------------
Name | Location | Subscription
----------------------------------------
rg-east | eastus | sub-1
rg-west | westus | sub-1
...

How to Use the Script ๐ŸŽฎ Link to heading

  1. Download and Configure

    # Clone or download the script
    chmod +x azure-deploy-vwan.sh
    
  2. Modify the Variables

    • Update the subscription ID
    • Set your desired resource group names
    • Configure your hub locations and address spaces
  3. Run It!

    ./azure-deploy-vwan.sh
    
  4. Grab a Coffee and Watch the Magic Happen โ˜• The script will:

    • Verify your subscription
    • Create the necessary resource groups
    • Deploy the Virtual WAN
    • Create all your hubs
    • Show you a nice summary at the end

Pro Tips ๐Ÿ’ก Link to heading

  1. Testing First

    • Always test in a non-production environment first
    • Use the confirmation prompt to verify your settings before proceeding
  2. Address Space Planning

    • Plan your hub address spaces carefully to avoid overlaps
    • Keep some space for future expansion
  3. Subscription Access

    • Make sure your account has the necessary permissions
    • The script will check this for you, but it’s good to verify beforehand

Error Handling ๐Ÿ”ง Link to heading

The script has your back with comprehensive error handling:

  • Checks for the virtual-wan extension
  • Verifies subscription access
  • Validates resource creation
  • Continues with remaining hubs if one fails

Conclusion ๐ŸŽ‰ Link to heading

This script turns what could be hours of clicking through the Azure portal into a single command. It’s like having a Swiss Army knife for Virtual WAN deployment! Whether you’re setting up a new network infrastructure or expanding an existing one, this script has got you covered.

Remember, automation is not just about saving timeโ€”it’s about consistency, reliability, and being able to reproduce your infrastructure with confidence. And maybe having a bit more time for that coffee! โ˜•

Want to Contribute? ๐Ÿค Link to heading

Feel free to fork, modify, and improve this script! Some ideas for enhancements:

  • Add support for hub-to-hub routing
  • Include VPN gateway deployment
  • Add support for ExpressRoute gateways
  • Implement cleanup functionality

Happy automating! ๐Ÿš€


P.S. Don’t forget to star the repo if you found this useful! And remember, the best networks are the ones you don’t have to build manually! ๐Ÿ˜‰