您需要使用API来更新数据库,如this文章中所述。
例如:
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "sqlcrudtest-4799",
"serverName": "sqlcrudtest-5961",
"databaseName": "testdb",
"api-version": "2014-04-01",
"parameters": {
"properties": {
"edition": "Standard",
"status": "Online",
"createMode": "Default",
"serviceLevelObjective": "S0",
"collation": "SQL_Latin1_General_CP1_CI_AS",
"maxSizeBytes": "268435456000",
"currentServiceObjectiveId": "f1173c43-91bd-4aaa-973c-54e79e15235b",
"requestedServiceObjectiveId": "dd6d99bb-f193-4ec1-86f2-43d3bccbc49c",
"requestedServiceObjectiveName": "Basic",
"defaultSecondaryLocation": "Japan West",
"earliestRestoreDate": "2017-02-10T01:52:52.923Z",
"containmentState": 2,
"readScale": "Disabled"
}
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/databases/testdb",
"name": "testdb",
"type": "Microsoft.Sql/servers/databases",
"location": "Japan East",
"kind": "v12.0,user",
"properties": {
"edition": "Standard",
"status": "Online",
"serviceLevelObjective": "S0",
"collation": "SQL_Latin1_General_CP1_CI_AS",
"creationDate": "2017-02-24T22:39:46.547Z",
"maxSizeBytes": "268435456000",
"currentServiceObjectiveId": "f1173c43-91bd-4aaa-973c-54e79e15235b",
"requestedServiceObjectiveId": "dd6d99bb-f193-4ec1-86f2-43d3bccbc49c",
"requestedServiceObjectiveName": "Basic", "sampleName": null,
"defaultSecondaryLocation": "Japan West",
"earliestRestoreDate": "2017-02-10T01:52:52.923Z",
"elasticPoolName": null,
"containmentState": 2,
"readScale": "Disabled",
"failoverGroupId": null
}
}
},
"202": {}
}
}
在我从标准S0缩减为基本层上面的例子。
希望这会有所帮助。
会sql查询为您好吗?或者你想通过API来做到这一点? –
看来你有错误的负载检查这个URL https://docs.microsoft.com/en-us/rest/api/sql/Databases/Update –
@VolodymyrBilyachat:我正在验证相同的URL对于api构造。你能告诉我设置DTU的参数吗?我试过没有任何工作。 “属性”:{ \t \t \t \t \t \t \t \t “版”: “标准”, \t \t \t \t “maxSizeBytes”: “268435456000” }数据库的 尺寸我可以直接设置它像这样,我如何设置DTU? –