powershell 使用静态IP创建Azure VM

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell 使用静态IP创建Azure VM相关的知识,希望对你有一定的参考价值。

# First an Azure subscription needs to be selected
# https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/
# https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-reserved-public-ip/#how-to-associate-a-reserved-ip-to-a-running-deployment
# This one is just for reading, it's not for a static IP (but can be used for azure powershell setup)
# https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-instance-level-public-ip/

# After that a reserved IP needs to be created
New-AzurereservedIP -ReservedIpName "SomeNameIp01" -Label "SomeNameIp01" -Location "North Europe"

# After that this is used to create a VM
New-AzureVMConfig -Name "SomeVMName" -InstanceSize "Medium" -imagename $portalimage.ImageName | Add-AzureProvisioningConfig -Windows -AdminUsername "someUsername" -Password "somePassword" | New-AzureVM -ServiceName NovArgus -Location "North Europe"

# Reserve IP
Set-AzureReservedIPAssociation -ReservedIPName NovListenerIp01 -ServiceName NovArgus

# Check usage
Get-AzureReservedIP

以上是关于powershell 使用静态IP创建Azure VM的主要内容,如果未能解决你的问题,请参考以下文章

Azure经典门户创建VM,如何设置使用静态IP地址?

使用 powershell 设置 Azure 函数 IP 限制

如何通过powershell或C#使用本地IP远程更新azure SQL防火墙

Azure(PowerShell)如何向多个现有的网络安全组(源地址前缀字段)添加额外的 IP?

如何使用 Powershell 中的快照创建 Azure 托管磁盘

Azure ARM模式下获取订阅下VM信息