Skip to content

Commit 6308c85

Browse files
authored
Merge pull request #203538 from mumian/0511-bicep-restore
explain restore by force
2 parents 3a953c0 + 37b06ad commit 6308c85

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Bicep CLI commands and overview
33
description: Describes the commands that you can use in the Bicep CLI. These commands include building Azure Resource Manager templates from Bicep.
44
ms.topic: conceptual
5-
ms.date: 03/15/2022
5+
ms.date: 06/30/2022
66
---
77

88
# Bicep CLI commands
@@ -41,6 +41,9 @@ az bicep build --file main.bicep --stdout
4141

4242
If your Bicep file includes a module that references an external registry, the build command automatically calls [restore](#restore). The restore command gets the file from the registry and stores it in the local cache.
4343

44+
> [!NOTE]
45+
> The restore command doesn't refresh the cache. For more information, see [restore](#restore).
46+
4447
To not call restore automatically, use the `--no-restore` switch:
4548

4649
```azurecli
@@ -149,7 +152,7 @@ To use the restore command, you must have Bicep CLI version **0.4.1008 or later*
149152
To manually restore the external modules for a file, use:
150153

151154
```powershell
152-
bicep restore <bicep-file>
155+
bicep restore <bicep-file> [--force]
153156
```
154157

155158
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:
@@ -177,6 +180,8 @@ The local cache is found in:
177180
/home/<username>/.bicep
178181
```
179182
183+
The `restore` command doesn't refresh the cache if a module is already cached. To fresh the cache, you can either delete the module path from the cache or use the `--force` switch with the `restore` command.
184+
180185
## upgrade
181186
182187
The `upgrade` command updates your installed version with the latest version. This command is only available through Azure CLI.

0 commit comments

Comments
 (0)