Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using az lab vm show to view artifacts doesn't work #7903

Open
sistoimenov opened this issue Nov 22, 2018 · 5 comments
Open

Using az lab vm show to view artifacts doesn't work #7903

sistoimenov opened this issue Nov 22, 2018 · 5 comments
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Devtestlab az lab Documentation good first issue Simple fixes for which the team would welcome a PR. Service Attention This issue is responsible by Azure service team.

Comments

@sistoimenov
Copy link

My goal is to view the available/installed artifacts on a VM in dev test lab.

By calling:

az lab vm show --lab-name $DevTestLabName --name $VmName--resource-group $ResourceGroupName

It displays a json response in which there is an "artifacts" property but its value is null.

When I try to use the --expand parameter as it is described in the documentation it returns an error:

az lab vm show --lab-name $DevTestLabName --name $VmName--resource-group $ResourceGroupName --expand 'properties($expand=artifacts)'

The error:

az : ERROR: Invalid properties were specified in the $expand query string parameter.
At line:1 char:1
+ az lab vm show --lab-name $DevTestLabName --name $VmName --resource-grou ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (ERROR: Invalid ...ring parameter.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

I searched through the issues and noticed that the expand property is planned for deprecation. Please advice what to use and how to list the artifacts in the DevTest lab.

Documentation: https://docs.microsoft.com/en-us/cli/azure/lab/vm?view=azure-cli-latest#az-lab-vm-show

@tjprescott tjprescott added Devtestlab az lab question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 26, 2018
@sandeepiiit
Copy link

sandeepiiit commented Apr 10, 2019

I see the same error when querying for "networkInterface".
When I run:
az lab vm show --lab-name $lab --name $name --resource-group $rg
I am able to see general details about the VM, but all entries under networkInterface are null.

When I try to expand that using "--expand",
az lab vm show --lab-name $lab --name $name --resource-group $rg --expand 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
It fails with:
Invalid properties were specified in the $expand query string parameter.

@tjprescott
Copy link
Member

Invalid properties were specified in the $expand query string parameter.

This means the service does not support the value you supplied.

@sandeepiiit
Copy link

@tjprescott Do you mean the the value I provided for the expand parameter is incorrect?
I copied that from the documentation: https://docs.microsoft.com/en-us/cli/azure/lab/vm?view=azure-cli-latest#az-lab-vm-show

I also tried the below command with lesser properties in expand and got the same error:
az lab vm show --lab-name $lab --name $name --resource-group $rg --expand 'properties($expand=networkInterface)'

Let me know if I am interpreting this wrong.

@sandeepiiit
Copy link

Nevermind, I figured out my mistake.
I was using the CLI from within the powershell (and I assume I am not escaping the characters appropriately to get that to work).

I switched to command prompt, and I had to change ' to " and then the command works as expected.
az lab vm show --lab-name $lab --name $name -g $rg --expand "properties($expand=networkInterface)"

I think the doc should be updated to use double quotes there?

@tjprescott tjprescott added Documentation good first issue Simple fixes for which the team would welcome a PR. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 11, 2019
@bsiegel bsiegel added the Service Attention This issue is responsible by Azure service team. label Jun 14, 2019
@haroldrandom haroldrandom added Devtestlab az lab Documentation good first issue Simple fixes for which the team would welcome a PR. Service Attention This issue is responsible by Azure service team. labels Oct 25, 2019
@joerage
Copy link

joerage commented Nov 20, 2019

In powershell, this can be use:
az lab vm show --lab-name $lab --name $name -g $rg --expand '"properties($expand=networkInterface)"'

@azure-sdk azure-sdk added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Devtestlab az lab Documentation good first issue Simple fixes for which the team would welcome a PR. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

7 participants