Azure / Azure/azure-rest-api-specs

[BUG] `Microsoft.CognitiveServices/accounts` - `AllowProjectManagement` not set to `false` for `AIServices` to `OpenAI` rollback scenario

Open
#38,678 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeSpec
Stars
3.1k
Forks
6k
Avg merge
2d 21h
Merged PRs (30d)
432

Description

API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/d752b87f59f917963d183b9de20677aadf9a965f/specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-06-01/cognitiveservices.json#L5230

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:

  1. With kind=OpenAI to create Open AI account.
  2. Change kind to AIServices to upgrade to Azure AI Foundry account. Set project_management_enabled to true.
  3. Change kind to OpenAI to rollback to Open AI Account. Set project_management_enabled to false.
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.

Image Image
Environment

Terraform

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.