@shota sato , <edit>
Glad to see that your issue is resolved and thanks for confirming the solution that worked. Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer. They can only accept answers by others, I' have summarized and posted the solution, request you to Accept the answer, it will benefit the community find the answers quickly.
Scenario:
Tried to delete an Azure AI search resource, but failed with code "undefined". Tried with another ai search resource in same region, but failed.
Copied the solution shared by @shota sato
Resolution:
Successfully deleted the resource using the following steps:
- Issued an access token in the cloud shell.
- Specified the resource to be deleted using the following command.
- Executed the command.
curl -X DELETE "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}?api-version=2023-11-01" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${access_token}"
--edit--
Just checking in to see if you had got a chance to see the previous response by Miguel.
Kindly let us know if the issue is resolved or you need further assistance, share the requested/more info to help you better.