Azure / Azure/bicep

The property "location" does not exist in the resource definition for 'Microsoft.Web/sites/basicPublishingCredentialsPolicies@2021-03-01'

Open
#7,396 3 comments 0 reactions 0 assignees View on GitHub
provider bug types: swagger inaccuracy
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Bicep version**
Bicep CLI version 0.7.4 (5afc312467)
**Describe the bug**
The property "location" does not exist in the resource definition for 'Microsoft.Web/sites/basicPublishingCredentialsPolicies@2021-03-01'

**To Reproduce**
Running the following command doesn't work:

```powershell
new-azresourcegroupdeployment -Name functionApp -TemplateFile C:\scrap\functionApp\template.bicep -ResourceGroupName test-rg
```

With this bicep resource:

```bicep
resource sites_name_scm 'Microsoft.Web/sites/basicPublishingCredentialsPolicies@2021-03-01' = {
parent: sites_name_resource
name: 'scm'
properties: {
allow: true
}
}
```

Here is the error message:

```
New-AzResourceGroupDeployment: 11:38:25 - The deployment 'functionApp' failed with error(s). Showing 2 out of 2 error(s).
Status Message: The parameter location has an invalid value. (Code: BadRequest)
- The parameter location has an invalid value. (Code:)
- (Code:BadRequest)
- (Code:)
```

If I correct the resource with the location property:

```bicep
resource sites_name_ftp 'Microsoft.Web/sites/basicPublishingCredentialsPolicies@2021-03-01' = {
parent: sites_name_resource
location: location
name: 'ftp'
properties: {
allow: true
}
}
```

I get the warning that the location property does not exist in the resource definition but the deployment works fine:

```
new-azresourcegroupdeployment -Name functionApp -TemplateFile C:\scrap\functionApp\template.bicep -ResourceGroupName test-rg
WARNING: C:\scrap\functionApp\template.bicep(189,3) : Warning BCP187: The property "location" does not exist in the resource definition, although it might still be valid. If this is an inaccuracy in the documentation, please report it to the Bicep Team. [https://aka.ms/bicep-type-issues]
C:\scrap\functionApp\template.bicep(198,3) : Warning BCP187: The property "location" does not exist in the resource definition, although it might still be valid. If this is an inaccuracy in the documentation, please report it to the Bicep Team. [https://aka.ms/bicep-type-issues]

DeploymentName : functionApp
ResourceGroupName : test-rg
ProvisioningState : Succeeded
Timestamp : 2022-06-28 15:39:44
Mode : Incremental
TemplateLink :
Parameters :
Name Type Value
======================== ========================= ==========
sites_name String "iagburnumtest01-cac-asp-mtr-01"
serverfarms_externalid String
...
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the deployment with Bicep CLI 0.7.4 and the Microsoft.Web/sites/basicPublishingCredentialsPolicies@2021-03-01 resource shown in the issue. Trace how this resource type handles location during validation and deployment; done means the definition and deployment behavior agree without requiring an undocumented location property or producing an invalid-location error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.