Template schema not supported for targetScope = 'desiredStateConfiguration'
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
**Bicep version**
Bicep CLI version 0.34.48 (e4324d410e) from #16685 ( [artifact feed](https://github.com/Azure/bicep/actions/runs/14046340801/job/39327881528#step:5:30) )
**Describe the bug**
After enabling the experimental feature for DSC and adding the file to Azure Portal, a "Template schema not supported"-error occurs during validation.
**To Reproduce**
- enable the desiredStateConfiguration experimental feature in `bicepconfig.json`,
- build an example Bicep `dsc.bicep` file using the `targetScope = 'desiredStateConfiguration'`
- open Azure Portal's 'Deploy a custom template'-service, select the `dsc.json` template, and try to validate
> {"code":"InvalidTemplate","message":"Deployment template validation failed: 'Template schema 'https://aka.ms/dsc/schemas/v3/bundled/config/document.json' is not supported. Supported versions are '2014-04-01-preview,2015-01-01,2018-05-01,2019-04-01,2019-08-01'. Please see https://aka.ms/arm-syntax for usage details.'."}
**Additional context**
Goal is to move from PSDSC to DSC. Probably I'm overlooking something basic, but what could it be?
Recently, in #16389 this was added as an experimental feature, and in #16685 the schema was changed.
Example file `bicepconfig.json`
```json
{
"experimentalFeaturesEnabled": {
"desiredStateConfiguration": true
}
}
```
Example file `dsc.bicep`
```bicep
targetScope = 'desiredStateConfiguration'
resource powershellAdapter 'Microsoft.Windows/WindowsPowerShell@2025-01-07' = {
name: 'Run WinPS script'
properties: {
resources: [
{
name: 'Run script'
type: 'PSDesiredStateConfiguration/Script'
properties: {
Name: 'ComputerManagementDsc'
IsSingleInstance: 'Yes'
TimeZone: 'W. Europe Standard Time'
}
}
]
}
}
```
Example file `dsc.json`
```json
{
"$schema": "https://aka.ms/dsc/schemas/v3/bundled/config/document.json",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.34.48.58418",
"templateHash": "5123182227474300147"
}
},
"resources": [
{
"type": "Microsoft.Windows/WindowsPowerShell",
"apiVersion": "2025-01-07",
"name": "Run WinPS script",
"properties": {
"resources": [
{
"name": "Run script",
"type": "PSDesiredStateConfiguration/Script",
"properties": {
"Name": "ComputerManagementDsc",
"IsSingleInstance": "Yes",
"TimeZone": "W. Europe Standard Time"
}
}
]
}
}
]
}
```
Contributor guide
Research direction
Start with bicepconfig.json and dsc.bicep, build the example, and inspect the generated dsc.json. Then reproduce validation in Azure Portal's Deploy a custom template service and compare the emitted schema with the schemas that validation supports. Done means the incompatibility is explained and a supported validation path or required project change is clearly identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100