New-AzContainerService

Creates a container service.

Syntax

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

Description

The New-AzContainerService cmdlet creates a container service. Specify a container service object that you can create by using the New-AzContainerServiceConfig cmdlet.

Examples

Example 1: Create a container service

PS C:\> New-AzResourceGroup -Name "ResourceGroup17" -Location "Australia Southeast" -Force
PS C:\> $Container = New-AzContainerServiceConfig -Location "Australia Southeast" -OrchestratorType "DCOS" -MasterDnsPrefix "MasterResourceGroup17" -AdminUsername "AcsLinuxAdmin" -SshPublicKey "<ssh-key>" | Add-AzContainerServiceAgentPoolProfile -Name "AgentPool01" -VmSize "Standard_A1" -DnsPrefix "APResourceGroup17"
PS C:\> New-AzContainerService -ResourceGroupName "ResourceGroup17" -Name "CSResourceGroup17" -ContainerService $Container

The first command creates a resource group named ResourceGroup17 at the specified location. For more information, see the New-AzResourceGroup cmdlet.

The second command creates a container, and then stores it in the $Container variable. For more information, see the New-AzContainerServiceConfig cmdlet.

The final command creates a container service for the container stored in $Container. The service is named csResourceGroup17.

Parameters

-AsJob

RRun cmdlet in the background and return a Job to track progress.

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 container service object that contains the properties for the new service. To obtain a ContainerService object, use the New-AzContainerServiceConfig cmdlet.

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 creates.

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

-ResourceGroupName

Specifies the resource group in which this cmdlet deploys the container service.

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