I'm failing to set up Dynamic Scopes for my Maintenance Configuration related to VMs (InGuestPatching) with Powershell. I have created a maintenance configuration. Now I want to do the configuration assignment on number of virtual machines at scale using powershell over subscription level dynamic scope. But powershell cmdlet is failing to do so.
Import-Module Az.Accounts
Import-Module Az.Resources
Import-Module Az.Compute
Import-Module Az.Automation
Import-Module Az.Storage
Import-Module Az.KeyVault
Import-Module Az.Maintenance
Import-Module Az.Compute
Set-AzContext -Subscription ""
$maintenanceconfig = New-AzMaintenanceConfiguration -ResourceGroup $RGName -Name $configName -MaintenanceScope $scope -Location $location -StartDateTime $startDateTime -TimeZone $timeZone -Duration $duration -RecurEvery $recurEvery -WindowParameterClassificationToInclude $WindowsParameterClassificationToInclude -InstallPatchRebootSetting $RebootOption -ExtensionProperty @{"InGuestPatchMode"="User"}
New-AzConfigurationAssignment -ConfigurationAssignmentName $maintenanceconfig.Name -MaintenanceConfigurationId $maintenanceconfig.Id -ProviderName Microsoft.Compute -ResourceType virtualMachines -FilterLocation eastus2 -FilterOsType Windows -FilterOperator "Any" -FilterTag '{"network_environment" : ["sb"]}'
The above code is failing to create dynamic scope assignment and below is the error I am getting.
Error:
I don't know what exactly am I missing but this cmdlet is not working for me and MS documentation is lacking the information. Please suggest a solution for this

Here is the updated PowerShell script for creating a maintenance configuration for a VM.
To add dynamic scope into
multiple subscriptionbased filters, you can use the following code.Output:
After executing the script, the dynamic scope has been created in
Maintenance configuration.