Assigning machines to Maintenance config is failing

sns 9,226 Reputation points
2023-11-22T10:50:02.74+00:00

am not sure what mistake I have done, created the maintenance config successfully but while creating assignment giving following

Command I have used:

PS /home/user> $mc=Get-AZMaintenanceConfiguration -ResourceGroupName UE2PRD01RESOURCEGROUP -Name Dr01MainteanceConfig

PS /home/user> New-AzConfigurationAssignment -ConfigurationAssignmentName $mc.Name -MaintenanceConfigurationId $mc.Id -FilterLocation eastus2euap,centraluseuap -FilterOsType Windows -FilterTag '{"EnvironmentCode" : ["Dev01"] }' '{"EnvironmentType" : ["Development"] }'

New-AzConfigurationAssignment: 'resourceType' cannot be null.

PS /home/user> New-AzConfigurationAssignment -ConfigurationAssignmentName $mc.Name -MaintenanceConfigurationId $mc.Id -FilterLocation eastus2 -FilterOsType Windows -FilterTag '{"EnvironmentCode" : ["Dev01"] }' '{"EnvironmentType" : ["Development"] }'

New-AzConfigurationAssignment: 'resourceType' cannot be null.

PS /home/user> New-AzConfigurationAssignment -ConfigurationAssignmentName $mc.Name -MaintenanceConfigurationId $mc.Id -FilterLocation eastus2 -FilterOsType Windows -FilterTag '{"EnvironmentCode" : ["Dev01"] }' '{"EnvironmentType" : ["Development"] }' -Debug

I have enabled debug. please suggest

I have used debug

Logs:

DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 7.0.13 Linux 5.10.102.2-microsoft-standard #1 SMP Mon Mar 7 17:36:34 UTC 2022 [2023-11-22 10:29:19Z - 9f2fb8e4-fb60-4bee-9460-87f6afe35c22] 
        === Token Acquisition finished successfully:
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 7.0.13 Linux 5.10.102.2-microsoft-standard #1 SMP Mon Mar 7 17:36:34 UTC 2022 [2023-11-22 10:29:19Z - 9f2fb8e4-fb60-4bee-9460-87f6afe35c22]  AT expiration time: 11/22/2023 11:29:06 AM +00:00, scopes: https://management.core.windows.net//user_impersonation https://management.core.windows.net//.default. source: Cache
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2023-11-22T11:29:06.0000000+00:00
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: 'xxx', UserId: 'test'
DEBUG: 10:29:19 AM - [ConfigManager] Got nothing from [DisableErrorRecordsPersistence], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: 10:29:19 AM - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
New-AzConfigurationAssignment: 'resourceType' cannot be null.
DEBUG: 10:29:19 AM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:29:19 AM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:29:19 AM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent:  Module: Az.Maintenance:1.4.0; CommandName: New-AzConfigurationAssignment; PSVersion: 7.3.9; IsSuccess: False; Duration: 00:00:02.5565269; Exception: 'resourceType' cannot be null.;
DEBUG: 10:29:19 AM - NewAzureRmConfigurationAssignment end processing.
Azure Update Manager
Azure Update Manager
An Azure service to centrally manages updates and compliance at scale.
257 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Monalla-MSFT 12,121 Reputation points
    2023-12-06T12:27:27.1366667+00:00

    @sns - Thanks for reaching out to us.

    Looks like filter tag that you are using is wrong, please try the below command.

    New-AzConfigurationAssignment -ConfigurationAssignmentName $mc.Name -MaintenanceConfigurationId $mc.Id -FilterLocation eastus2 -FilterOsType Windows -FilterTag '{"Env": ["ABC"], "XYZ": ["PQR", "ZZZ"]}' -Debug
    
    
    

    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