Open francotiveron opened 3 years ago
Currently, you need to do that. I think I mentioned in another issue that we intend to support this directly through the az arguments at deployment time, but currently it's not available in the API.
In the meantime, you could use Farmer to simply generate the ARM template and then call az however you want.
One solution I have found to this is to execute the az set
inside the farmer script before the call to Deploy.execute
. Something like this should work:
result {
do! Farmer.Deploy.Az.az $"account set -s {subscriptionId}"
return deployment |> Deploy.execute resourceGroupName Deploy.NoParameters
}
We do something similar (but wrapped up with a load more logic making it hard to copy-paste here) for our deployments.
in 'deployment |> Deploy.execute resourceGroupName Deploy.NoParameters' we specify the resource group Is it possible to set the subscription using Farmer without invoking 'az set --subscription ' externally