Edit

Share via


Get-AzPublicIpAddress

Gets a public IP address.

Syntax

NoExpandStandAloneIp (Default)

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

ExpandStandAloneIp

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

NoExpandScaleSetIp

Get-AzPublicIpAddress
    -ResourceGroupName <String>
    [-Name <String>]
    [-VirtualMachineScaleSetName <String>]
    [-VirtualMachineIndex <String>]
    [-NetworkInterfaceName <String>]
    [-IpConfigurationName <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

ExpandScaleSetIp

Get-AzPublicIpAddress
    -Name <String>
    -ResourceGroupName <String>
    -VirtualMachineScaleSetName <String>
    -VirtualMachineIndex <String>
    -NetworkInterfaceName <String>
    -IpConfigurationName <String>
    -ExpandResource <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Get-AzPublicIPAddress cmdlet gets one or more public IP addresses in a resource group.

Examples

Example 1: Get a public IP resource

Get-AzPublicIpAddress -Name myPublicIp1 -ResourceGroupName myRg
Name                     : myPublicIp1
ResourceGroupName        : myRg
Location                 : westus2
Id                       : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft
                           .Network/publicIPAddresses/myPublicIp1
Etag                     : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid             : 00000000-0000-0000-0000-000000000000
ProvisioningState        : Succeeded
Tags                     :
PublicIpAllocationMethod : Dynamic
IpAddress                : Not Assigned
PublicIpAddressVersion   : IPv4
IdleTimeoutInMinutes     : 4
IpConfiguration          : {
                             "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/
                           Microsoft.Network/networkInterfaces/ps-azure-env407/ipConfigurations/ipconfig1"
                           }
DnsSettings              : null
Zones                    : {}
Sku                      : {
                             "Name": "Basic",
                             "Tier": "Regional"
                           }
IpTags                   : []

This command gets a public IP address resource with name myPublicIp in the resource group myRg.

Example 2: Get public IP resources using filtering

Get-AzPublicIpAddress -Name myPublicIp*
Name                     : myPublicIp1
ResourceGroupName        : myRg
Location                 : westus2
Id                       : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft
                           .Network/publicIPAddresses/myPublicIp1
Etag                     : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid             : 00000000-0000-0000-0000-000000000000
ProvisioningState        : Succeeded
Tags                     :
PublicIpAllocationMethod : Dynamic
IpAddress                : Not Assigned
PublicIpAddressVersion   : IPv4
IdleTimeoutInMinutes     : 4
IpConfiguration          : {
                             "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/
                           Microsoft.Network/networkInterfaces/ps-azure-env407/ipConfigurations/ipconfig1"
                           }
DnsSettings              : null
Zones                    : {}
Sku                      : {
                             "Name": "Basic",
                             "Tier": "Regional"
                           }
IpTags                   : []

This command gets all public IP address resources whose name starts with myPublicIp.

Parameters

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExpandResource

The Get-AzPublicIPAddress cmdlet gets one or more public IP addresses in a resource group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ExpandStandAloneIp
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
ExpandScaleSetIp
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IpConfigurationName

Network Interface IP Configuration Name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NoExpandScaleSetIp
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Specifies the name of the public IP address that this cmdlet gets.

Parameter properties

Type:String
Default value:None
Supports wildcards:True
DontShow:False
Aliases:ResourceName

Parameter sets

NoExpandStandAloneIp
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
NoExpandScaleSetIp
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-NetworkInterfaceName

Virtual Machine Network Interface Name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NoExpandScaleSetIp
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceGroupName

Specifies the name of the resource group that contains the public IP address that this cmdlet gets.

Parameter properties

Type:String
Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

NoExpandStandAloneIp
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-VirtualMachineIndex

Virtual Machine Index.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NoExpandScaleSetIp
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-VirtualMachineScaleSetName

Virtual Machine Scale Set Name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NoExpandScaleSetIp
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
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.

Inputs

String

Outputs

PSPublicIpAddress