Azure / arm-deploy

ARM action to deploy an Azure Resource Manager (ARM) template to all the deployment scopes
MIT License
84 stars 39 forks source link

Why is the region parameter required for a management group deployment? #138

Closed plamber closed 8 months ago

plamber commented 1 year ago

Hello, thank you for creating this GitHub action. We are trying to deploy it to our management groups. I am not sure why I have to specify a region parameter when doing a deployment by the management group. We are performing the deployment using a bicep file.

When looking at the CLI I am using these parameters to perform a management group deployment. There is no region parameter in it.

az deployment mg create --name "myDeploymentName" --management-group-id $mgmId --template-file $templateFile --parameters $paramFile

Is my assumption right that the region parameter should be made optional and not required as implemented here? https://github.com/Azure/arm-deploy/blob/ba158a2e9c06f146e7c2c6d603b5c5a631800afa/src/deploy/scope_managementgroup.ts#L8

I saw that you are also requiring this information on a subscription level which to my understanding is also not required.

Thank you for your feedback, Patrick

vRune4 commented 8 months ago

I saw that you are also requiring this information on a subscription level which to my understanding is also not required.

This is indeed the case. Would love to know the 'why?' (and can my bicep files benefit from this? I'm currently feeding in a location parameter by hand which looks redundant now).

anthony-c-martin commented 8 months ago

This is explained here - deployments are a regional resource, so it's the Azure region used to store deployment data and execute the deployment. For "resource group scoped" deployments, we just inherit the resource group location; for deployments at other scope, there is no implicit location to inherit.

It can be useful to be intentional about the location if you have requirements about data residency.