Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Azure OpenAI] Rai Blocklist Item API Get - 400 Bad Request #31986

Open
feliperezende-barbosa opened this issue Jan 2, 2025 · 1 comment
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Mgmt This issue is related to a management-plane library.

Comments

@feliperezende-barbosa
Copy link

feliperezende-barbosa commented Jan 2, 2025

API Spec link

https://learn.microsoft.com/en-us/rest/api/aiservices/accountmanagement/rai-blocklist-items/get?view=rest-aiservices-accountmanagement-2024-10-01&tabs=HTTP

API Spec version

2024-10-01

Describe the bug

Rai Blocklist Item that supports Azure OpenAI Content Filter has APIs to List, CreateOrUpdate, Get and so on. Rai Blocklist Item Get (link) which passes parameters such as subscriptionId, resourceGroupName, accountName, raiBlocklistName and raiBlocklistItemName. The response should be the properties of the Rai Blocklist Item such as isRegex and pattern. The point is when calling the API using Postman or even directly in this link and you can hit (Try it). The response is always 400 Bad Request. If I provide a wrong Rai Blocklist Item Name, the expected response should be 404 Not Found but again the response is 400 Bad Request. This is not the expected behavior of the API.

2024/12/30 15:28:31 failed to finish the request: GET https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.CognitiveServices/accounts/<accountName>/raiBlocklists/<raiBlocklistName>/raiBlocklistItems/<raiBlocklistItemName>
--------------------------------------------------------------------------------
RESPONSE 400: 400 Bad Request
ERROR CODE UNAVAILABLE
--------------------------------------------------------------------------------
Response contained no body
--------------------------------------------------------------------------------
exit status 1

Expected behavior

The expected behavior is if the rai blocklist item name is not found it should be 404 Not Found or if it exists the return should be 200 Success:

{
  "name": "raiBlocklistItemName",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName/raiBlocklists/raiBlocklistName/raiBlocklistItems/raiBlocklistItemName",
  "properties": {
    "pattern": "Pattern To Block",
    "isRegex": false
  }
}

Actual behavior

Always returning the status code 400 Bad Request regardless of the input.

2024/12/30 15:28:31 failed to finish the request: GET https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.CognitiveServices/accounts/<accountName>/raiBlocklists/<raiBlocklistName>/raiBlocklistItems/<raiBlocklistItemName>
--------------------------------------------------------------------------------
RESPONSE 400: 400 Bad Request
ERROR CODE UNAVAILABLE
--------------------------------------------------------------------------------
Response contained no body
--------------------------------------------------------------------------------
exit status 1

Reproduction Steps

You can reproduce the error using Postman or directly in this link click on Try it and provide the required parameters for Rai Blocklist Item such as subscriptionId, resourceGroupName, accountName, raiBlocklistName and raiBlocklistItemName.

Environment

No response

@feliperezende-barbosa feliperezende-barbosa added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jan 2, 2025
@feliperezende-barbosa feliperezende-barbosa changed the title [BUG] [Azure Open AI] Rai Blocklist Item API Get - 400 Bad Request [BUG] [Azure OpenAI] Rai Blocklist Item API Get - 400 Bad Request Jan 2, 2025
@v-jiaodi v-jiaodi added the Mgmt This issue is related to a management-plane library. label Jan 3, 2025
@v-jiaodi
Copy link
Member

v-jiaodi commented Jan 3, 2025

@tianxin-ms Please help take a look, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Mgmt This issue is related to a management-plane library.
Projects
None yet
Development

No branches or pull requests

3 participants