Skip to content

Commit 7c22113

Browse files
authored
Merge pull request #177380 from tfitzmac/1025existing
add NotFound error for existing
2 parents 209fd54 + f6a8896 commit 7c22113

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Describes the functions to use in a Bicep file to retrieve values a
44
author: mumian
55
ms.author: jgao
66
ms.topic: conceptual
7-
ms.date: 09/30/2021
7+
ms.date: 10/25/2021
88
---
99

1010
# Resource functions for Bicep
@@ -517,8 +517,9 @@ resource stg 'Microsoft.Storage/storageAccounts@2019-06-01' existing = {
517517
output blobAddress string = stg.properties.primaryEndpoints.blob
518518
```
519519

520-
For more information, see [Reference resources](./compare-template-syntax.md#reference-resources) and the [JSON template reference function](../templates/template-functions-resource.md#reference).
520+
If you attempt to reference a resource that doesn't exist, you get the `NotFound` error and your deployment fails.
521521

522+
For more information, see [Reference resources](./compare-template-syntax.md#reference-resources) and the [JSON template reference function](../templates/template-functions-resource.md#reference).
522523

523524
## resourceId
524525

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Describes how to declare resources to deploy in Bicep.
44
author: mumian
55
ms.author: jgao
66
ms.topic: conceptual
7-
ms.date: 10/19/2021
7+
ms.date: 10/25/2021
88
---
99

1010
# Resource declaration in Bicep
@@ -285,6 +285,8 @@ resource stg 'Microsoft.Storage/storageAccounts@2019-06-01' existing = {
285285
output blobEndpoint string = stg.properties.primaryEndpoints.blob
286286
```
287287

288+
If you attempt to reference a resource that doesn't exist, you get the `NotFound` error and your deployment fails.
289+
288290
For more information about setting the scope, see [Scope functions for Bicep](bicep-functions-scope.md).
289291

290292
The preceding examples don't deploy the storage account. Instead, you can access properties on the existing resource by using the symbolic name.

0 commit comments

Comments
 (0)