|
| 1 | +--- |
| 2 | +title: Set up Bicep development and deployment environments |
| 3 | +description: How to configure Bicep development and deployment environments |
| 4 | +ms.topic: conceptual |
| 5 | +ms.date: 10/20/2021 |
| 6 | +ms.custom: devx-track-azurepowershell, devx-track-azurecli |
| 7 | +--- |
| 8 | + |
| 9 | +# Troubleshoot Bicep installation |
| 10 | + |
| 11 | +This article describes how to resolve potential errors in your Bicep installation. |
| 12 | + |
| 13 | +## .NET runtime error |
| 14 | + |
| 15 | +When installing the Bicep extension for Visual Studio Code, you may run into the following error messages: |
| 16 | + |
| 17 | +```error |
| 18 | +Failed to install .NET runtime v5.0 |
| 19 | +``` |
| 20 | + |
| 21 | +```error |
| 22 | +Failed to download .NET 5.0.x ....... Error! |
| 23 | +``` |
| 24 | + |
| 25 | +To solve the problem, you can manually install .NET from the [.NET website](https://aka.ms/dotnet-core-download), and then configure Visual Studio Code to reuse an existing installation of .NET. with the following settings: |
| 26 | + |
| 27 | +**Windows** |
| 28 | + |
| 29 | +```json |
| 30 | +"dotnetAcquisitionExtension.existingDotnetPath": [ |
| 31 | + { |
| 32 | + "extensionId": "ms-azuretools.vscode-bicep", |
| 33 | + "path": "C:\\Program Files\\dotnet\\dotnet.exe" |
| 34 | + } |
| 35 | +] |
| 36 | + |
| 37 | +``` |
| 38 | + |
| 39 | +**macOS** |
| 40 | + |
| 41 | +```json |
| 42 | +"dotnetAcquisitionExtension.existingDotnetPath": [ |
| 43 | + { |
| 44 | + "extensionId": "ms-azuretools.vscode-bicep", |
| 45 | + "path": "/usr/local/share/dotnet/dotnet" |
| 46 | + } |
| 47 | +] |
| 48 | +``` |
| 49 | + |
| 50 | +See [User and Workspace Settings](https://code.visualstudio.com/docs/getstarted/settings) for configuring Visual Studio Code settings. |
| 51 | + |
| 52 | +## Two versions of Bicep CLI installed |
| 53 | + |
| 54 | +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](bicep-cli.md#upgrade). Or, you may notice that running `az bicep version` returns one version, but `bicep --version` returns a different version. |
| 55 | + |
| 56 | +To resolve this issue, you can either update both locations, or delete one location and add the other location to your path. |
| 57 | + |
| 58 | +To **keep both installation locations**, use `az bicep upgrade` to update one version. For the other version, use the same method you used earlier to [manually install the Bicep CLI](install.md#install-manually). |
| 59 | + |
| 60 | +To **keep only one installation location**, use the following steps: |
| 61 | + |
| 62 | +1. Open your command prompt (not PowerShell), and run `where bicep`. This command returns the location of the Bicep installation. |
| 63 | +1. Delete the installation that was returned in the previous step. |
| 64 | +1. Remove the location from your **PATH** environment variable. |
| 65 | +1. Add your other installation location to the **PATH** variable. Use the location maintained by Azure CLI. For Windows, the location is `%USERPROFILE%\.Azure\bin`. |
| 66 | + |
| 67 | +## Next steps |
| 68 | + |
| 69 | +For more information about using Visual Studio Code and the Bicep extension, see [Quickstart: Create Bicep files with Visual Studio Code](./quickstart-create-bicep-use-visual-studio-code.md). |
0 commit comments