| title | BCP073 |
|---|---|
| description | The property <property-name> is read-only. Expressions cannot be assigned to read-only properties. |
| ms.topic | reference |
| ms.custom | devx-track-bicep |
| ms.date | 10/30/2025 |
This diagnostic occurs when you assign a value to a read-only property.
The property <property-name> is read-only. Expressions cannot be assigned to read-only properties.
Warning / Error
Remove the property assignment from the file.
The following example raises the diagnostic because sku can only be set on the storageAccounts level. It's read-only for services that are under a storage account like blobServices and fileServices.
param location string
resource storage 'Microsoft.Storage/storageAccounts@2023-04-01' = {
name: 'mystore'
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
}
resource blobService 'Microsoft.Storage/storageAccounts/blobServices@2023-04-01' = {
parent: storage
name: 'default'
sku: {}
}You can fix the issue by removing the sku property assignment:
param location string
resource storage 'Microsoft.Storage/storageAccounts@2023-04-01' = {
name: 'mystore'
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
}
resource blobService 'Microsoft.Storage/storageAccounts/blobServices@2023-04-01' = {
parent: storage
name: 'default'
}For more information about Bicep diagnostics, see Bicep core diagnostics.