[英]Restore a azure database from outside using python
Is there any way to restore an azure database by calling from outside.有没有办法通过从外部调用来恢复 azure 数据库。 My database is backed up automatically, I want to use that back up to restore to a new database.
我的数据库是自动备份的,我想用那个备份来恢复到一个新的数据库。
That is perfect if I can do this by using Python.如果我可以使用 Python 做到这一点,那就太完美了。
Thanks in advance!提前致谢!
You can use REST API to create a new database from a point-in-time restore of an existent database.您可以使用 REST API 从现有数据库的时间点还原创建新数据库。
Sample request.样品请求。
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbpitr?api-version=2017-10-01-preview
Request body.请求体。
{
"location": "southeastasia",
"sku": {
"name": "S0",
"tier": "Standard"
},
"properties": {
"createMode": "PointInTimeRestore",
"sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
"restorePointInTime": "2017-07-14T05:35:31.503Z"
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.