Register all required resource providers with a PowerShell script – Wim Matthyssen


This blog post will show you how to use an Azure PowerShell script to register all required Azure Update Manager resource providers in a specific subscription.

If you’re already familiar with Azure and Microsoft’s hybrid compute solutions, you’ve probably heard of Azure Update Manager (AUM). This powerful cloud-based tool helps you manage and automate operating system updates, not just for your Azure virtual machines but also for your on-premises servers.

To start using AUM in your own environment, there are a few things you should know about and have available in your Azure subscription. One of these is that AUM requires specific resource providers to be registered so you can use the service in that subscription.

In most existing subscriptions, some resource providers will likely already be registered. For example, the Microsoft.Compute provider if you have already deployed Azure virtual machines, or the Microsoft.HybridCompute provider if you have onboarded on-premises servers to Azure Arc.

However, if you are working with a brand-new subscription, these resource providers will not be registered by default. The same goes for the required Microsoft.Maintenance provider, as shown in the screenshots below.

💡 This also causes the error that occurs when updating or creating dynamic scopes for resources deployed in a newly added Azure subscription, which I wrote about some time ago. You can read more about that here.

To automate the deployment of the required AUM resource providers, you can follow the instructions in this blog post and use the accompanying Azure PowerShell script.

Table of Contents

Table of Contents

Prerequisites

  • A new or existing Azure subscription.
  • An Azure Administrator account with the required RBAC roles to run the script.
  • At least version 10.4.1 of the Azure Az PowerShell module is required.

Executing actions and utilizing the Azure PowerShell script

To automate the deployment of the required AUM resource providers in a specified Azure subscription, I’ve created the following Azure PowerShell script, which does the following:

  • Remove the breaking change warning messages.
  • Register the Microsoft.Compute resource provider if not registered.
  • Register the Microsoft.HybridCompute resource provider if not registered.
  • Register the Microsoft.Maintenance resource provider if not registered.

To use the script, start by either copying and saving it as “Register-AUM-resource-providers-in-a-specified-subscription.ps1” or downloading it directly from GitHub. Then, run the script using Windows Terminal, Visual Studio Code, or Windows PowerShell. Alternatively, you can execute it directly from Cloud Shell.

Azure PowerShell script

If you are not using Cloud Shell to run the script, remember to sign in with the Connect-AzAccount cmdlet to link your Azure account. If you have multiple Azure tenants, ensure you select the correct one before running the script by using the Set-AzContext -TenantId cmdlet.

You can then run the script with the required parameters.

.\Register-AUM-resource-providers-in-a-specified-subscription -SubscriptionName <"your Azure subscription name here"> 
<#
.SYNOPSIS

A script to register the necessary Azure Update Manager (AUM) resource providers in a specified Azure subscription.

.DESCRIPTION

A script to register the necessary Azure Update Manager (AUM) resource providers in a specified Azure subscription.
The script will do all of the following:

Register the Microsoft.Compute resource provider if not registered.
Register the Microsoft.HybridCompute resource provider if not registered.
Register the Microsoft.Maintenance resource provider if not registered.

.NOTES

Filename:       Register-AUM-resource-providers-in-a-specified-subscription.ps1
Created:        08/07/2025
Last modified:  08/07/2025
Author:         Wim Matthyssen
Version:        1.0
PowerShell:     Azure PowerShell and Azure Cloud Shell
Requires:       PowerShell Az (v10.4.1)
Action:         Change variables were needed to fit your needs.
Disclaimer:     This script is provided "As Is" with no warranties.

.EXAMPLE

Connect-AzAccount
Get-AzTenant (if not using the default tenant)
Set-AzContext -tenantID "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" (if not using the default tenant)
.\Register-AUM-resource-providers-in-a-specified-subscription -SubscriptionName <"your Azure subscription name here"> 

-> .\Register-AUM-resource-providers-in-a-specified-subscription -SubscriptionName sub-prd-myh-arc-infra-03

.LINK

Azure Update Manager: Register all required resource providers with a PowerShell script
#> ## --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ## Parameters param( # $subscriptionName -> Name of the Azure Subscription [parameter(Mandatory =$true)][ValidateNotNullOrEmpty()] [string] $subscriptionName ) ## --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ## Variables $providerNameSpaceCompute = "Microsoft.Compute" $providerNameSpaceHybridCompute = "Microsoft.HybridCompute" $providerNameSpaceMaintenance = "Microsoft.Maintenance" Set-PSBreakpoint -Variable currenttime -Mode Read -Action {$global:currenttime = Get-Date -Format "dddd MM/dd/yyyy HH:mm"} | Out-Null $foregroundColor1 = "Green" $foregroundColor2 = "Yellow" $writeEmptyLine = "`n" $writeSeperatorSpaces = " - " ## --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ## Remove the breaking change warning messages Set-Item -Path Env:\SuppressAzurePowerShellBreakingChangeWarnings -Value $true | Out-Null Update-AzConfig -DisplayBreakingChangeWarning $false | Out-Null $warningPreference = "SilentlyContinue" ## --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ## Write script started Write-Host ($writeEmptyLine + "# Script started. Without errors, it can take up to 2 minutes to complete" + $writeSeperatorSpaces + $currentTime)` -foregroundcolor $foregroundColor1 $writeEmptyLine ## --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ## Change the current context to the specified subscription $subName = Get-AzSubscription | Where-Object {$_.Name -like $subscriptionName} Set-AzContext -SubscriptionId $subName.SubscriptionId | Out-Null Write-Host ($writeEmptyLine + "# Specified subscription in current tenant selected" + $writeSeperatorSpaces + $currentTime)` -foregroundcolor $foregroundColor2 $writeEmptyLine ## --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ## Register the required Azure resource providers in the current subscription context, if not yet registered # Register Microsoft.Compute resource provider Register-AzResourceProvider -ProviderNamespace $providerNameSpaceCompute | Out-Null # Register Microsoft.HybridCompute resource provider Register-AzResourceProvider -ProviderNamespace $providerNameSpaceHybridCompute | Out-Null # Register Microsoft.Maintenance resource provider Register-AzResourceProvider -ProviderNamespace $providerNameSpaceMaintenance | Out-Null Write-Host ($writeEmptyLine + "# All required resource providers for AUM are currently registering or have already registered" + $writeSeperatorSpaces + $currentTime)` -foregroundcolor $foregroundColor2 $writeEmptyLine ## --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ## Write script completed Write-Host ($writeEmptyLine + "# Script completed" + $writeSeperatorSpaces + $currentTime)` -foregroundcolor $foregroundColor1 $writeEmptyLine ## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Conclusion

I hope the Azure PowerShell script shared in this blog post will help you simplify the creation of a Microsoft Azure Attestation provider in your environment.

If you have any questions or suggestions regarding this blog post or script, feel free to reach out to me on X (@wmatthyssen) or leave a comment. I’ll be happy to assist you.




Share this content:

I am a passionate blogger with extensive experience in web design. As a seasoned YouTube SEO expert, I have helped numerous creators optimize their content for maximum visibility.

Leave a Comment