1

Azure Database for MySQL server is still in preview, though we can created database instance on it. I wonder do we have any API to retrieve the databases that we created on Azure Database for MySQL server? API for metrics of those databases? Same questions for Azure Database for PostgreSQL server. Thanks! Related Azure portal screenshot

Jerry
  • 21
  • 2
  • Actually I was able to query metrics for Azure DB for MySQL by replacing the resource-id: https://management.azure.com/{resource-id}/providers/microsoft.insights/metrics?api-version={api-version}&$filter={filter-expression} When I use java to connect to Azure, I will get an Azure object (com.microsoft.azure.management.Azure). We can get all the VM instances by azure.virtualMachines(); I wonder how can we get the Azure DB for MySQL server "instance" or the "database instances" on it by "Azure object"? – Jerry Jul 20 '17 at 14:43

4 Answers4

1

We have just released the REST API spec today. You can find it here - https://learn.microsoft.com/en-us/rest/api/mysql/

1

Here's the REST API reference to list all the databases under a server: https://learn.microsoft.com/en-us/rest/api/mysql/databases#Databases_ListByServer

Saloni Sonpal
  • 222
  • 1
  • 3
0

well, they obviously exist, but they are not publicly available yet. I don't see anything reasonable on the REST API reference page.

You may figure this out using the Azure portal + fiddler combo ;)

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
-2

What do you mean retrieve the databases? You can connect to them in Visual Studio with your SQL server object explorer and entering the server name Azure gave you as the server. I don't know if I am understanding your question right? You can connect to the database just like any other SQL database using a SqlConnection.

EDIT: I looked into it a little more: https://learn.microsoft.com/en-us/azure/sql-database/sql-database-connect-query-dotnet-visual-studio

Essentially what I was saying. Provided you have successfully connected your SQL db to Azure you just access it like any other database. For PostgresSql, look into using NpgsqlConnection instead of SqlConnection. They have very similar functionality.

CodySig
  • 174
  • 1
  • 4
  • 15