Cancels the asynchronous operation on the managed instance.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel?api-version=2023-08-01
URI Parameters
Name
In
Required
Type
Description
managedInstanceName
path
True
string
The name of the managed instance.
operationId
path
True
string
(uuid)
resourceGroupName
path
True
string
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
subscriptionId
path
True
string
The subscription ID that identifies an Azure subscription.
api-version
query
True
string
The API version to use for the request.
Responses
Name
Type
Description
200 OK
The request for cancel has been executed successfully.
POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/operations/11111111-1111-1111-1111-111111111111/cancel?api-version=2023-08-01
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/stable/2023-08-01/examples/CancelManagedInstanceOperation.json
// this example is just showing the usage of "ManagedInstanceOperations_Cancel" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedInstanceOperationResource created on azure
// for more information of creating ManagedInstanceOperationResource, please refer to the document of ManagedInstanceOperationResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "sqlcrudtest-7398";
string managedInstanceName = "sqlcrudtest-4645";
Guid operationId = Guid.Parse("11111111-1111-1111-1111-111111111111");
ResourceIdentifier managedInstanceOperationResourceId = ManagedInstanceOperationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName, operationId);
ManagedInstanceOperationResource managedInstanceOperation = client.GetManagedInstanceOperationResource(managedInstanceOperationResourceId);
// invoke the operation
await managedInstanceOperation.CancelAsync();
Console.WriteLine("Succeeded");