New-AzContainerInstanceObject
Create a in-memory object for Container
Syntax
Default (Default)
New-AzContainerInstanceObject
-Image <String>
-Name <String>
[-Command <String[]>]
[-ConfigMapKeyValuePair <IConfigMapKeyValuePairs>]
[-EnvironmentVariable <IEnvironmentVariable[]>]
[-LimitCpu <Double>]
[-LimitMemoryInGb <Double>]
[-LimitsGpuCount <Int32>]
[-LimitsGpuSku <String>]
[-LivenessProbeExecCommand <String[]>]
[-LivenessProbeFailureThreshold <Int32>]
[-LivenessProbeHttpGetHttpHeader <IHttpHeader[]>]
[-LivenessProbeHttpGetPath <String>]
[-LivenessProbeHttpGetPort <Int32>]
[-LivenessProbeHttpGetScheme <String>]
[-LivenessProbeInitialDelaySecond <Int32>]
[-LivenessProbePeriodSecond <Int32>]
[-LivenessProbeSuccessThreshold <Int32>]
[-LivenessProbeTimeoutSecond <Int32>]
[-Port <IContainerPort[]>]
[-ReadinessProbeExecCommand <String[]>]
[-ReadinessProbeFailureThreshold <Int32>]
[-ReadinessProbeHttpGetHttpHeader <IHttpHeader[]>]
[-ReadinessProbeHttpGetPath <String>]
[-ReadinessProbeHttpGetPort <Int32>]
[-ReadinessProbeHttpGetScheme <String>]
[-ReadinessProbeInitialDelaySecond <Int32>]
[-ReadinessProbePeriodSecond <Int32>]
[-ReadinessProbeSuccessThreshold <Int32>]
[-ReadinessProbeTimeoutSecond <Int32>]
[-RequestCpu <Double>]
[-RequestMemoryInGb <Double>]
[-RequestsGpuCount <Int32>]
[-RequestsGpuSku <String>]
[-VolumeMount <IVolumeMount[]>]
[<CommonParameters>]
Description
Create a in-memory object for Container
Examples
Example 1: Create a container instance using image alpine with request cpu 1.0 and request memory 1.5Gb
New-AzContainerInstanceObject -Name "test-container" -Image alpine -RequestCpu 1 -RequestMemoryInGb 1.5
Name
----
test-container
Create a container instance using image alpine with request cpu 1.0 and request memory 1.5Gb
Example 2: Create a container instance using image alpine with limit cpu 2.0 and limit memory 2.5Gb
New-AzContainerInstanceObject -Image alpine -Name "test-container" -LimitCpu 2 -LimitMemoryInGb 2.5
Name
----
test-container
Create a container instance using image alpine with limit cpu 2.0 and limit memory 2.5Gb
Example 3: Create a container group with a container instance
$container = New-AzContainerInstanceObject -Name test-container -Image alpine
New-AzContainerGroup -ResourceGroupName testrg-rg -Name test-cg -Location eastus -Container $container
Location Name Zone ResourceGroupName
-------- ---- ---- -----------------
eastus test-cg test-rg
Create a container group with a container instance
Parameters
-Command
The commands to execute within the container instance in exec form.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ConfigMapKeyValuePair
The key value pairs dictionary in the config map to set in the container instance.
To construct, see NOTES section for CONFIGMAPKEYVALUEPAIR properties and create a hash table.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-EnvironmentVariable
The environment variables to set in the container instance.
To construct, see NOTES section for ENVIRONMENTVARIABLE properties and create a hash table.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Image
The name of the image used to create the container instance.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LimitCpu
The CPU limit of this container instance.
Parameter properties
Type: Double
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LimitMemoryInGb
The memory limit in GB of this container instance.
Parameter properties
Type: Double
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LimitsGpuCount
The count of the GPU resource.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LimitsGpuSku
The SKU of the GPU resource.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LivenessProbeExecCommand
The commands to execute within the container.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LivenessProbeFailureThreshold
The failure threshold.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
The HTTP headers for liveness probe.
To construct, see NOTES section for LIVENESSPROBEHTTPGETHTTPHEADER properties and create a hash table.
Type: IHttpHeader [ ]
Default value: None
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LivenessProbeHttpGetPath
The path to probe.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LivenessProbeHttpGetPort
The port number to probe.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LivenessProbeHttpGetScheme
The scheme.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LivenessProbeInitialDelaySecond
The initial delay seconds.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LivenessProbePeriodSecond
The period seconds.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LivenessProbeSuccessThreshold
The success threshold.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LivenessProbeTimeoutSecond
The timeout seconds.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
The user-provided name of the container instance.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Port
The exposed ports on the container instance.
To construct, see NOTES section for PORT properties and create a hash table.
Parameter properties
Type: IContainerPort [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReadinessProbeExecCommand
The commands to execute within the container.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReadinessProbeFailureThreshold
The failure threshold.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
The HTTP headers for readiness probe.
To construct, see NOTES section for READINESSPROBEHTTPGETHTTPHEADER properties and create a hash table.
Type: IHttpHeader [ ]
Default value: None
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReadinessProbeHttpGetPath
The path to probe.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReadinessProbeHttpGetPort
The port number to probe.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReadinessProbeHttpGetScheme
The scheme.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReadinessProbeInitialDelaySecond
The initial delay seconds.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReadinessProbePeriodSecond
The period seconds.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReadinessProbeSuccessThreshold
The success threshold.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ReadinessProbeTimeoutSecond
The timeout seconds.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-RequestCpu
The CPU request of this container instance.
Parameter properties
Type: Double
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-RequestMemoryInGb
The memory request in GB of this container instance.
Parameter properties
Type: Double
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-RequestsGpuCount
The count of the GPU resource.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-RequestsGpuSku
The SKU of the GPU resource.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-VolumeMount
The volume mounts available to the container instance.
To construct, see NOTES section for VOLUMEMOUNT properties and create a hash table.
Parameter properties
Type: IVolumeMount [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
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 .
Outputs