Gremlin Resources - Delete Gremlin Database
Deletes an existing Azure Cosmos DB Gremlin database.
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}?api-version=2026-03-15
URI Parameters
Name
In
Required
Type
Description
accountName
path
True
string
minLength: 3 maxLength: 50 pattern: ^[a-z0-9]+(-[a-z0-9]+)*
Cosmos DB database account name.
databaseName
path
True
string
Cosmos DB database name.
resourceGroupName
path
True
string
minLength: 1 maxLength: 90
The name of the resource group. The name is case insensitive.
subscriptionId
path
True
string
(uuid)
The ID of the target subscription. The value must be an UUID.
api-version
query
True
string
minLength: 1
The API version to use for this operation.
Responses
Name
Type
Description
202 Accepted
Resource operation accepted.
Headers
Azure-AsyncOperation: string
Location: string
204 No Content
There is no content to send for this request, but the headers may be useful.
Other Status Codes
ErrorResponse
An unexpected error response.
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name
Description
user_impersonation
impersonate your user account
Examples
CosmosDBGremlinDatabaseDelete
Sample request
DELETE https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/gremlinDatabases/databaseName?api-version=2026-03-15
from azure.identity import DefaultAzureCredential
from azure.mgmt.cosmosdb import CosmosDBManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cosmosdb
# USAGE
python cosmos_db_gremlin_database_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CosmosDBManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
client.gremlin_resources.begin_delete_gremlin_database(
resource_group_name="rg1",
account_name="ddb1",
database_name="databaseName",
).result()
# x-ms-original-file: 2026-03-15/CosmosDBGremlinDatabaseDelete.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation . To provide feedback on this code sample, open a GitHub issue
package armcosmos_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v4"
)
// Generated from example definition: 2026-03-15/CosmosDBGremlinDatabaseDelete.json
func ExampleGremlinResourcesClient_BeginDeleteGremlinDatabase() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewGremlinResourcesClient().BeginDeleteGremlinDatabase(ctx, "rg1", "ddb1", "databaseName", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation . To provide feedback on this code sample, open a GitHub issue
const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to deletes an existing Azure Cosmos DB Gremlin database.
*
* @summary deletes an existing Azure Cosmos DB Gremlin database.
* x-ms-original-file: 2026-03-15/CosmosDBGremlinDatabaseDelete.json
*/
async function cosmosDBGremlinDatabaseDelete() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new CosmosDBManagementClient(credential, subscriptionId);
await client.gremlinResources.deleteGremlinDatabase("rg1", "ddb1", "databaseName");
}
To use the Azure SDK library in your project, see this documentation . To provide feedback on this code sample, open a GitHub issue
Sample response
Location: https://centraluseuap.management.azure.com/subscriptions/d1eb41bc-1b7f-4404-bd2a-8568c222852d/providers/Microsoft.DocumentDB/locations/centraluseuap/operationsStatus/fdd04b7b-86d5-460f-b19e-386230348bcc?api-version=2026-03-15
Azure-AsyncOperation: https://centraluseuap.management.azure.com/subscriptions/d1eb41bc-1b7f-4404-bd2a-8568c222852d/providers/Microsoft.DocumentDB/locations/centraluseuap/operationsStatus/fdd04b7b-86d5-460f-b19e-386230348bcc?api-version=2026-03-15
Definitions
ErrorResponse
Object
Error Response.
Name
Type
Description
code
string
Error code.
message
string
Error message indicating why the operation failed.