New-AzureRmContainerServiceConfig

Creates a local configuration object for a container service.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

New-AzureRmContainerServiceConfig
   [[-Location] <String>]
   [[-Tag] <Hashtable>]
   [[-OrchestratorType] <ContainerServiceOrchestratorTypes>]
   [[-MasterCount] <Int32>]
   [[-MasterDnsPrefix] <String>]
   [[-AgentPoolProfile] <ContainerServiceAgentPoolProfile[]>]
   [[-WindowsProfileAdminUsername] <String>]
   [[-WindowsProfileAdminPassword] <String>]
   [[-AdminUsername] <String>]
   [[-SshPublicKey] <String[]>]
   [[-VmDiagnosticsEnabled] <Boolean>]
   [-CustomProfileOrchestrator <String>]
   [-ServicePrincipalProfileClientId <String>]
   [-ServicePrincipalProfileSecret <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzureRmContainerServiceConfig cmdlet creates a local configuration object for a container service. Provide this object to the New-AzureRmContainerService cmdlet to create a container service.

Examples

Example 1: Create a container service configuration

PS C:\> $Container = New-AzureRmContainerServiceConfig -Location "Australia Southeast" -OrchestratorType "DCOS" -MasterDnsPrefix "MasterResourceGroup17" -AdminUsername "AcsLinuxAdmin" -SshPublicKey "<ssh-key>"
PS C:\> $Container | Add-AzureRmContainerServiceAgentPoolProfile -Name "AgentPool01" -VmSize "Standard_A1" -DnsPrefix "APResourceGroup17"

This command creates a container, and then stores it in the $Container variable. The command specifies various settings for the container service configuration. The command passes the configuration object to the Add-AzureRmContainerServiceAgentPoolProfile cmdlet by using the pipeline operator. That cmdlet adds an agent pool profile. Specify the object in $Container for the ContainerService parameter of New-AzureRmContainerService.

Parameters

-AdminUsername

Specifies the administrator account name to use for a Linux-based container service.

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

-AgentPoolProfile

Specifies an array of agent pool profile objects for the container service. Add a profile by using the Add-AzureRmContainerServiceAgentPoolProfile cmdlet.

Type:Microsoft.Azure.Management.Compute.Models.ContainerServiceAgentPoolProfile[]
Position:5
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-CustomProfileOrchestrator

Specifies the custom profile orchestrator.

Type:String
Position:Named
Default value:None
Required:False
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

-Location

Specifies the location in which to create the container service.

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

-MasterCount

Specifies the number of master virtual machines to create.

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

-MasterDnsPrefix

Specifies the DNS prefix for the master virtual machine.

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

-OrchestratorType

Specifies the type of orchestrator for the container service. The acceptable values for this parameter are: DCOS and Swarm.

Type:Nullable<T>[Microsoft.Azure.Management.Compute.Models.ContainerServiceOrchestratorTypes]
Accepted values:Swarm, DCOS, Custom, Kubernetes
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ServicePrincipalProfileClientId

Specifies the principal profile client ID.

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

-ServicePrincipalProfileSecret

Specifies the principal profile secret.

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

-SshPublicKey

Specifies the SSH public key for a Linux-based container service.

Type:String[]
Position:9
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Tag

Key-value pairs in the form of a hash table. For example: @{key0="value0";key1=$null;key2="value2"}

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

-VmDiagnosticsEnabled

Indicates whether this configuration enables diagnostics for the container service virtual machine.

Type:Boolean
Position:10
Default value:None
Required:False
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:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WindowsProfileAdminPassword

Specifies the administrator password for a container service that uses the Windows operating system.

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

-WindowsProfileAdminUsername

Specifies the administrator username for a container service that uses the Windows operating system.

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

Inputs

String

Hashtable

Nullable<T>[[Microsoft.Azure.Management.Compute.Models.ContainerServiceOrchestratorTypes, Microsoft.Azure.Management.Compute, Version=21.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]

Int32

Microsoft.Azure.Management.Compute.Models.ContainerServiceAgentPoolProfile[]

String[]

Boolean

Outputs

PSContainerService