Set-​Azure​Public​IP

Adds a Public IP to an Azure virtual machine.

Syntax

Set-AzurePublicIP
   [-PublicIPName] <String>
   [[-IdleTimeoutInMinutes] <Int32>]
   [[-DomainNameLabel] <String>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-Profile <AzureSMProfile>]
   -VM <IPersistentVM>
   [<CommonParameters>]

Description

The Set-AzurePublicIP cmdlet adds a Public IP to an Azure virtual machine. If you run this cmdlet for an existing virtual machine, update the virtual machine to implement your changes. You can specify a domain name label to create a corresponding DNS entry for the public IP.

Examples

Example 1: Add a Public IP to an existing virtual machine

PS C:\> Get-AzureVM -ServiceName "FTPInAzure" -Name "FTPInstance" | Set-AzurePublicIP -PublicIPName "ftpip" | Update-AzureVM

This command gets the virtual machine named FTPInstance in the service named FTPInAzure by using the Get-AzureVM cmdlet. The command passes that virtual machine to the current cmdlet by using the pipeline operator. The current cmdlet adds the Public IP name ftpip. The command passes the virtual machine to the Update-AzureVM cmdlet, which implements your changes.

Example 2: Add a Public IP to a new virtual machine

PS C:\> New-AzureVMConfig -Name "FTPInstance" -InstanceSize Small -ImageName "Image07" | Add-AzureProvisioningConfig -Windows -AdminUsername "AdminMain" -Password "password" | Set-AzurePublicIP -PublicIPName "ftpip" | New-AzureVM -ServiceName "FTPinAzure" -Location "North Central US"

This command creates a virtual machine configuration object by using the New-AzureVMConfig cmdlet. The command passes that object to the Add-AzureProvisioningConfig cmdlet, which provides additional configuration. The current cmdlet adds the Public IP name ftpip. The command passes the configuration to the New-AzureVM cmdlet, which creates the virtual machine.

Example 3: Add a Public IP and label to an existing virtual machine

PS C:\> Get-AzureVM -ServiceName "FTPInAzure" -Name "FTPInstance" | Set-AzurePublicIP -PublicIPName "ftpip" -DomainNameLabel "ipname" | Update-AzureVM

This command gets the virtual machine named FTPInstance in the service named FTPInAzure by using the Get-AzureVM cmdlet. The command passes that virtual machine to the current cmdlet by using the pipeline operator. The current cmdlet adds the Public IP name ftpip and the label ipname. The command updates the virtual machine, which implements your changes.

Example 4: Add a Public IP and label to a new virtual machine

PS C:\> New-AzureVMConfig -Name "FTPInstance" -InstanceSize Small -ImageName $images[50].ImageName | Add-AzureProvisioningConfig -Windows -AdminUsername "AdminMain" -Password "password" | Set-AzurePublicIP -PublicIPName "ftpip" -DomainNameLabel "ipname" | New-AzureVM -ServiceName "FTPinAzure" -Location "North Central US"

This command creates a virtual machine configuration object, and then passes that object to Add-AzureProvisioningConfig, which provides additional configuration. The current cmdlet adds the Public IP name ftpip and the label ipname. The command creates the virtual machine.

Required Parameters

-PublicIPName

Specifies the Public IP name.

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VM

Specifies the virtual machine to which this cmdlet adds Public IP.

Type:IPersistentVM
Aliases:InputObject
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-DomainNameLabel

Specifies the name to use for a corresponding DNS entry for the public IP address.

Type:String
Position:3
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IdleTimeoutInMinutes

Specifies the TCP idle time-out period in minutes.

Type:Int32
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.WindowsAzure.Commands.ServiceManagement.Model.IPersistentVM