0

I would like to confirm that there is no way to dynamically get the value of management group id during arm template deployment scoped to the MG level.

I mean something similar to the ARM template function subscription() which returns an object with an Id property that can be used in the template.

I know there is no managementGroup() function, but I am wondering if there is any other trick to avoid having to add a parameter to the template.

Kamil Wiecek
  • 213
  • 1
  • 5
  • perhaps, you would consider making this question a little better, by including code. you mention, subscription and managementGroup. Obviously, I can look up those functions on my own, but you should illustrate where and how you are using. – Jay Oct 18 '20 at 15:47

3 Answers3

1

This isn't possible today but it's on the backlog... If you want to share your use case for it I'll add that as well to help prioritize.

bmoore-msft
  • 8,376
  • 20
  • 22
0

There is no function like subscription() to get the management Id directly. But you can use the function tenantResourceId() to get the management group Id like this:

tenantResourceId('Microsoft.Management/managementGroups', 'groupName')
Charles Xu
  • 29,862
  • 2
  • 22
  • 39
0

To fetch a azurepolicy id that was existing at management group level

krupakar
  • 1
  • 2
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 05 '22 at 11:29