Home > Software design >  New Azure Resources Show Up in Portal but not CLI
New Azure Resources Show Up in Portal but not CLI

Time:04-27

After running a DevOps pipeline that created several resources, only two (a new resource group and a Functions app) show up in Azure CLI using az ... list --subscription ....

Other resources, like Static Web Apps and a SQL Server don't show up in that list or when running az staticwebapp list --subscription ... or az sql server list --subscription ... with the subscription argument specified. I have confirmed that these resources DO show up in the portal, and my account is listed as an owner (inherited from subscription) for them in the portal.

CodePudding user response:

  • I have deployed Azure Static WebApp using Azure Devops.
  • Followed this MSDoc to publish the static web app.
  • By using,
az staticwebapp list --resource-group YourRGName

and

az staticwebapp list --subscription YourSubscriptionID

,Iam able to get the StaticWeb App list

enter image description here

enter image description here

CodePudding user response:

For anyone else running into this:

I have not found a solution to getting the az staticwebapp list command to work, as the results that show up immediately after creating a resource are just inconsistent. However, as a workaround that should satisfy most use cases, using this API (using az rest command) to find all resources associated with the group created by the pipeline, then filtering those down to find the Static Web App I want, seems to work.

Then, when using other APIs that reference that app before it shows up in the normal list, fully specifying subscription and resource group alongside the app's name seems to make things more reliable too.

As far as I can tell, this is probably just a limitation with the inconsistency of how long information about newly deployed resources takes to propagate that shows up when trying to find a resource immediately after creating it.

  • Related