question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUERY] Retrieval of VMSS VMs properties using new Azure.ResourceManager libraries

See original GitHub issue

Library name and version

Azure.ResourceManager.Compute Version=“1.0.0-beta.5” Azure.ResourceManager.Network Version=1.0.0-beta.5

Query/Question

I have questions about the new resource manager libraries:

  1. How can I retrieve a public IP of a running VMSS instance? Tried various things without any luck.
  2. How can I retrieve all the running (or deallocated) instances in VMSS? Came up with this, but it seems very cryptic to me:
var vms = vmCollection.GetAllAsync(filter: "startswith(instanceView/statuses/code, 'PowerState') eq true", select: "instanceView/statuses", expand: "instanceView");
var filtered = vms.Where(ins => ins.Data.InstanceView.Statuses[0].Code == "PowerState/running");

Environment

Platform: Windows Microsoft Visual Studio Professional 2019 Version 16.10.0

.NET SDK (reflecting any global.json):
 Version:   5.0.300
 Commit:    2e0c8c940e

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19043
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\5.0.300\

Host (useful for support):
  Version: 5.0.6
  Commit:  478b2f8c0e

.NET SDKs installed:
  2.1.201 [C:\Program Files\dotnet\sdk]
  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.503 [C:\Program Files\dotnet\sdk]
  2.1.514 [C:\Program Files\dotnet\sdk]
  3.1.201 [C:\Program Files\dotnet\sdk]
  5.0.300 [C:\Program Files\dotnet\sdk]

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Yao725commented, Oct 11, 2022

@Yao725 I’ve noticed that Azure.ResourceManager.Compute has moved out of preview. Is there any update on this issue?

These methods are still not available currently but will be good to go soon.

0reactions
egraffcommented, Feb 6, 2023

@Yao725 how is this issue currently tracking?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Virtual Machines - Get - REST API (Azure Compute)
Learn more about Compute service - Retrieves information about the model view or the instance view of a virtual machine.
Read more >
Azure Resource Graph sample queries for Azure Virtual ...
This query looks for virtual machine scale set resources and gets various details including the virtual machine size and the capacity of the ......
Read more >
Virtual Machine Scale Sets - Get - REST API (Azure ...
Specifies the Spot-Try-Restore properties for the virtual machine scale set. With this property customer can enable or disable automatic restore of the evicted ......
Read more >
Virtual Machine Scale Set VMs - List - REST API (Azure ...
Learn more about Compute service - Gets a list of all virtual machines in a VM scale sets.
Read more >
Virtual Machines - List - REST API (Azure Compute)
Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found