Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.

Home Page:https://aka.ms/azd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Issue] Can't get environment outputs when doing `azd env select` in devcenter mode

markweitzel opened this issue · comments

In devcenter mode, I do an azd env select <envname> and when this occurs, an error is returned and the environment does not get set correctly.

image

We failed to discover the outputs here because we could not find the corresponding ARM deployment in the deployment history for the resource group attached to the environment. That failed because there was a mismatch between what was in azure.yaml for platform.config.environmentType (which was Test) and what was tagged in the deployment object we intended to find (which was Dev).

I asked @markweitzel offline if he knew how these might have gotten out of sync.

It may be reasonable to say that you can azd env select an environment even if we couldn't find the corresponding deployment (I'll leave that as a question for @wbreza when he gets back, we allow this today outside of dev center mode) but even if we were to allow this azd env refresh would fail later in the end to end for @markweitzel's specific scenario, since there we really do need the deployment object to fetch the outputs.

After making the change to azure.yaml I was able to azd env select the environment and run azd env refresh.

This is not intentional. It looks like it is comparing the environment of the currently selected project instead of the matched remote ADE environments.