title | description | author | ms.author | keywords | ms.topic | ms.date | ms.service | ms.custom |
---|---|---|---|---|---|---|---|---|
Troubleshoot Azure Developer CLI (preview) |
In this article, troubleshoot common problems that might occur when you're using Azure Developer CLI. |
alexwolfmsft |
alexwolf |
azd, known issues, troubleshooting, azure developer cli |
troubleshooting |
01/03/2023 |
azure-dev-cli |
devx-track-azdevcli |
This article provides solutions to common problems that might arise when you're using Azure Developer CLI (azd) Preview.
If you're unable to find what you're looking for in this article or you want to provide feedback, you can post questions to Azure Developer CLI Discussions.
You can also report bugs by opening GitHub Issues in the Azure Developer CLI GitHub repository.
Azure Developer CLI assumes that any directories that are stored in the .azure
directory are Azure Developer CLI environments. Don't run Azure Developer CLI commands from the home directory of a user that has the Azure CLI installed.
After you've run azd init -t <template-name>
in Visual Studio, you get the following error: "To access remote: this repository, you must reauthorize the OAuth Application Visual Studio
."
Run azd login
to refresh the access token.
Cloud Shell uses a container to host your shell environment, so tasks that require running the Docker daemon aren't allowed.
Use another host to perform tasks that require the docker daemon. One option is to use docker-machine, as described in the Cloud Shell troubleshooting documentation.
azd up
and azd provision
require the latest release of Azure Bicep CLI. You might get the following error message: "Error: failed to compile bicep template: failed running Az PowerShell module bicep build: exit code: 1, stdout: , stderr: WARNING: A new Bicep release is available: v0.4.1272."
Upgrade Bicep CLI by running az bicep upgrade
.
Things can sometimes go awry with azd up
or azd provision
. Common errors include:
- "Can't provision certain resources in an Azure region because the region is out of capacity."
- "Relevant resource provider isn't present in that region."
The troubleshooting steps might differ, depending on the root cause.
-
Go to the Azure portal.
-
Locate your resource group, which is rg-<your-environment-name>.
-
Select Deployments to get more information.
-
Verify that you've specified an environment name that's the same as your environment name.
-
Go to
https://github.com/<your repo>/actions
, and then refer to the log file in the pipeline run for more information.
For other resources, see Troubleshoot common Azure deployment errors - Azure Resource Manager.
Before azd version = azure-dev-cli_0.2.0-beta.1
, azd
would create an .azd
folder with drw-r--r--
access.
This will cause an issue, as using this or any prior version on any Linux set-up (WSL, ssh-remote, devcontainer, etc.) already provides an .azd
folder with read-only mode.
-
Manually delete the already provided
.azd
folder:rm -r ~/.azd
-
Run
azd init
forazd
to create the folder again with the right access levels.
azd monitor
is currently not supported if you use a development container as your development environment.
Text-based browsers are currently not supported by azd monitor
.
You may encounter a failure when running azd pipeline config
with AzDo for Java templates on Windows. For example, you've:
-
Run the following on Windows:
azd init --template Azure-Samples/todo-java-mongo azd pipeline config
-
Received the following error:
:::image type="content" source="media/troubleshoot/error-pipeline.png" alt-text="Screenshot showing the error received when running azd pipeline config with AzDo for Java on Windows.":::
This is a known issue. While we address this issue, try the following command:
git update-index --chmod=+x src/api/mvnw && git commit -m "Fix executable bit permissions" && git push
When running azd pipeline config
, you may receive an error like the following:
ERROR: failed to create or update service principal: failed retrieving application list, failed executing request: http call(https://login.microsoftonline.com/common/oauth2/v2.0/token)(POST) error: reply status code was 400:
{"error":"invalid_grant","error_description":"AADSTS50005: User tried to log in to a device from a platform (Unknown) that's currently not supported through Conditional Access policy. Supported device platforms are: iOS, Android, Mac, and Windows flavors.\r\nTrace ID: be3438c1-42fc-4c37-96d8-0e723ac54f01\r\nCorrelation ID: f535565f-9f3c-4014-ad65-403f514bf892\r\nTimestamp: 2022-12-16 21:10:37Z","error_codes":[50005],"timestamp":"2022-12-16 21:10:37Z","trace_id":"be3438c1-42fc-4c37-96d8-0e723ac54f01","correlation_id":"f535565f-9f3c-4014-ad65-403f514bf892"}
This error is related to your Azure Active Directory's tenant enablement of Conditional Access Policies. The specific policy requires that you are signed in into a supported device platform.
You may also be receiving this error due to being logged in using the device code mechanism, which prevents Azure Active Directory from detecting your device platform correctly.
-
Make sure you're running on a device listed as supported, per the error message.
-
Rerun
azd login
with the flag--use-device-code=false
appended:azd login --use-device-code=false
[!NOTE] If running CodeSpaces in the browser, you may receive an error with message
localhost refused to connect
after logging in. If so:- Copy the URL.
- Run
curl '<pasted url>'
(URL in quotes) in a new Visual Studio Code terminal.
In the original terminal, the login should now succeed.
-
After logging in, rerun
azd pipeline config
.
azd pipeline config
is currently not supported in DevContainers/VS Code Remote Containers.
Live Metrics (azd monitor --live
) is currently not supported for Python apps. For more information, see Live Metrics: Monitor and diagnose with 1-second latency.