Azure / Azure/azure-quickstart-templates

additionalUnattendContent schema is invalid

Open
#2,101 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

The public Json schema for resource `Microsoft.Compute/virtualMachines` is invalid and causes spurious validation errors.
### Repro steps
1. Create a template with a resource of type `Microsoft.Compute/virtualMachines` with a `additionalUnattendContent` configuration field as follows:

```
"windowsConfiguration": {
"additionalUnattendContent": [
{
"passName": "oobeSystem",
"componentName": "Microsoft-Windows-Shell-Setup",
"settingName": "AutoLogon",
"content": "[parameters('autologonBlob')]"
}
]
}
```
2. Validate the JSON template against the official ARM schemas (for instance by loading the template file in VS Code or Visual Studio)
3. The IDE suggests to rename `passName` and `componentName` to `pass` and `component` as per following screenshot:
![image](https://cloud.githubusercontent.com/assets/3913258/16031247/f21beb4e-31ad-11e6-97a4-9890784384c4.png)
4. Fix the template as suggested
5. Deploy to Azure
6. You get the following deployment error

```
{
"error": {
"details": [
{
"target": "vm.properties.osProfile.windowsConfiguration.additionalUnattendContent[0].pass",
"message": "Could not find member 'pass' on object of type 'AdditionalUnattendContent'. Path 'properties.osProfile.windowsConfiguration.additionalUnattendContent[0].pass', line 1, position 1585."
},
{
"target": "vm.properties.osProfile.windowsConfiguration.additionalUnattendContent[0].component",
"message": "Could not find member 'component' on object of type 'AdditionalUnattendContent'. Path 'properties.osProfile.windowsConfiguration.additionalUnattendContent[0].component', line 1, position 1610."
}
],
"code": "BadRequest",
"message": "The request message is invalid."
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the public JSON schema for Microsoft.Compute/virtualMachines and inspect the additionalUnattendContent definition. Reproduce the validation with the template example, then verify that passName, componentName, settingName, and content are accepted and the deployed resource uses the same property names.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.