Azure Backup policies as IaC fails to deploy when associated VMs are missing/failed to perform a backup

Lasse Hastrup 0 Reputation points
2025-04-15T08:14:28.2166667+00:00

Hello,

We're having issues deploying RSV Backup policies using Infrastructure as Code, when either of these scenarios are happening:

  1. VM that is associated with the backup no longer exist in Azure (Deleted, but forgot to stop the backup)
  2. SQL server failed to perform a backup (UserErrorTargetDataSourceCannotBeOpened)

As i'm in a platform team, where we provide the basic needs to our Landing Zone owners, the Recovery Service Vault with the Backup policies are a central part of our solution, and is deployed from our central pipelines.

However we don't want to receive failed deployments because of the two bullets mentioned before; this is not relevant to the central solution of RSV and their backup policies.

How do we tackle this?

Thanks,

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,439 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 27,321 Reputation points MVP
    2025-04-15T08:53:07.96+00:00

    Hi,

    I would suggest to delete (stop) the backup items associated with those deleted resources. When you put resources under Azure Backup backup items are created for them. When you delete backup items you have the option to retain or delete backup data. Note that if soft-delete is enabled and depending on the workload type you might not be able to delete the data and you will need to retain it only. Here is how it is done for Azure VMs but the process is similar for other types of workloads.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.