0

I have created Azure SQL Data warehouse and done pause and resume actions using Java SDK

Now I want to disable Geo backup policy when creation of Azure SQL Data warehouse.

How can I do it using Java SDK?

Refer below image for Geo backup policy in Azure SQL Data warehouse.

enter image description here

Shui shengbao
  • 18,746
  • 3
  • 27
  • 45
Galet
  • 5,853
  • 21
  • 82
  • 148

1 Answers1

1

You could use Azure Rest API to do this.

PUT https://management.azure.com/subscriptions/***********/resourceGroups/shui156/providers/Microsoft.Sql/servers/shui156/databases/shui156/geoBackupPolicies/Default?api-version=2014-04-01

Body:

{
  "id": "/subscriptions/***********/resourceGroups/shui156/providers/Microsoft.Sql/servers/shui156/databases/shui156/geoBackupPolicies/Default",
  "name": "Default",
  "type": "Microsoft.Sql/servers/databases/geoBackupPolicies",
  "location": "East US",
  "kind": null,
  "properties": {
    "state": "Disabled",
    "storageType": null
  }
}
Shui shengbao
  • 18,746
  • 3
  • 27
  • 45
  • As I am doing all operations using Java SDK - https://github.com/Azure/azure-libraries-for-java. Is there a way to do using that? – Galet Jan 09 '18 at 04:24
  • Sorry, I give a wrong api. I update it. I test it on my lab, it works fine. I will test Azure Java SDK. – Shui shengbao Jan 09 '18 at 05:22
  • @karan I check the [api](https://learn.microsoft.com/en-my/java/api/com.microsoft.azure.management.sql._sql_warehouse) for data warehouse. It seems that Azure does not provide this sdk. – Shui shengbao Jan 09 '18 at 06:01
  • @karan If possible, I suggest you could call Azure rest api. In fact, java sdk also call rest api. – Shui shengbao Jan 09 '18 at 06:01
  • 1
    I have python has this parameter https://learn.microsoft.com/en-us/python/api/azure.mgmt.sql.operations.geobackuppoliciesoperations?view=azure-python It means python could modify this. But I find article java seems does not support this. – Shui shengbao Jan 09 '18 at 06:24