| title | BCP040 |
|---|---|
| description | String interpolation is not supported for keys on objects of type <type-definition>. |
| ms.topic | reference |
| ms.custom | devx-track-bicep |
| ms.date | 10/30/2025 |
This diagnostic occurs when the Bicep compiler can't determine the exact value of an interpolated string key.
String interpolation is not supported for keys on objects of type <type-definition>.
Warning / Error
Remove string interpolation.
The following example raises the diagnostic because string interpolation is used for specifying the key sku1:
var name = 'sku'
type storageAccountConfigType = {
name: string
sku1: string
}
param foo storageAccountConfigType = {
name: 'myStorage'
'${name}1': 'Standard_LRS'
}You can fix the issue by adding the missing properties:
var name = 'sku'
type storageAccountConfigType = {
name: string
sku1: string
}
param foo storageAccountConfigType = {
name: 'myStorage'
sku1: 'Standard_LRS'
}For more information about Bicep diagnostics, see Bicep core diagnostics.