Created
November 14, 2021 15:02
-
-
Save ninjarobot/0e28beb5c4f98510c58c62170c28ed76 to your computer and use it in GitHub Desktop.
Example for deploying to multiple locations with Farmer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "nuget:Farmer" | |
open Farmer | |
open Farmer.Builders | |
// Sometimes resources aren't available in certain regions and another location needs to be chosen. | |
// The best way to do this is to create a nested resource group deployment to the _same_ resource | |
// group, and choose a different location for that nested deployment | |
arm { | |
location Location.WestEurope | |
add_resources [ | |
storageAccount { | |
name "mywesteuropestorage1234" | |
} | |
resourceGroup { // Creates a nested deployment | |
name "[resourceGroup().name]" // but it will be to the same resource group | |
deployment_name "deploying-with-westeurope-resources" | |
location Location.NorthEurope // Specify the different location for these resources | |
add_resources [ // Add resources as normal. | |
storageAccount { | |
name "mynortheuropestorage9876" | |
} | |
] | |
} | |
] | |
} |> Writer.quickWrite "multiple-locations" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Resulting JSON