Region ERROR in Microsoft.Maintenance/configurationAssignments

JAVIER Y 20 Reputation points
2025-06-10T13:38:09.9366667+00:00

Hello, I am experiencing some issues with the region available for the API

Microsoft.Maintenance/configurationAssignments@2024-02-01-preview in Bicep. I am using this preview because it is the only one I see available in my Resource providers in my Subscription.

When I search for regions where Microsoft.Maintenance/configurationAssignments can be used, several appear, but none of them seem to be compatible with my API. I always get an error that says:

Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidResourceLocation","message":"Region not supported germanywestcentral

My idea is to have two modules in Bicep, one that creates the Maintenance Configuration and another that then creates a Dynamic Scope within it with certain filters for the VMs.

Here is the code I am using for the Dynamic Scope:


targetScope = 'subscription'

param maintenanceConfigResourceId string
param subscriptionId string = subscription().id
param location string

resource assignment 'Microsoft.Maintenance/configurationAssignments@2024-02-01-preview' = {
  name: 'dynamic-scope-patchmanagement'
  location: location
  properties: {
    maintenanceConfigurationId: maintenanceConfigResourceId
    resourceId: subscriptionId
    filter: {
      resourceTypes: [
        'Microsoft.Compute/virtualMachines'
        'Microsoft.HybridCompute/machines'
      ]
      osTypes: [
        'Linux'
        'Windows'
      ]
      tagSettings: {
        filterOperator: 'All'
        tags: {
          'mcs-PatchManagement': [
            'On'
          ]
        }
      }
    }
  }
}

Azure Update Manager
Azure Update Manager
An Azure service to centrally manages updates and compliance at scale.
376 questions
{count} votes

Accepted answer
  1. Ashok Gandhi Kotnana 10,350 Reputation points Microsoft External Staff Moderator
    2025-06-10T15:54:47.2366667+00:00

    @JAVIER Y

    Ensure that the Microsoft.Maintenance resource provider is registered in your subscription:

    az provider show --namespace Microsoft.Maintenance --query "resourceTypes[?resourceType=='configurationAssignments'].apiVersions" --output json
    
    az provider show --namespace Microsoft.Maintenance \   --query "resourceTypes[?resourceType=='configurationAssignments'].locations[]" \   --output json | jq '.[] | select(startswith("G"))'
    
    

    Fix: Ensure that both the configurationAssignment and the target resource (e.g., VM) are in Germany West Central.

    Even though the region is listed, preview features may not be fully rolled out in all listed regions.

     Fix: Try deploying the same template in a more established region like East US or West Europe to confirm if the issue is region-specific.

    You're setting:

    resourceId: subscriptionId

    But resourceId in this context expects the fully qualified Azure Resource ID of the target resource (like a VM or a resource group), not just the subscription ID.

    Since you're using targetScope = 'subscription', and trying to apply a dynamic scope assignment, you should use the subscription resource ID in the correct format

     If subscription-level dynamic scoping is unstable, consider scoping to a resource group

     Even though while checking the api version it is not visible, there are older api versions available. Please try using older api version.

    User's image

    Hope this helps!

    let us know if any help, we will always help as you needed.!

    User's image

    Please do not forget to "Accept the answer” wherever the information provided helps you, this can be beneficial to other community members.it would be greatly appreciated and helpful to others.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.