Joa*_*rel 9 ip-address azure static-ip-address azure-configuration azure-deployment
有没有人知道是否可以在Windows Azure上获取Web或辅助角色的静态IP地址(可能只在私有测试版中)?
几年后,Azure现在允许您为VM和云服务(Web和Worker角色)保留IP地址.但是,它只能暂时从PowerShell访问(显然这将在未来发生变化).
前五个静态IP地址是免费的.要创建IP,您需要确保拥有最新版本的Azure PowerShell命令行界面,并且还要将Azure帐户链接到Azure PowerShell(在本文的范围之外,但并不难).
在PowerShell中创建新IP:
$ReservedIP = New-AzureReservedIP -ReservedIPName "FirewallIP" -Label "WebAppFirewallIP" -Location "Japan West"
Run Code Online (Sandbox Code Playgroud)
要将其与VM关联:
New-AzureVMConfig -Name "WebAppVM" -InstanceSize Small -ImageName $images[60].ImageName | Add-AzureProvisioningConfig -Windows -AdminUsername cloudguy -Password Abc123 | New-AzureVM -ServiceName "WebApp" –ReservedIPName $ReservedIP -Location "Japan West"
Run Code Online (Sandbox Code Playgroud)
要将新IP插入Web或辅助角色(如果辅助角色具有外部端点),请将以下内容添加到ServiceConfiguration.Cloud.cscfg:
<ServiceConfiguration>
<NetworkConfiguration>
<AddressAssignments>
<ReservedIPs>
<ReservedIP name="<reserved-ip-name>"/>
</ReservedIPs>
</AddressAssignments>
</NetworkConfiguration>
</ServiceConfiguration>
Run Code Online (Sandbox Code Playgroud)
要随时查看IP:
Get-AzureReservedIP -ReservedIPName "FirewallIP"
Run Code Online (Sandbox Code Playgroud)
资料来源:文件