Azure / Azure/static-web-apps

Deploying Static Web Apps with password protection fails with error "Required property 'secretState' not found in JSON. Path 'properties', line 1, position 137."

Open
#1,756 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Bicep code:

```
resource staticsite 'Microsoft.Web/staticSites@2025-03-01' = {
name: 'mystaticsite'
location: 'eastus'
sku: {
name: 'Standard'
tier: 'Standard'
}
identity: {
type: 'SystemAssigned'
}
kind: 'windows'
properties: {
publicNetworkAccess: 'Disabled'
stagingEnvironmentPolicy: 'Enabled'
allowConfigFileUpdates: true
provider: 'DevOps'
enterpriseGradeCdnStatus: 'Disabled'
}
}

resource staticSites_basicAuth 'Microsoft.Web/staticSites/basicAuth@2025-03-01' = {
parent: staticsite
name: 'default'
properties: {
applicableEnvironmentsMode: 'AllEnvironments'
secretUrl: 'https://mykeyvault.vault.azure.net/secrets/mysecret'
}
}
```
az deployment will fail with message
`{"code":"BadRequest","message":"{\r\n \"errors\": {\r\n \"properties.secretState\": [\r\n \"Required property 'secretState' not found in JSON. Path 'properties', line 1, position 137.\"\r\n ]\r\n }`

**Expected behavior**
This should run without error.
Using
```
resource staticSites_basicAuth 'Microsoft.Web/staticSites/basicAuth@2025-03-01' = {
parent: staticsite
name: 'default'
properties: {
applicableEnvironmentsMode: 'AllEnvironments'
secretState: null
secretUrl: 'https://mykeyvault.vault.azure.net/secrets/mysecret'
}
}
```
gives `WARNING: /home/vsts/work/1/s/static-web-app.bicep(100,5) : Warning BCP073: The property "secretState" is read-only. Expressions cannot be assigned to read-only properties. If this is a resource type definition inaccuracy, report it using https://aka.ms/bicep-type-issues.`, but does not fail.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.