Get Public IP of VM in ScaleSet
See original GitHub issueQuery/Question How can I get the public IP of each VM in a scale set?
var _azure = Azure
.Configure()
.WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
.Authenticate(GetCredentials(credentials))
.WithSubscription(credentials.Subscription);
var scaleSets = await _azure.VirtualMachineScaleSets.ListAsync(true, cancellationToken);
// example of how to get the private ip:
var privateIp = scaleSets.First().VirtualMachines.List().First().ListNetworkInterfaces().First().PrimaryPrivateIP;
// PrimaryPublicIp does not exist:
var publicIp = scaleSets.First().VirtualMachines.List().First().ListNetworkInterfaces().First().PrimaryPublicIP;
Setup (please complete the following information if applicable):
- OS: Windows
- IDE : JetBrains Rider
- Version of the Library used:
- Microsoft.Azure.Management.Fluent Version=“1.36.1”
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
How to assign public ip to Virtual machine scale set instance
To create a scale set that assigns a public IP address to each virtual machine with the CLI, add the --public-ip-per-vm parameter to...
Read more >How to assign public IP to VM in VM-scaleset in Azure
1 Answer. But probably it is a better idea to assign a Public IP to the load balancer and then create Inbound NAT...
Read more >Adding public IP for existing virtual machine scale set
You can create a load balancer with the public IP, then add the virtual machine scale set into the backend pool of the...
Read more >How to assign public ip to Virtual machine scale set instance
Hi I created a VSS and under this there are 2 instances. I want to assign public ip to these instances - https://prnt.sc/qhVd9zChzQiN...
Read more >How To RDP/SSH Into Azure VMSS VM Instances
In this post we will review how to connect to Virtual Machine Scale Set instances using RDP for Windows and SSH for Linux....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@weidongxu-microsoft the API is documented in the NW spec here: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/network/resource-manager/Microsoft.Network/stable/2020-08-01/vmssPublicIpAddress.json
Hope this clarifies the question. Closing the issue, feel free to reopen if there are additional questions on this.
Here is a workaround in c#:
Types:
Call: