Skip to content

Commit 9995d23

Browse files
committed
split installation troubleshooting
1 parent bca3b4e commit 9995d23

File tree

3 files changed

+75
-39
lines changed

3 files changed

+75
-39
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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).

articles/azure-resource-manager/bicep/install.md

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Set up Bicep development and deployment environments
33
description: How to configure Bicep development and deployment environments
44
ms.topic: conceptual
5-
ms.date: 10/20/2021
5+
ms.date: 11/18/2021
66
ms.custom: devx-track-azurepowershell, devx-track-azurecli
77
---
88

@@ -27,44 +27,7 @@ To verify you've installed the extension, open any file with the `.bicep` file e
2727

2828
:::image type="content" source="./media/install/language-mode.png" alt-text="Bicep language mode":::
2929

30-
### Troubleshoot
31-
32-
When installing the Bicep extension for Visual Studio Code, you may run into the following error messages:
33-
34-
```error
35-
Failed to install .NET runtime v5.0
36-
```
37-
38-
```error
39-
Failed to download .NET 5.0.x ....... Error!
40-
```
41-
42-
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:
43-
44-
**Windows**
45-
46-
```json
47-
"dotnetAcquisitionExtension.existingDotnetPath": [
48-
{
49-
"extensionId": "ms-azuretools.vscode-bicep",
50-
"path": "C:\\Program Files\\dotnet\\dotnet.exe"
51-
}
52-
]
53-
54-
```
55-
56-
**macOS**
57-
58-
```json
59-
"dotnetAcquisitionExtension.existingDotnetPath": [
60-
{
61-
"extensionId": "ms-azuretools.vscode-bicep",
62-
"path": "/usr/local/share/dotnet/dotnet"
63-
}
64-
]
65-
```
66-
67-
See [User and Workspace Settings](https://code.visualstudio.com/docs/getstarted/settings) for configuring Visual Studio Code settings.
30+
If you get an error during installation, see [Troubleshoot Bicep installation](install-troubleshooting.md).
6831

6932
## Deployment environment
7033

@@ -111,6 +74,8 @@ For more commands, see [Bicep CLI](bicep-cli.md).
11174
> [!IMPORTANT]
11275
> Azure CLI installs a self-contained instance of the Bicep CLI. This instance doesn't conflict with any versions you may have manually installed. Azure CLI doesn't add Bicep CLI to your PATH.
11376
77+
You're done with setting up your Bicep environment. The rest of this article describes installation steps that you don't need when using Azure CLI.
78+
11479
## Azure PowerShell
11580

11681
You must have Azure PowerShell version **5.6.0 or later** installed. To update or install, see [Install Azure PowerShell](/powershell/azure/install-az-ps).

articles/azure-resource-manager/bicep/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
- name: Install Bicep tools
1313
href: install.md
1414
displayName: nightly
15+
- name: Troubleshoot installation
16+
href: install-troubleshooting.md
1517
- name: Quickstarts
1618
items:
1719
- name: Create Bicep templates - VS Code

0 commit comments

Comments
 (0)