Remove a Server-Wide Connection String
-
Use
RemoveServerWideConnectionStringOperationto remove a server-wide connection string from the cluster. -
Removing a server-wide connection string deletes both:
- The cluster-level definition.
- The propagated connection string entries from all databases that received it.
-
A server-wide connection string cannot be removed while it is still used by an ongoing task or AI agent in any database. Before removing it, delete or update the tasks and AI agents that reference it.
-
To remove a server-wide connection string from Studio, open Manage Server > Server-Wide Connection Strings
and use the delete action in the list view. See Managing server-wide connection strings. -
In this article:
Remove a server-wide connection string
The following example removes a RavenDB server-wide connection string.
Only the Name property is required; the type is inferred from the connection string class.
- Sync
- Async
var ravenConnectionString = new RavenConnectionString()
{
// Only the 'Name' property is needed for the remove operation.
Name = "ravendb-connection-string-name"
};
// Define the remove operation, pass the connection string to be removed.
var removeOp =
new RemoveServerWideConnectionStringOperation<RavenConnectionString>(ravenConnectionString);
// Execute the operation through the server maintenance store.
RemoveServerWideConnectionStringResult result = store.Maintenance.Server.Send(removeOp);
var ravenConnectionString = new RavenConnectionString()
{
// Only the 'Name' property is needed for the remove operation.
Name = "ravendb-connection-string-name"
};
// Define the remove operation, pass the connection string to be removed.
var removeOp =
new RemoveServerWideConnectionStringOperation<RavenConnectionString>(ravenConnectionString);
// Execute the operation through the server maintenance store.
RemoveServerWideConnectionStringResult result = await
store.Maintenance.Server.SendAsync(removeOp);
Syntax
public RemoveServerWideConnectionStringOperation(T connectionString) where T : ConnectionString
| Parameter | Type | Description |
|---|---|---|
| connectionString | T | Connection string to remove (only Name is required):RavenConnectionStringSqlConnectionStringSnowflakeConnectionStringOlapConnectionStringElasticSearchConnectionStringQueueConnectionStringAiConnectionString |
| Operation result | |
|---|---|
RemoveServerWideConnectionStringResult | Contains RaftCommandIndex - the Raft index assigned to the operation. |