< Back

Set-AzurePublicIP

Wed Jan 30, 2019 5:53 pm

NAME Set-AzurePublicIP



SYNOPSIS

Adds a Public IP to an Azure virtual machine.





SYNTAX

Set-AzurePublicIP [-PublicIPName] <String> [[-IdleTimeoutInMinutes] <Nullable`1[Int32]>] [[-DomainNameLabel] <String>] -VM <IPersistentVM> [-Profile

<AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<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.





PARAMETERS

-PublicIPName <String>

Specifies the Public IP name.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-IdleTimeoutInMinutes <Nullable`1[Int32]>

Specifies the TCP idle time-out period in minutes.



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DomainNameLabel <String>

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



Required? false

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VM <IPersistentVM>

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



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue, ByPropertyName)

Accept wildcard characters? false



-Profile <AzureSMProfile>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

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 (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Microsoft.WindowsAzure.Commands.ServiceManagement.Model.IPersistentVM







NOTES









-------------------------- 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.



RELATED LINKS

Get-AzurePublicIP

Get-AzureVM

New-AzureVM

New-AzureVMConfig

Remove-AzurePublicIP

Update-AzureVM