Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

New-AzConfigurationAssignment

Register configuration for resource.

Syntax

Default (Default)

New-AzConfigurationAssignment
 [[-ResourceGroupName] <String>]
 [[-ProviderName] <String>]
 [-ResourceParentType <String>]
 [-ResourceParentName <String>]
 [[-ResourceType] <String>]
 [[-ResourceName] <String>]
 -ConfigurationAssignmentName <String>
 [-ResourceId <String>]
 [-Location <String>]
 -MaintenanceConfigurationId <String>
 [-FilterResourceType <String[]>]
 [-FilterLocation <String[]>]
 [-FilterTag <String>]
 [-FilterOperator <String>]
 [-FilterOsType <String[]>]
 [-FilterResourceGroup <String[]>]
 [-AsJob]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

Description

Register maintenance configuration for resource.

Examples

Example 1

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
Location : westus2
MaintenanceConfigurationId : /subscriptions/42c974dd-2c03-4f1b-96ad-b07f050aaa74/resourcegroups/ps1/providers/Microsoft.Maintenance/maintenanceConfigurations/ps2
ResourceId : 7b32ed22-dc7b-4a17-9c42-36c024f4c9f9
Id :
/subscriptions/42c974dd-2c03-4f1b-96ad-b07f050aaa74/resourcegroups/smdtestwestus2/providers/Microsoft.Compute/hostGroups/smddhgwestus2/hosts/smddhwestus2/providers/Microsoft.Maintenance/configurationAssignments/ps2
Name : ps2
Type : Microsoft.Maintenance/configurationAssignments

Register maintenance configuration for dedicated host.

Example 2

New-AzConfigurationAssignment -ConfigurationAssignmentName configAssignmentName -MaintenanceConfigurationId /subscriptions/eee2cef4-bc47-4278-b4f8-cfc65f25dfd8/resourceGroups/AUMDemov01/providers/Microsoft.Maintenance/maintenanceConfigurations/kachavan-prepost01 -FilterLocation eastus2euap,centraluseuap -FilterOsType Windows,Linux -FilterTag '{"tagKey1" : ["tagKey1Value1", "tagKey1Value2"], "tagKey2" : ["tagKey2Value1", "tagKey2Value2", "tagKey2Value3"] }' -FilterOperator "Any" -Location global
Location : global
MaintenanceConfigurationId : /subscriptions/eee2cef4-bc47-4278-b4f8-cfc65f25dfd8/resourceGroups/AUMDemov01/providers/Microsoft.Maintenance/maintenanceConfigurations/kachavan-prepost01
ResourceId : /subscriptions/eee2cef4-bc47-4278-b4f8-cfc65f25dfd8
Id : /subscriptions/eee2cef4-bc47-4278-b4f8-cfc65f25dfd8/providers/microsoft.maintenance/configurationassignments/configassignmentname
Name : configassignmentname
Type : microsoft.maintenance/configurationassignments
FilterTag : {"tagKey1":["tagKey1Value1","tagKey1Value2"],"tagKey2":["tagKey2Value1","tagKey2Value2","tagKey2Value3"]}
FilterOperator : Any
FilterLocation[0] : eastus2euap
FilterLocation[1] : centraluseuap
FilterOsType[0] : Windows
FilterOsType[1] : Linux

Register maintenance configuration for InGuest scope

Parameters

-AsJob

Run cmdlet in the background

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ConfigurationAssignmentName

The configuration assignment name, should match the MaintenanceConfigurationName.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

-FilterLocation

Allowed locations for dynamic scope.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-FilterOperator

Tag filter operator for dynamic scope.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-FilterOsType

Operating system type for dynamic scope.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-FilterResourceGroup

Operating system type for dynamic scope.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-FilterResourceType

Allowed resource types for dynamic scope.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-FilterTag

Allowed resource types for dynamic scope.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Location

The location without spaces for the resource.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-MaintenanceConfigurationId

The fully qualified MaintenanceConfiguration.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ProviderName

The resource provider Name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ResourceGroupName

The resource Group Name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ResourceId

The configuration assignment name, should match the MaintenanceConfigurationName.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ResourceName

The resource name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ResourceParentName

The parent resource name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ResourceParentType

The parent resource type.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ResourceType

The resource type.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Outputs

PSConfigurationAssignment


Feedback

Was this page helpful?