Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.69k stars 5.12k forks source link

There is an enter character in the Uri for a resource. I cannot delete the resource now #18657

Open baswijdenes opened 2 years ago

baswijdenes commented 2 years ago

Hi,

I'm trying to delete a collection in MongoDB in Azure Cosmos DB. For more information please also check this (post on stackoverflow):

I've also tried to remove it with the Azure REST API:

$uri = ('https://management.azure.com/' + $($collection[0].id) + '?api-version=2021-04-15')

$InvokeRestMethodsplat = @{
    Uri = $Uri
    Method = 'Delete'
    Headers = @{
        Authorization = "bearer $($Token.Token)"
        }
}

Invoke-RestMethod @InvokeRestMethodsplat

Whatever I try, the error is always the same (also in the GUI):

Invoke-RestMethod : 
Bad Request
Bad Request - Invalid URL
HTTP Error 400. The request URL is invalid.

It seems like the API does not accept all special characters for enters etc..

ghost commented 2 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Wmengmsft, @MehaKaushik.

Issue Details
Hi, I'm trying to delete a collection in MongoDB in Azure Cosmos DB. For more information please also check this (post on stackoverflow): - [https://stackoverflow.com/questions/71832050/enter-character-in-mongodb-in-azure-cosmos-db-collection-how-can-i-remove-the-c](https://stackoverflow.com/questions/71832050/enter-character-in-mongodb-in-azure-cosmos-db-collection-how-can-i-remove-the-c) I've also tried to remove it with the Azure REST API: ``` $uri = ('https://management.azure.com/' + $($collection[0].id) + '?api-version=2021-04-15') $InvokeRestMethodsplat = @{ Uri = $Uri Method = 'Delete' Headers = @{ Authorization = "bearer $($Token.Token)" } } Invoke-RestMethod @InvokeRestMethodsplat ``` Whatever I try, the error is always the same (also in the GUI): ``` Invoke-RestMethod : Bad Request Bad Request - Invalid URL HTTP Error 400. The request URL is invalid. ``` It seems like the API does not accept all special characters for enters etc..
Author: baswijdenes
Assignees: -
Labels: `question`, `Cosmos`, `Service Attention`, `customer-reported`, `needs-triage`
Milestone: -