You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/bicep-cli.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@
2
2
title: Bicep CLI commands and overview
3
3
description: Describes the commands that you can use in the Bicep CLI. These commands include building Azure Resource Manager templates from Bicep.
4
4
ms.topic: conceptual
5
-
ms.date: 10/18/2021
5
+
ms.date: 11/19/2021
6
6
---
7
7
# Bicep CLI commands
8
8
9
9
This article describes the commands you can use in the Bicep CLI. You must have the [Bicep CLI installed](./install.md) to run the commands.
10
10
11
-
This article shows how to run the commands in Azure CLI. If you're not using Azure CLI, run the commands without `az` at the start of the command. For example, `az bicep version` becomes ``bicep version``.
11
+
You can either run the Bicep CLI commands through Azure CLI or by calling Bicep directly. This article shows how to run the commands in Azure CLI. When running through Azure CLI, you start the commands with `az`. If you're not using Azure CLI, run the commands without `az` at the start of the command. For example, `az bicep build` becomes `bicep build`.
12
12
13
13
## build
14
14
@@ -68,7 +68,7 @@ For more information about using this command, see [Decompiling ARM template JSO
68
68
69
69
## install
70
70
71
-
The `install` command adds the Bicep CLI to your local environment. For more information, see [Install Bicep tools](install.md).
71
+
The `install` command adds the Bicep CLI to your local environment. For more information, see [Install Bicep tools](install.md). This command is only available through Azure CLI.
72
72
73
73
To install the latest version, use:
74
74
@@ -84,7 +84,7 @@ az bicep install --version v0.3.255
84
84
85
85
## list-versions
86
86
87
-
The `list-versions` command returns all available versions of the Bicep CLI. Use this command to see if you want to [upgrade](#upgrade) or [install](#install) a new version.
87
+
The `list-versions` command returns all available versions of the Bicep CLI. Use this command to see if you want to [upgrade](#upgrade) or [install](#install) a new version. This command is only available through Azure CLI.
88
88
89
89
```azurecli
90
90
az bicep list-versions
@@ -141,12 +141,12 @@ The `publish` command doesn't recognize aliases that you've defined in a [bicepc
141
141
142
142
When your Bicep file uses modules that are published to a registry, the `restore` command gets copies of all the required modules from the registry. It stores those copies in a local cache. A Bicep file can only be built when the external files are available in the local cache. Typically, you don't need to run `restore` because it's called automatically by `build`.
143
143
144
-
To use the restore command, you must have Bicep CLI version **0.4.1008 or later**.
144
+
To use the restore command, you must have Bicep CLI version **0.4.1008 or later**. This command is currently only available when calling the Bicep CLI directly. It's not currently available through the Azure CLI command.
145
145
146
146
To manually restore the external modules for a file, use:
147
147
148
-
```azurecli
149
-
az bicep restore <bicep-file>
148
+
```powershell
149
+
bicep restore <bicep-file>
150
150
```
151
151
152
152
The Bicep file you provide is the file you wish to deploy. It must contain a module that links to a registry. For example, you can restore the following file:
@@ -168,7 +168,7 @@ The local cache is found at:
168
168
169
169
## upgrade
170
170
171
-
The `upgrade` command updates your installed version with the latest version.
171
+
The `upgrade` command updates your installed version with the latest version. This command is only available through Azure CLI.
172
172
173
173
```azurecli
174
174
az bicep upgrade
@@ -185,7 +185,13 @@ az bicep version
185
185
The command shows the version number.
186
186
187
187
```azurecli
188
-
Bicep CLI version 0.4.1 (e2387595c9)
188
+
Bicep CLI version 0.4.1008 (223b8d227a)
189
+
```
190
+
191
+
To call this command directly through the Bicep CLI, use:
192
+
193
+
```powershell
194
+
bicep --version
189
195
```
190
196
191
197
If you haven't installed Bicep CLI, you see an error indicating Bicep CLI wasn't found.
0 commit comments