The kind of a Cognitive Services Account (one of az cognitiveservices account list-kinds) cannot be changed after the account is created. However, the property is not marked up as immutable, e.g., via
"x-ms-mutability": [
"read",
"create"
],
As a result, programs and tools generated from the spec, like Pulumi, misleadingly let the user change the account kind which then fails at runtime.
Expected behavior
From the spec, a user or a tool parsing the spec should understand that kind cannot be changed. Pulumi, for instance, could report a suitable error to the user before even trying to make an Azure request.
Actual behavior
Users and tools are unaware of the immutability of kind and attempt to change it which fails at run time.
Reproduction Steps
Create an account with this payload (from the spec, CreateAccountMin.json):
API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/preview/2023-10-01-preview/cognitiveservices.json#L3125
API Spec version
2023-10-01-preview
Describe the bug
The kind of a Cognitive Services Account (one of
az cognitiveservices account list-kinds
) cannot be changed after the account is created. However, the property is not marked up as immutable, e.g., viaAs a result, programs and tools generated from the spec, like Pulumi, misleadingly let the user change the account kind which then fails at runtime.
Expected behavior
From the spec, a user or a tool parsing the spec should understand that
kind
cannot be changed. Pulumi, for instance, could report a suitable error to the user before even trying to make an Azure request.Actual behavior
Users and tools are unaware of the immutability of
kind
and attempt to change it which fails at run time.Reproduction Steps
Create an account with this payload (from the spec, CreateAccountMin.json):
Then, attempt to update it with a changed
kind
, which will fail. That is correct, but it means thekind
property should be annotated as immutable.Environment
No response