Microsoft.Web/sites/config: Inconsistent properties parameter type
- Dominant language
- TypeScript
- Stars
- 108
- Forks
- 44
- Avg merge
- 18h 53m
- Merged PRs (30d)
- 29
Description
### Resource Type
Microsoft.Web/sites/config
### Api Version
2022-09-01
### Issue Type
Inaccurate property type(s)
### Other Notes
When you deploy a site, the settings of the web application expect to have value ```NameValuePair[]```, nevertheless when you try to only alter settings it expects ```StringDictionaryProperties``` type.
### Bicep Repro
Setting Type
```bicep
@export()
type setting = {
name: string
value: string
}
```
Sites Deployment
```bicep
import { setting } from '../Core/Types/setting.type.bicep'
// Omitted parameters
@description('The app service appSettings.')
param appSettings setting[] = []
resource webApp 'Microsoft.Web/sites@2022-09-01' = {
name: standarizedName
location: location
kind: kind
identity: {
type: 'SystemAssigned'
}
properties: {
serverFarmId: serverFarmId
siteConfig: {
appSettings: appSettings // No complain
}
}
tags: tags
}
```
Trying to make incremental update of appsettings
```bicep
param appSettings setting[] = []
param webAppName string
resource webApp 'Microsoft.Web/sites@2022-09-01' existing = {
name: webAppName
}
var currentAppSettings = list('${webApp.id}/config/appsettings', '2022-09-01').properties
resource siteconfig 'Microsoft.Web/sites/config@2022-09-01' = {
name: 'appsettings'
kind: 'string'
parent: webApp
properties: union(currentAppSettings, appSettings) // <-- This complains:
// The property "properties" expected a value of type
// "StringDictionaryProperties | null" but the provided value is of type "array".
// If this is an inaccuracy in the documentation,
// please report it to the Bicep Team. bicep(https://aka.ms/bicep-type-issues)
}
```
### Confirm
- [X] I have read the troubleshooting guide and looked for duplicates.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the type definition for Microsoft.Web/sites/config at API version 2022-09-01 and compare its appsettings properties with the siteConfig.appSettings shape shown in the Bicep repro. Verify the incremental update case using list(.../config/appsettings).properties and union(...), then confirm the definition accepts the intended NameValuePair[] value without weakening the deployment shape.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100