Hi Srinu Tamada,
Greetings!
We apologize for the inconvenience caused.
We would like to inform you that, special characters like & in container names can cause some problems in Azure Cosmos DB, especially when using the Portal, CLI, or SDKs that don't properly encode or escape them. The name T&CStore is technically not a recommended format, and it's likely breaking API calls under the hood due to the unescaped ampersand.
Since you are now stuck not only being unable to delete the container but also unable to create new containers or databases, it's likely the account itself is choking on that invalid name.
Here are some steps and solutions that might help you resolve this issue:
Method 1: You can use the Azure Cosmos DB SDK to delete the container. Using a language SDK (like Python, Node.js, or C#), you can bypass UI/CLI and ensure proper escaping. Here's an example using the Python.
from azure.cosmos import CosmosClient
endpoint = "https://<your-account>.documents.azure.com:443/"
key = "<your-primary-key>"
database_name = "<your-db-name>"
container_name = "T&CStore"
client = CosmosClient(endpoint, key)
database = client.get_database_client(database_name)
# Try deleting container
try:
container = database.get_container_client(container_name)
container.delete_container()
print(f"Deleted container: {container_name}")
except Exception as e:
print("Error deleting container:", e)
You might need to URL-encode the name (T%26CStore) depending on the SDK and whether it escapes the name properly. Try both ways.
Method 2: To delete a container use Azure Resource Explorer, do the following:
- Go to https://resources.azure.com/
- Navigate to your Cosmos DB resource.
- Carefully drill down into the containers node of your DB.
- See if the container is listed — sometimes you can issue a DELETE directly from the JSON view here.
Note: Be extremely cautious — this tool gives you raw access and can break things.
If the above methods do not work, you can try using the Azure CLI with the resource ID of the container:
az cosmosdb sql container delete --account-name --database-name --name "T&CStore"
Please refer this document: https://learn.microsoft.com/en-us/cli/azure/cosmosdb/sql/container?view=azure-cli-latest#az-cosmosdb-sql-container-delete
I hope this information helps. If the issue still persists, please provide the server details via private message as it will help us conduct a more thorough investigation.
I hope this information helps. Please do let us know if you have any further queries. If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.