az maintenance assignment

Manage Azure Maintenance configuration assignment to resource.

Commands

az maintenance assignment create

Creates a Maintenance Assignment.

az maintenance assignment delete

Delete a Maintenance Assignment.

az maintenance assignment list

Lists Maintenance Assignment.

az maintenance assignment create

Creates a Maintenance Assignment.

az maintenance assignment create --configuration-assignment-name
                                 --location
                                 --maintenance-configuration-id
                                 --provider-name
                                 --resource-group
                                 --resource-name
                                 --resource-type
                                 [--resource-id]
                                 [--resource-parent-name]
                                 [--resource-parent-type]

Examples

Create a Maintenance Assignment.

az maintenance assignment create -g smdtest --resource-name smdVM --resource-type virtualMachines --provider-name Microsoft.Compute --configuration-assignment-name workervms --maintenance-configuration-id "/subscriptions/2b4ce620-bb0f-4964-8428-dea4aefec295/resourcegroups/smdtest/providers/Microsoft.Maintenance/maintenanceConfigurations/workervms" -l eastus2

Required Parameters

--configuration-assignment-name

Configuration assignment name. Same as the configuration name.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--maintenance-configuration-id

Fully qualified id of the maintenance configuration e.g. /subscriptions/2b4ce620-bb0f-4964-8428-dea4aefec295/resourceGroups/smdtest/providers/Microsoft.Maintenance/maintenanceConfigurations/config1.

--provider-name

Maintenance resource provider - Microsoft.Maintenance.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--resource-name

Name of resource.

--resource-type

Type of the azure resource e.g. virtualmachines, hosts etc.

Optional Parameters

--resource-id

Fully qualified identifier of the Azure resource.

--resource-parent-name

Name of the parent resource e.g. for dedicated hosts this would be the name of the dedicated host group, for VMSS VMs this would be the VMSS name.

--resource-parent-type

Type of the parent resource e.g. for dedicated hosts this would be hostGroups, for VMSS VMs this would be virtualmachinescalesets.

az maintenance assignment delete

Delete a Maintenance Assignment.

az maintenance assignment delete --configuration-assignment-name
                                 --provider-name
                                 --resource-group
                                 --resource-name
                                 --resource-type
                                 [--resource-parent-name]
                                 [--resource-parent-type]

Examples

Delete a Maintenance Assignment.

az maintenance assignment delete -g smdtest --resource-name smdVM --resource-type virtualMachines --provider-name Microsoft.Compute --configuration-assignment-name workervms

Required Parameters

--configuration-assignment-name

Configuration assignment name. Same as the configuration name.

--provider-name

Maintenance resource provider - Microsoft.Maintenance.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--resource-name

Name of resource.

--resource-type

Type of the azure resource e.g. virtualmachines, hosts etc.

Optional Parameters

--resource-parent-name

Name of the parent resource e.g. for dedicated hosts this would be the name of the dedicated host group, for VMSS VMs this would be the VMSS name.

--resource-parent-type

Type of the parent resource e.g. for dedicated hosts this would be hostGroups, for VMSS VMs this would be virtualmachinescalesets.

az maintenance assignment list

Lists Maintenance Assignment.

az maintenance assignment list --provider-name
                               --resource-group
                               --resource-name
                               --resource-type
                               [--resource-parent-name]
                               [--resource-parent-type]

Examples

List Maintenance Assignment.

az maintenance assignment list -g smdtest --resource-name smdVM --resource-type virtualMachines --provider-name Microsoft.Compute

Required Parameters

--provider-name

Maintenance resource provider - Microsoft.Maintenance.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--resource-name

Name of resource.

--resource-type

Type of the azure resource e.g. virtualmachines, hosts etc.

Optional Parameters

--resource-parent-name

Name of the parent resource e.g. for dedicated hosts this would be the name of the dedicated host group, for VMSS VMs this would be the VMSS name.

--resource-parent-type

Type of the parent resource e.g. for dedicated hosts this would be hostGroups, for VMSS VMs this would be virtualmachinescalesets.