To get the best Bicep authoring experience, you will need two components:
- Bicep CLI (required) - Compiles Bicep files into ARM templates. Cross-platform.
- Bicep VS Code Extension - Authoring support, intellisense, validation. Optional, but recommended.
- cross-plat
- via Az CLI
- via Az PowerShell (coming soon)
- Windows
- macOS
- Linux
- Nightly build (experimental)
Either inside of VS Code in the "Extensions" tab or in the Visual Studio marketplace, search for bicep
and follow the prompts to install.
To veryify the extension is installed, open any file with a .bicep
file extension. If the extension is properly installed, you should see the language mode
in the lower right corner of the VS code window change to bicep
.
Note: The Bicep VS code extension versions prior to v0.2 must be uninstalled before or after the installation of the new version. Otherwise, both extension versions will run side by side and you will see duplicated and/or inconsistent errors. Versions 0.2 or newer do not require uninstallation and will upgrade correctly.
Now that you have the tooling installed, you can start the tutorial which will teach you all of the Bicep capabilities:
1 - Working with a basic bicep file
If you already have the latest version of Az CLI installed (v2.20.0 or later), the Bicep CLI will automatically be installed when a command that depends on it is executed (az deployment ... -f *.bicep
or az bicep ...
).
You can also manually install the CLI using the built-in commands:
az bicep install
You can upgrade to the latest version:
az bicep upgrade
Or you can install a specific version:
az bicep install --version v0.2.212
Note: Az CLI will install a separate version of the Bicep CLI that will not conflict with any other Bicep installs you may have and Az CLI will not add Bicep to your PATH.
The Azure PowerShell module does not yet have the capability to install the Bicep CLI. Azure PowerShell (v5.6.0 or later) expects that the Bicep CLI is already installed and available on the PATH. Follow one of the manual install methods below. Once the Bicep CLI is installed, it will be called whenever it is required for a deployment cmdlet (i.e. New-AzResourceGroupDeployment ... -TemplateFile main.bicep
).
All of the following methods will install the Bicep CLI and add it to your PATH.
# Fetch the latest Bicep CLI binary
curl -Lo bicep.bin https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64
# Mark it as executable
chmod +x ./bicep.bin
# Add bicep to your PATH (requires admin)
sudo mv ./bicep.bin /usr/local/bin/bicep
# Verify you can now access the 'bicep' command
bicep --help
# Done!
# Add the tap for bicep
brew tap azure/bicep
# Install the tool
brew install bicep
# Fetch the latest Bicep CLI binary
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-osx-x64
# Mark it as executable
chmod +x ./bicep
# Add Gatekeeper exception (requires admin)
sudo spctl --add ./bicep
# Add bicep to your PATH (requires admin)
sudo mv ./bicep /usr/local/bin/bicep
# Verify you can now access the 'bicep' command
bicep --help
# Done!
- Download the latest Windows installer.
- Run the downloaded executable. The installer does not require administrative privileges.
- Step through the installation wizard.
- After the installation, Bicep CLI will be added to your user PATH. If you have any command shell windows open (
cmd
,PowerShell
, or similar), you will need to close and reopen them for the PATH change to take effect.
choco install bicep
winget install -e --id Microsoft.Bicep
# Create the install folder
$installPath = "$env:USERPROFILE\.bicep"
$installDir = New-Item -ItemType Directory -Path $installPath -Force
$installDir.Attributes += 'Hidden'
# Fetch the latest Bicep CLI binary
(New-Object Net.WebClient).DownloadFile("https://github.com/Azure/bicep/releases/latest/download/bicep-win-x64.exe", "$installPath\bicep.exe")
# Add bicep to your PATH
$currentPath = (Get-Item -path "HKCU:\Environment" ).GetValue('Path', '', 'DoNotExpandEnvironmentNames')
if (-not $currentPath.Contains("%USERPROFILE%\.bicep")) { setx PATH ($currentPath + ";%USERPROFILE%\.bicep") }
if (-not $env:path.Contains($installPath)) { $env:path += ";$installPath" }
# Verify you can now access the 'bicep' command.
bicep --help
# Done!
If you'd like to try the latest pre-release bits of Bicep before they are released, you can follow instructions for installing the nightly builds. Note, these builds are much more likely to have known or unknown bugs.