How to setup Update Manager dynamic scope via Azure PowerShell?

sac16 50 Reputation points

I am trying to setup dynamic scopes (multiple subscriptions filtering on a specific tag value) to a new maintenance configuration in Azure Update Manager. It can be done through the portal (see screenshot), but I need to be able to do it via Azure PowerShell script because these need to be created on a mass scale.

The New-AzConfigurationAssignment cmdlet is supposed to be able to setup dynamic scopes, but it doesn't seem to be able to do this by subscriptions. Is this possible or is there another cmdlet used to do this?

User's image

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
6,318 questions
Azure Update Manager
Azure Update Manager
An Azure service to centrally manages updates and compliance at scale.
129 questions
0 comments No comments
{count} votes

Accepted answer
  1. kobulloc-MSFT 18,971 Reputation points Microsoft Employee

    Hello, @sac16 !

    How do I enable Dynamic Scoping across multiple subscriptions with a PowerShell script?

    Dynamic Scoping allows you to group machines based on criteria such as subscription, resource group, location, resource type, OS Type, and Tags. In the documentation for New-AzConfigurationAssignment, I see a -Filter for everything mentioned above except subscriptions (with the only mention of subscriptions being under -DefaultProfile).

    If we look at the Azure CLI equivalent, az maintenance assignment, create-or-update-subscription has a parameter for --subscription. I would recommend using the Azure CLI command in this instance for your PowerShell script.

    If you need another solution, please let us know in the comments and we would be happy to help.

    I hope this has been helpful! Your feedback is important so please take a moment to accept answers.

    If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!

    User's image

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful