Azure / Azure/azure-rest-api-specs

[BUG][Resource Graph] Resource Graph API returns inconsistent casing for the resource group name in the 'id' field when query the resources with type Microsoft.CognitiveServices/accounts

Open
#31,379 1 comment 1 reaction 0 assignees View on GitHub
bug customer-reported Mgmt Resource Graph Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

### API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2024-04-01/resourcegraph.json#L37

### API Spec version

2024-04-01

### Describe the bug

The casing of the 'id' field is being inconsistently returned when query the resources with type Microsoft.CognitiveServices/accounts with Resource Graph API, when it contains upper case letters.
For example, using a resource group named 'BA-Test', firstly the 'id' field is returned with this in mixed case (/resourceGroups/BA-Test/) and after deploy a model in the AI Service, it would become lower case (/resourceGroups/ba-test/).

### Expected behavior

Response to have consistent casing for the resource group in the 'id' field, every time, preferably the mixed casing to match the console.

### Actual behavior

Resource group name in the 'id' field in the response would turn into lower case once deploy a model in the AI Service and turn back to mixed case once the deployed model removed.

### Reproduction Steps

API: https://learn.microsoft.com/en-us/rest/api/azureresourcegraph/resourcegraph/resources/resources?view=rest-azureresourcegraph-resourcegraph-2024-04-01
Request body: `"query": "Resources | project id, name, type, resourceGroup | where type =~ 'Microsoft.CognitiveServices/accounts'"`
Steps:

1. Create an Azure AI Services resource in the console using a mixed case resource group (for example BA-Test)

2. Call the api and the print out for the relevant resource will (most likely) be:
> /subscriptions/my-sub-id/resourceGroups/BA-Test/providers/Microsoft.CognitiveServices/accounts/casing-test
> ba-test

3. Navigate to AI Studio from this resource and deploy a model (i used gpt-4). Then call the api with same body and response is likely to be:
> /subscriptions/my-sub-id/resourceGroups/ba-test/providers/Microsoft.CognitiveServices/accounts/casing-test
> ba-test

### Environment

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2024-04-01/resourcegraph.json at the referenced line, then reproduce the query through the Resource Graph API endpoint before and after deploying a model. Compare the resource ID casing in both responses; done means the issue's expected consistent resource-group casing is addressed or the required specification change is clearly identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
api, cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.