Update-AzContainerService

Updates the state of a container service.

Syntax

Update-AzContainerService
      [-ResourceGroupName] <String>
      [-Name] <String>
      [-ContainerService] <PSContainerService>
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Update-AzContainerService cmdlet updates the state of a container service to match a local instance of the service.

Examples

Example 1: Update a container service

PS C:\> Get-AzContainerService -ResourceGroupName "ResourceGroup17" -Name "CSResourceGroup17" | Remove-AzContainerServiceAgentPoolProfile -Name "AgentPool01" | Add-AzContainerServiceAgentPoolProfile -Name "AgentPool01" -VmSize "Standard_A1" -DnsPrefix "APResourceGroup17" -Count 2 | Update-AzContainerService -ResourceGroupName "ResourceGroup17" -Name "CSResourceGroup17"

This command gets the container service named CSResourceGroup17 by using the Get-AzContainerService cmdlet. The command passes that object to the Remove-AzContainerServiceAgentPoolProfile cmdlet by using the pipeline operator.

Remove-AzContainerServiceAgentPoolProfile removes the profile named AgentPool01. The command passes the result to the Add-AzContainerServiceAgentPoolProfile cmdlet.

Add-AzContainerServiceAgentPoolProfile adds a profile that has the name AgentPool01, and has the specified properties. The command passes the result to the current cmdlet.

The current cmdlet updates the container service to reflect the changes that were made in this command.

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ContainerService

Specifies a local ContainerService object that contains changes.

Type:PSContainerService
Position:3
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the container service that this cmdlet updates.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Specifies the resource group of the container service that this cmdlet updates.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs.

The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

ContainerService

Parameter 'ContainerService' accepts value of type 'ContainerService' from the pipeline

Outputs

PSContainerService