azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

App Service Plans Not Listed in Output

Open jaredbrogan opened this issue 3 years ago • 8 comments

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az resource list

Errors:

n/a

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az resource list -g "$resourceGroup" | jq .[].id | grep -i serverfarms

Expected Behavior

List out the created app service plan IDs.

Environment Summary

Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.31, Ubuntu 20.04.5 LTS
Python 3.10.5
Installer: DEB

azure-cli 2.40.0

Extensions:
account 0.2.3
authV2 0.1.1
azure-devops 0.25.0
kusto 0.5.0
support 1.0.3

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

The issue here is that there is a difference in output due to the somewhat recent change in case sensitivity for certain resource IDs.

The command az resource list -g "$resourceGroup" | jq .[].id | grep -i serverfarms only lists out ASPs that contain a capitalized "F" in the word "serverFarms" within the resource ID. Whereas the command az appservice plan list -g $resourceGroup | jq .[].id lists out resources with a lowercase "F" in the word "serverfarms" within the resource ID.

The interesting thing is that I don't have an issue with the second command due to the fact that it converts "serverFarms" to the current standard of "serverfarms" by default.

jaredbrogan avatar Sep 19 '22 20:09 jaredbrogan

route to CXP team

yonzhan avatar Sep 20 '22 00:09 yonzhan

@jaredbrogan Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.

navba-MSFT avatar Sep 20 '22 02:09 navba-MSFT

@jaredbrogan Please run the below command to List app service plans.

az appservice plan list

Examples:

az appservice plan list --query "[?sku.tier=='Free']" az appservice plan list --query "[?hostingEnvironmentProfile.name=='']" az appservice plan list [--resource-group]

More Info here. Please let me know if this helps.

navba-MSFT avatar Sep 20 '22 06:09 navba-MSFT

@jaredbrogan Please run the below command to List app service plans.

az appservice plan list

Examples:

az appservice plan list --query "[?sku.tier=='Free']" az appservice plan list --query "[?hostingEnvironmentProfile.name=='']" az appservice plan list [--resource-group]

More Info here. Please let me know if this helps.

Hi @navba-MSFT, As my post already stated, I'm aware of the suggested command. What I'm calling to attention is the fact that the az resource list command does not accurately output all App Service Plans when the ID doesn't specifically contain the word serverFarms with a capitalize letter "F".

jaredbrogan avatar Sep 20 '22 14:09 jaredbrogan

@jaredbrogan Thanks for getting back and clarifying the ask. I would like to do a repro at my end and debug this further. I don't have any resources with serverfarms (lower case f). May I know how did you create those serverfarms with lowercase f ?

navba-MSFT avatar Sep 21 '22 07:09 navba-MSFT

When using the portal, it will create a resource with an upper case F. Using either the azure cli or the latest azurerm terraform provider, they will create a resource with a lower case f.

However, it would now appear that the issue has been fixed...? This screenshot was taken the day this issue was posted: image

This was taken moments ago: image

The only difference between the 2 resources were the time they were provisioned, as I had deleted them after the screenshot was taken yesterday. The deployment methods remained the same.

Seems like something may have changed along the way on Azure's end?

jaredbrogan avatar Sep 21 '22 16:09 jaredbrogan

@jaredbrogan Thanks for getting back. There hasn't been any changes done from our end. I tried creating the service plan from Azure CLi, though the type returned in smaller case f, while querying the plan it did list with capitalized F. So I am unable to reproduce this issue.

Created using CLI:

az appservice plan create -g XXXXX -n navbaMyPlan --is-linux --number-of-workers 2 --sku S1

Output: { "isXenon": false, "kind": "linux", "kubeEnvironmentProfile": null, "location": "eastus", "maximumElasticWorkerCount": 2, "maximumNumberOfWorkers": 0, "name": "navbaMyPlan", "numberOfSites": 0, "numberOfWorkers": 2, "type": "Microsoft.Web/serverfarms" <------ Smaller case f }

Queried using az resource list: { "ID": "/subscriptions/XXXXXXXX/resourceGroups/XXXXXX/providers/Microsoft.Web/serverFarms/navbaMyPlan", "Name": "navbaMyPlan" }

If you are still able to reproduce this issue do let us know.

navba-MSFT avatar Sep 23 '22 05:09 navba-MSFT

At this point, it seems to be resolved, so you may close this out. I'll post again if I run into this once more. Thanks!

jaredbrogan avatar Sep 23 '22 17:09 jaredbrogan

@jaredbrogan Thanks for the update. We will now proceed with archival of this GitHub issue. If issue resurfaces in future, please feel free to reopen this thread. We would be happy to help.

navba-MSFT avatar Sep 26 '22 04:09 navba-MSFT