简体   繁体   中英

How to get an public address for Azure SDK Python, before VM creation

I'm aware that the public ip is only generated after you set the vm. But is there a way to force the public ip to be dinamically created BEFORE the vm creation.

Mainly, I need to use the ip to generate the machine's name.

Or, is there a way to update the machine's name, before creation? I can find any information on this.

You can create the public IP before you create the VM. Then when creating the VM, associate the public IP to the VM's NIC.

Add Andrés Nava - .NET's answer. You should create a static Public IP before you create VM. Please refer to this SDK article .

Gets or sets PrivateIP allocation method (Static/Dynamic)

When you create a static Public IP, it is associated a Public IP address and the IP address does not change. But if you create a Dynamic Public IP, it is not associated a IP address when you create the resource and the IP address will change when you stop VM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM