Delete a backup instance in a backup vault
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}?api-version=2024-04-01
URI Parameters
Name |
In |
Required |
Type |
Description |
backupInstanceName
|
path |
True
|
string
|
The name of the backup instance.
|
resourceGroupName
|
path |
True
|
string
|
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.
|
vaultName
|
path |
True
|
string
|
The name of the backup vault.
|
api-version
|
query |
True
|
string
|
The API version to use for this operation.
|
Name |
Required |
Type |
Description |
x-ms-authorization-auxiliary
|
|
string
|
|
Responses
Name |
Type |
Description |
200 OK
|
|
Ok
|
202 Accepted
|
|
The operation will be completed asynchronously.
Headers
- Location: string
- Azure-AsyncOperation: string
- Retry-After: integer
|
204 No Content
|
|
NoContent
|
Other Status Codes
|
CloudError
|
Error response describing why the operation failed.
|
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
Delete BackupInstance
Sample request
DELETE https://management.azure.com/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/backupInstances/testInstance1?api-version=2024-04-01
/**
* Samples for BackupInstances Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2024-04-01/examples/
* BackupInstanceOperations/DeleteBackupInstance.json
*/
/**
* Sample code: Delete BackupInstance.
*
* @param manager Entry point to DataProtectionManager.
*/
public static void deleteBackupInstance(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) {
manager.backupInstances().delete("000pikumar", "PratikPrivatePreviewVault1", "testInstance1",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.dataprotection import DataProtectionMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dataprotection
# USAGE
python delete_backup_instance.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 = DataProtectionMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="04cf684a-d41f-4550-9f70-7708a3a2283b",
)
client.backup_instances.begin_delete(
resource_group_name="000pikumar",
vault_name="PratikPrivatePreviewVault1",
backup_instance_name="testInstance1",
).result()
# x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2024-04-01/examples/BackupInstanceOperations/DeleteBackupInstance.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 armdataprotection_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/81a4ee5a83ae38620c0e1404793caffe005d26e4/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2024-04-01/examples/BackupInstanceOperations/DeleteBackupInstance.json
func ExampleBackupInstancesClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewBackupInstancesClient().BeginDelete(ctx, "000pikumar", "PratikPrivatePreviewVault1", "testInstance1", &armdataprotection.BackupInstancesClientBeginDeleteOptions{XMSAuthorizationAuxiliary: 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 pull 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 { DataProtectionClient } = require("@azure/arm-dataprotection");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Delete a backup instance in a backup vault
*
* @summary Delete a backup instance in a backup vault
* x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2024-04-01/examples/BackupInstanceOperations/DeleteBackupInstance.json
*/
async function deleteBackupInstance() {
const subscriptionId =
process.env["DATAPROTECTION_SUBSCRIPTION_ID"] || "04cf684a-d41f-4550-9f70-7708a3a2283b";
const resourceGroupName = process.env["DATAPROTECTION_RESOURCE_GROUP"] || "000pikumar";
const vaultName = "PratikPrivatePreviewVault1";
const backupInstanceName = "testInstance1";
const credential = new DefaultAzureCredential();
const client = new DataProtectionClient(credential, subscriptionId);
const result = await client.backupInstances.beginDeleteAndWait(
resourceGroupName,
vaultName,
backupInstanceName,
);
console.log(result);
}
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://management.azure.com/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupInstances/harshitbi1/operationResults/ZTA4YjQ0ZGYtYmNkNS00YTk1LWFjZTMtOTc1MjNmZWIxYWZlO2Y1ODg1MzA3LWJkNjItNDQ2OC05ZjZlLTJkMGM2NjNiNmJmNg==?api-version=2024-04-01
Azure-AsyncOperation: https://management.azure.com/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/operationStatus/ZTA4YjQ0ZGYtYmNkNS00YTk1LWFjZTMtOTc1MjNmZWIxYWZlO2Y1ODg1MzA3LWJkNjItNDQ2OC05ZjZlLTJkMGM2NjNiNmJmNg==?api-version=2024-04-01
Retry-After: 60
Definitions
CloudError
CloudError
Name |
Type |
Description |
error
|
Error
|
The resource management error response.
|
Error
The resource management error response.
Name |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
code
|
string
|
The error code.
|
details
|
Error[]
|
The error details.
|
message
|
string
|
The error message.
|
target
|
string
|
The error target.
|
ErrorAdditionalInfo
The resource management error additional info.
Name |
Type |
Description |
info
|
object
|
The additional info.
|
type
|
string
|
The additional info type.
|