< Back

Get-AzureRmContainerGroup

Tue Jan 29, 2019 9:40 pm

NAME Get-AzureRmContainerGroup



SYNOPSIS

Gets container groups.





SYNTAX

Get-AzureRmContainerGroup [-ResourceGroupName] <String> [-Name] <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]



Get-AzureRmContainerGroup [[-ResourceGroupName] <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]



Get-AzureRmContainerGroup [-DefaultProfile <IAzureContextContainer>] -ResourceId <String> [<CommonParameters>]





DESCRIPTION

The Get-AzureRmContainerGroup cmdlet gets a specified container group or all the container groups in a resource group or the subscription.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

The container group Name.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

The resource Group Name.



Required? false

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceId <String>

The resource id.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String







OUTPUTS

Microsoft.Azure.Commands.ContainerInstance.Models.PSContainerGroup







NOTES









Example 1: Gets a specified container group



PS C:\\> Get-AzureRmContainerGroup -ResourceGroupName demo -Name mycontainer



ResourceGroupName : demo

Id :

/subscriptions/ae43b1e3-c35d-4c8c-bc0d-f148b4c52b78/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/mycontainer

Name : mycontainer

Type : Microsoft.ContainerInstance/containerGroups

Location : westus

Tags :

ProvisioningState : Succeeded

Containers : {mycontainer}

ImageRegistryCredentials :

RestartPolicy :

IpAddress : 13.88.10.240

Ports : {8000}

OsType : Linux

Volumes :

State : Running

Events : {}



The command gets the specified container group.





Example 2: Gets container groups in a resource group



PS C:\\> Get-AzureRmContainerGroup -ResourceGroupName demo



ResourceGroupName Name Location OsType Image IP Resources ProvisioningState

----------------- ---- -------- ------ ----- -- --------- -----------------

demo container1 west us Linux alpine:latest 40.83.144.50:8002 1 cores/1 gb Succeeded

demo container2 west us Linux alpine:latest 104.42.228.253:8001 1 cores/1 gb Succeeded



The command gets the container groups in the resource group `demo`.





Example 3: Gets container groups in the current subscription



PS C:\\> Get-AzureRmContainerGroup



ResourceGroupName Name Location OsType Image IP Resources ProvisioningState

----------------- ---- -------- ------ ----- -- --------- -----------------

demo1 container1 west us Linux alpine:latest 40.83.144.50:8002 1 cores/1 gb Succeeded

demo2 container2 west us Linux alpine:latest 104.42.228.253:8001 1 cores/1 gb Succeeded



The command gets the container groups in the current subscription.





Example 4: Gets container groups using resource Id.



PS C:\\> Find-AzureRmResource -ResourceGroupEquals demo -ResourceNameEquals mycontainer | Get-AzureRmContainerGroup



ResourceGroupName : demo

Id :

/subscriptions/ae43b1e3-c35d-4c8c-bc0d-f148b4c52b78/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/mycontainer

Name : mycontainer

Type : Microsoft.ContainerInstance/containerGroups

Location : westus

Tags :

ProvisioningState : Succeeded

Containers : {mycontainer}

ImageRegistryCredentials :

RestartPolicy :

IpAddress : 13.88.10.240

Ports : {8000}

OsType : Linux

Volumes :

State : Running

Events : {}



The command gets the container group with the resource Id.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ainergroup