An Azure relational database service.
Does anyone from Microsoft dev group that can help identifying the above error I have or have documentation about the error?
Pl. let me know if you need any info to produce this.
Thanks
Khaled
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to copy a sqlazure database from long term retention using the documented REST API:
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy?api-version=2021-02-01-preview
I am passing all the info correctly but I receive copy is not supported feature in this subscription.
Anything I need to configure in my azure subscription?
I can do it from the portal but not from REST.
I have no issue using PITR restore from REST with no issue. It is just the restore from LTR.
Thanks
Khaled
An Azure relational database service.
Does anyone from Microsoft dev group that can help identifying the above error I have or have documentation about the error?
Pl. let me know if you need any info to produce this.
Thanks
Khaled
Thanks Oury. I was hoping to avoid using powershell. I am doing this in .NET and I was trying to use fluent or even REST API to avoid using powershell. This is part of any API I am offering to our client.
Is this a bug in the REST API? any plan to fix it and when?
Great thanks for helping.
Khaled
Here is the error I am getting:
{\"error\":{\"code\":\"MissingRecoveryServicesRecoveryPointId\",\"message\":\"Missing recovery services recovery point Id.\"}}"
I have tried the following request for PUT request body:
{"properties":{"createMode":"RestoreLongTermRetentionBackup","recoveryServicesRecoveryPointResourceId":"/subscriptions/<mysub>/resourceGroups/<myresourcegroup>/providers/Microsoft.Sql/servers/<sqlservername>/databases/<sourcedb>/longTermRetentionBackups/<LTR-backupname>","sourceDatabaseId":"/subscriptions/<mysub>/resourceGroups/<myresourcegroup>/providers/Microsoft.Sql/servers/<mysqlserver>/databases/<dbtoberestored>"},"location":"<location>"}
Thanks
Khaled
Thanks Ben. Yes I am trying to restore the database from LTR.
I have tried the create-or-update and it works well for Pitr restore.
But for LTR, it asks about recoveryServicesRecoveryPointResourceId. Not sure what to specify for this param.
Great thanks for helping.
Khaled
Hi Khaled,
When you say you are trying to 'copy' the database, do you mean you want to restore it?
If you are trying to perform a restore, you need to use the 'Create or Update' endpoint. Check the createmode option for restoring from LTR.
https://learn.microsoft.com/en-us/rest/api/sql/2021-02-01-preview/databases/create-or-update#createmode
Let me know how it goes
Ben Harding