Skip to content

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

Description

@SamiKorhonen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions