Can delete for Azure SQL Database LTR Backups be disabled?

skreebydba 26 Reputation points
2021-10-07T17:07:59.38+00:00

Can delete functionality for Azure SQL Database LTR backups be disabled? See the attached image for the Portal pane in question.
138560-ltrbackups.png

Azure SQL Database
Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,420 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Ronen Ariely 15,206 Reputation points
    2021-10-08T19:07:45.887+00:00

    Good day and welcome to the QnA forum,

    In order to test it now, I will need to wait until long-term backup will be created on a new database since I have no database which I can test it now.

    I did not tried it yet, but I think that I found a solution in the documentation, which might fit you. You will need to test it and confirm that it is working in the portal as expected.

    optional Solution: Do not give the users to have a Subscription Owner role or to get explicitly the permission Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups/delete.

    In order to delete a long term retention backup using PowerShell, we are using the command: Remove-AzSqlDatabaseLongTermRetentionBackup

    This require to be have one of the above roles. Even the SQL Server Contributor role for example does not have permission to delete LTR backups.

    I assume that revoking this roles will prevent delete from the portal as well, but you will need to confirm it

    https://learn.microsoft.com/en-us/azure/azure-sql/database/long-term-backup-retention-configure#azure-roles-to-manage-long-term-retention

    Note! By the way, if all you need is in the browser side to disable the delete button to prevent from accidental deletion (not to prevent totally but just for not making mistakes), then you can use JavaScript on the client side like tampermonkey. If this fit your need then I can help you to write the script.

    1 person found this answer helpful.

  2. Oury Ba-MSFT 20,911 Reputation points Microsoft Employee Moderator
    2021-10-08T20:16:23.673+00:00

    @skreebydba In Addition to what @Ronen Ariely has mentioned above. If you are trying to prevent users deleting LTR backups

    139004-image.png
    https://learn.microsoft.com/en-us/azure/azure-sql/database/long-term-backup-retention-configure

    Please feel free to reach out if you have additional queries.

    Regards,
    Oury


  3. skreebydba 26 Reputation points
    2021-10-13T15:28:22.363+00:00

    Oury,

    Thanks for the response. My client has a requirement for long-term retention of backups that are immutable and cannot be deleted by anyone. Can this be done for long-term backups?

    Frank


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.