While assigning dynamic scope resource type error

sns 9,231 Reputation points

I executed following 2 commands:


$mc=Get-AZMaintenanceConfiguration -ResourceGroupName Ue2PrD01ResourceGroup -Name Dr01MainteanceConfig


New-AzConfigurationAssignment -ConfigurationAssignmentName $mc.Name -MaintenanceConfigurationId $mc.Id -FilterLocation eastus2 -FilterOsType Windows -FilterTag '{"EnvironmentCode" : ["Dev01"] }' '{"EnvironmentType" : ["Development"] }' '{"Team" : ["DCloud Raiders test@gmail.com"] }'

Error: I see after debug

User's image

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

2 answers

Sort by: Most helpful
  1. Dillon Silzer 56,521 Reputation points

    Hi sns,

    As stated in the error, 'resourceType' cannot be null. Here is an example with resourceType:

    New-AzConfigurationAssignment -ResourceGroupName smdtest$location -ResourceParentType hostGroups -ResourceParentName smddhg$location -ResourceType hosts -ResourceName smddh$location -ProviderName Microsoft.Compute -ConfigurationAssignmentName $maintenanceConfigurationName -MaintenanceConfigurationId $maintenanceConfigurationCreated.Id -Location $location


    User's image

    If this is helpful please accept answer.

  2. Monalla-MSFT 12,846 Reputation points

    @sns - Thanks for reaching out to us.

    I see that you have posted a similar question here: https://learn.microsoft.com/en-us/answers/questions/1437305/resource-type-cant-be-null, reposting the solution here for the broader community here.

    ResourceType is optional since 1.3.1 release, before this version it was mandatory. Please ensure to use only 1 PS module version.

    Hope this helps. and please feel free to reach out if you have any further questions.

    Please don't forget to "Accept as Answer" and click "Yes" if the above response is helpful, so it can be beneficial to the community.

    0 comments No comments