We have created a resource group with a VMSS instance within.
When running the "az vmss list" command within the Cloud Shell, we are able to get the respective resource.
However, when running the exact same command in PS, it returns an empty list, even though the resource exists.
We have also created a different naming convention and used the ARM Api call to test this and we got the same outcome. See the command below:
Invoke-RestMethod -Uri https://management.azure.com/subscriptions/***/resourceGroups/***-nodepool-prd-devtest/providers/Microsoft.Compute/virtualMachineScaleSets?api-version=2020-12-01 -Method GET -Headers $headers -ContentType 'application/json'
Output:
value
-----
{}
We have tried to add another VMSS to the same resource group as a test and noticed that made the other one pop up.
It looks to me as if it is a caching issue but I can't figure out how to resolve it. Any ideas?
Things to keep in mind:
- using the same CLI version as Cloud Shell (2.23.0)
- running the command from the pipeline returns an empty list
- a team member is able to get the resource from their own machine