Azure / Azure/azure-rest-api-specs
Microsoft.Web/sites properties state should not be read-only
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
According to the Bicep type definition of `Microsoft.Web/sites@2022-01-01` the `state` field in `properties` is read-only. (This
See:
https://github.com/Azure/bicep-types-az/blob/main/generated/web/microsoft.web/2022-09-01/types.md#siteproperties
and:
I followed their guidance (https://github.com/Azure/bicep-types-az/blob/main/docs/troubleshooting.md#api-spec-swagger-inaccuracies) and saw the corresponding swagger definition line:
https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/web/resource-manager/Microsoft.Web/stable/2022-09-01/WebApps.json#L28460
However, prompted by this SO answer when attempting to deploy an Azure Function App in a "Stopped" state https://stackoverflow.com/a/67699248/2847307 I set the value to "Stopped" and, sure enough the (pre-existing) FunctionApp updated from Running to Stopped. I changed the value to "Running" and sure enough, the Status of the function app in Azure Portal changed to "Running".

Therefore I conclude that the property is not read-only and should not be marked as such!
Can you update the definition & possibly prompt the Azure documentation to show its usage?
Cheers,
Greg
Contributor guide
Research direction
Start with the referenced WebApps.json line for the Microsoft.Web/sites properties state field, then compare its generated representation in the linked bicep-types-az types.md. Confirm the field's read-only metadata and how the generated definition is produced. Done means the API specification and generated type agree that state is writable, with any requested documentation usage addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, openapi
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100