Much has been written about Genghis Khan, the great ancient Mongol emperor. Probably much of it is just a legend. Maybe, who knows, he was just someone who really liked to ride horses.

The other children of the tribe would often argue over toys made from horse bones. But little Temüjin, who would one day be known as Genghis Khan, would say, “I want to ride a pony.”

Temüjin wanted to ride over the next hill and see what was on the other side. He would often end up quite far before his father sent his brothers to find him.

Temüjin became a kind, cheerful yet a bit shy young man. As usual, his fellow tribesmen would continue quarreling over just anything. But Temüjin would sit quietly and finally say, “What if we just forget this and ride over those mountains to see what’s on the other side?”

Unfortunately, Temüjin lived in a time when tourism was not highly appreciated. It would sometimes literally come to clashes with narrow-minded locals even if you only wanted to visit new places and politely ask, “Good evening, would you happen to have any hotel rooms available for me and my hundred thousand buddies, by chance?”

Azure Bicep

Riding a pony is probably a lot of fun. But configuring your infrastructure with Azure Bicep can also feel like fun as a pony ride. Especially after exhausting yourself fighting with a complex Terraform configuration file - and perhaps quarreling with your colleagues about what went wrong.

Luckily, times have changed and we can use Azure Bicep today to conquer all interesting regions without upsetting locals.

Since we have convinced ourselves at this point that Genghis Khan was just a misunderstood jolly fellow who only wanted to say “hello” to the world, we can now safely help him a little bit and define a “Hello World” app for all the regions he ever traveled.

So let’s go all the way back to the place where it all started. I define an Azure resource group for the endless Mongolian steppes:

The response tells us that the action was successful:

{
  "id": "/subscriptions/8b0e70e9-eedf-43c4-9394-916ca8f385fd/resourceGroups/rg-hello-world",
  "location": "eastasia",
  "managedBy": null,
  "name": "rg-hello-world",
  "properties": {
    "provisioningState": "Succeeded"
  },
  "tags": null,
  "type": "Microsoft.Resources/resourceGroups"
}

Now let’ write a Bicep file main.bicep and define all of Temüjin’s regions:

Then, define a loop that deploys Temüjin’s peace-loving “Hello World” app to each region:

Then implement the region-app file region-app.bicep and define the resource plan for each Temüjin’s region:

Remember to define the actual application for each region:

Finally, expand your empire to take over these regions with a single command:

That would be it. Next time, let’s examine how to encrypt Genghis Khan’s own book The Secret History of the Mongols in MongoDB Atlas on Azure.

Until then, happy tourism!