Azure / Azure/azure-rest-api-specs
[BUG] `Microsoft.CognitiveServices/accounts` - `AllowProjectManagement` not set to `false` for `AIServices` to `OpenAI` rollback scenario
Nobody has claimed this yet.
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 6k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 432
Description
API Spec link
API Spec version
2025-06-01
Describe the bug
The cognitive account API provides an option to upgrade from Open AI account (kind=OpenAI) to Azure AI Foundry account (kind=AIServices) and rollback (AIServices -> OpenAI).
Now, the allowProjectManagement attribute is only applicable for Azure AI Foundry and specifies whether the resource support project management as child resources. So, when upgrading from OpenAI to AIServices, this attribute is set to true.
Expected behavior
For the rollback scenarios (AIServices -> OpenAI), the allowProjectManagement should be set to false in the API response as it's not applicable to OpenAI at all.
Actual behavior
During the rollback, even if this property is explicitly set to false, it's set to true in the API response.
This behaviour causes state mismatch within Terraform.
Reproduction Steps
Use the below configuration and run it in 3 steps:
- With kind=
OpenAIto create Open AI account. - Change kind to
AIServicesto upgrade to Azure AI Foundry account. Setproject_management_enabledtotrue. - Change kind to
OpenAIto rollback to Open AI Account. Setproject_management_enabledtofalse.
provider "azurerm" {
features {}
}
variable "location" {
description = "Azure region to create resources in"
type = string
default = "eastus"
}
variable "kind" {
description = "Kind of Cognitive Services account"
type = string
default = "OpenAI"
}
variable "rg_name" {
description = "Resource Group name"
type = string
default = "rg-ap-cognitive-services"
}
resource "azurerm_resource_group" "rg" {
name = var.rg_name
location = var.location
tags = {
environment = "demo"
owner = "infra"
}
}
resource "azurerm_cognitive_account" "cog_account" {
name = "aiservicesdemo01"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
sku_name = "S0"
kind = var.kind
custom_subdomain_name = "aiservicesdemo01"
project_management_enabled = false
tags = {
project = "ai-services-demo"
}
identity {
type = "SystemAssigned"
}
}
Check the response status to confirm that project_management_enabled is still returned as true.
Environment
Terraform
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/cognitiveservices.json at the linked account definition, then reproduce the three-step Terraform upgrade and rollback. Determine how the API spec should represent allowProjectManagement for an OpenAI account; done means the rollback response returns false and Terraform no longer reports a state mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, terraform
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100