Install Bicep (Preview)
Learn how to set up Bicep development and deployment environments.
Development environment
To get the best Bicep authoring experience, you need two components:
- Bicep extension for Visual Studio Code. To create Bicep files, you need a good Bicep editor. We recommend Visual Studio Code with the Bicep extension. These tools provide language support and resource autocompletion. They help create and validate Bicep files. For more information about using Visual Studio Code and the Bicep extension, see Quickstart: Create Bicep files with Visual Studio Code.
- Bicep CLI. Use Bicep CLI to compile Bicep files to ARM JSON templates, and decompile ARM JSON templates to Bicep files. For the installation instructions, see Install Bicep CLI.
Deployment environment
To deploy local Bicep files, you need two components:
Azure CLI version 2.20.0 or later, or Azure PowerShell version 5.6.0 or later. For the installation instructions, see:
- Install Azure PowerShell
- Install Azure CLI on Windows
- Install Azure CLI on Linux
- Install Azure CLI on macOS
Note
Currently, both Azure CLI and Azure PowerShell can only deploy local Bicep files. For more information about deploying Bicep files by using Azure CLI, see Deploy - CLI. For more information about deploying Bicep files by using Azure PowerShell, see Deploy - PowerShell.
Bicep CLI. Bicep CLI is needed to compile Bicep files to JSON templates before deployment. For the installation instructions, see Install Bicep CLI.
After the components are installed, you can deploy a Bicep file with:
New-AzResourceGroupDeployment `
-Name ExampleDeployment `
-ResourceGroupName ExampleGroup `
-TemplateFile <path-to-template-or-bicep> `
-storageAccountType Standard_GRS
Install Bicep CLI
- To use Bicep CLI to compile and Decompile Bicep files, see Install manually.
- To use Azure CLI to deploy Bicep files, see Use with Azure CLI.
- To use Azure PowerShell to deploy Bicep files, see Use with Azure PowerShell.
Use with Azure CLI
With Azure CLI version 2.20.0 or later installed, the Bicep CLI is automatically installed when a command that depends on it is executed. For example:
az deployment group create --template-file azuredeploy.bicep --resource-group myResourceGroup
or
az bicep ...
You can also manually install the CLI using the built-in commands:
az bicep install
To upgrade to the latest version:
az bicep upgrade
To install a specific version:
az bicep install --version v0.3.255
Important
Azure CLI installs a separate version of the Bicep CLI that is not in conflict with any other Bicep installs you may have, and Azure CLI does not add Bicep CLI to your PATH. To use Bicep CLI to compile/decompile Bicep files, or to use Azure PowerShell to deploy Bicep files, see Install manually or Use with Azure Powershell.
To list all available versions of Bicep CLI:
az bicep list-versions
To show the installed versions:
az bicep version
Use with Azure PowerShell
Azure PowerShell does not have the capability to install the Bicep CLI yet. 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.
To deploy Bicep files, Bicep CLI version 0.3.1 or later is required. To check the Bicep CLI version:
bicep --version
Important
Azure CLI installs its own self-contained version of Bicep CLI. Azure PowerShell deployment fails even if you have the required versions installed for Azure CLI.
Once the Bicep CLI is installed, Bicep CLI is called whenever it is required for a deployment cmdlet. For example:
New-AzResourceGroupDeployment -ResourceGroupName myResourceGroup -TemplateFile azuredeploy.bicep
Install manually
The following methods install the Bicep CLI and add it to your PATH.
Linux
# Fetch the latest Bicep CLI binary
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64
# Mark it as executable
chmod +x ./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!
macOS
via homebrew
# Add the tap for bicep
brew tap azure/bicep
# Install the tool
brew install bicep
macOS manual install
# 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!
Windows
Windows Installer
Download and run the latest Windows installer. The installer does not require administrative privileges. After the installation, Bicep CLI is added to your user PATH. Close and reopen any opened command shell windows for the PATH change to take effect.
Chocolatey
choco install bicep
Winget
winget install -e --id Microsoft.Bicep
Manual with PowerShell
# 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!
Install the nightly builds
If you'd like to try the latest pre-release bits of Bicep before they are released, see Install nightly builds.
Warning
These pre-release builds are much more likely to have known or unknown bugs.
Next steps
Get started with the Bicep quickstart.