Azure / Azure/azure-rest-api-specs

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

Open
#18,657 1 comment 0 reactions 0 assignees View on GitHub
Cosmos customer-reported question Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

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..

Contributor guide

Open the contributing guide

Research direction

Start with the reported DELETE request to the Azure REST API and compare the resource URI shown in the issue with the linked Stack Overflow reproduction. Determine whether the embedded enter character is accepted or rejected, and document the confirmed behavior or expected correction for deleting the Cosmos DB MongoDB collection.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, mongodb, powershell
Domain
api, cloud, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.