Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Get-AzContainerGroup
- Module:
- Az.ContainerInstance Module
Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.
Syntax
List (Default)
Get-AzContainerGroup
[-SubscriptionId <String[]>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Get
Get-AzContainerGroup
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String[]>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
List1
Get-AzContainerGroup
-ResourceGroupName <String>
[-SubscriptionId <String[]>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
GetViaIdentity
Get-AzContainerGroup
-InputObject <IContainerInstanceIdentity>
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Description
Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.
Examples
Example 1: List all container groups in the current subscription
Get-AzContainerGroup
Location Name Zone ResourceGroupName
-------- ---- ---- -----------------
eastus test-cg1 test-rg
eastus test-cg2 test-rg
This command gets all container groups in the current subscription.
Example 2: Get a specific container group
Get-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg | Format-List
Container : {test-container1}
DnsConfigNameServer :
DnsConfigOption :
DnsConfigSearchDomain :
EncryptionPropertyKeyName :
EncryptionPropertyKeyVersion :
EncryptionPropertyVaultBaseUrl :
IPAddressDnsNameLabel :
IPAddressFqdn :
IPAddressIP : 000.000.000.000
IPAddressPort : {Microsoft.Azure.PowerShell.Cmdlets.ContainerInsta
nce.Models.Api20210301.Port, Microsoft.Azure.Power
Shell.Cmdlets.ContainerInstance.Models.Api20210301
.Port}
IPAddressType : Public
Id : /subscriptions/00000000-0000-0000-0000-000000000000
0/resourceGroups/test-rg/providers/Microsoft.Contai
nerInstance/containerGroups/test-cg1
IdentityPrincipalId :
IdentityTenantId :
IdentityType :
IdentityUserAssignedIdentity : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan
ce.Models.Api20210301.ContainerGroupIdentityUserAs
signedIdentities
ImageRegistryCredentials :
InitContainer : {}
InstanceViewEvent :
InstanceViewState :
Location : eastus
LogAnalyticLogType :
LogAnalyticMetadata : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan
ce.Models.Api20210301.LogAnalyticsMetadata
LogAnalyticWorkspaceId :
LogAnalyticWorkspaceKey :
LogAnalyticWorkspaceResourceId : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan
ce.Models.Api20210301.LogAnalyticsWorkspaceResourc
eId
Name : test-cg1
NetworkProfileId :
OSType : Linux
ProvisioningState : Succeeded
ResourceGroupName : test-rg
RestartPolicy : Never
Sku : Standard
Tag : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan
ce.Models.Api20210301.ResourceTags
Type : Microsoft.ContainerInstance/containerGroups
Volume :
The command gets the specified container group.
Example 3: Get container groups in a resource group
Get-AzContainerGroup -ResourceGroupName test-rg
Location Name Zone ResourceGroupName
-------- ---- ---- -----------------
eastus test-cg1 test-rg
eastus test-cg2 test-rg
The command gets the container groups in the resource group test-rg.
Example 4: Get a container group by piping
Update-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg -Tag @{"test"="value"} | Get-AzContainerGroup
Location Name Zone ResourceGroupName
-------- ---- ---- -----------------
eastus test-cg1 test-rg
The command gets the updated container group by piping.
Parameters
-DefaultProfile
The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
Parameter properties
| Type: | PSObject |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzureRMContext, AzureCredential |
Parameter sets
-InputObject
Identity Parameter
Parameter properties
| Type: | IContainerInstanceIdentity |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Name
The name of the container group.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | ContainerGroupName |
Parameter sets
-ResourceGroupName
The name of the resource group. The name is case insensitive.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SubscriptionId
The ID of the target subscription. The value must be an UUID.
Parameter properties
| Type: | String[] |
| Default value: | (Get-AzContext).Subscription.Id |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
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.
Inputs
IContainerInstanceIdentity
Outputs
Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerGroup
Azure PowerShell
Feedback
Was this page helpful?
