I am working on an ARM template where I can conditionally control the association of one of the databases in the fail-over group. Here is my sample resource template
{
"condition": "[variables('Resources').IsFailover]",
"name": "[variables('SqlServer').FailoverGroup.Name]",
"type": "failoverGroups",
"apiVersion": "2015-05-01-preview",
"location": "[variables('SqlServer').Servers.Primary.ResourceLocation]",
"tags":
{
"displayName": "Failover Group"
},
"properties":
{
"partnerServers":
[
{
...
}
],
"readWriteEndpoint":
{
....
},
"readOnlyEndpoint":
{
"failoverPolicy": "Disabled"
},
"databases":
[
"[variables('SqlServer').Databases.DBOne.ResourceId]",
"[variables('SqlServer').Databases.DBTwo.ResourceId]",
"[variables('SqlServer').Databases.DBThree.ResourceId]"
]
},
"dependsOn":
[
"[variables('SqlServer').Servers.Primary.ResourceId]",
"[variables('SqlServer').Servers.Secondary.ResourceId]",
"[variables('SqlServer').Databases.DBOne.ResourceId]",
"[variables('SqlServer').Databases.DBTwo.ResourceId]",
"[variables('SqlServer').Databases.DBThree.ResourceId]"
]
}
I want to achieve something like associating the DBTwo(database) with the fail-over group only if a flag(input parameter) is true and not associating if the flag is false all from the same group.
Is there a way to do this from ARM ?
Thanks in advance for any advice and suggestions.