Troubleshoot Bicep installation
This article describes how to resolve potential errors in your Bicep installation.
Visual Studio Code error
If you see the following error message popup in Visual Studio Code:
The Bicep server crashed 5 times in the last 3 minutes. The server will not be restarted.
From VS Code, open the Output view in the pane at the bottom of the screen, and then select Bicep:
If you see the following output in the pane, check whether you have added the dotnetAcquisitionExtension.existingDotnetPath
setting to VS Code. If this setting is present, remove it and restart VS Code. See User and Workspace Settings for configuring Visual Studio Code settings.
It was not possible to find any compatible framework version.
Otherwise, raise an issue in the Bicep repo, and include the output messages.
Multiple versions of Bicep CLI installed
If you manually install the Bicep CLI to more than one location, you may notice unexpected behavior such as the Bicep CLI not updating when you run the upgrade command. Or, you may notice that running az bicep version
returns one version, but bicep --version
returns a different version.
To resolve this issue, you can either update all locations, or select one location to maintain and delete the other locations.
First, open your command prompt (not PowerShell), and run where bicep
. This command returns the locations of your Bicep installations. If you're using the instance of Bicep CLI that is managed by Azure CLI, you won't see this installation because it's not added to the PATH. If where bicep
returns only one location, it may be that the conflicting versions you're seeing is between the manual installation and the Azure CLI installation.
To keep all installation locations, use the same method you used earlier to manually install the Bicep CLI for all locations you want to maintain. If you're using Azure CLI, run az bicep upgrade
to update that version.
To keep only one installation location, use the following steps:
- Delete the files for the installations you don't want to keep.
- Remove those locations from your PATH environment variable.
If you have both a manual installation and the instance managed by Azure CLI, you can combine your usage to one instance.
- Delete the manual installation location.
- Add the location of the Bicep CLI installed by Azure CLI to the PATH variable. For Windows, the location maintained by Azure CLI is
%USERPROFILE%\.Azure\bin
.
After adding the Azure CLI instance to the PATH, you can use that version with either az bicep
or bicep
.
Next steps
For more information about using Visual Studio Code and the Bicep extension, see Quickstart: Create Bicep files with Visual Studio Code.