Azure - 以编程方式添加新的 MySQL 数据库实例
Azure - Programmatically add new MySQL db instance
我正在尝试以编程方式将新的 MySQL
数据库实例添加到 Azure 门户。
我查看了这个库:https://github.com/Azure/azure-libraries-for-net
但我只看到了如何创建 SQL Server
而不是 MySQL
的示例。
var credentials = SdkContext.AzureCredentialsFactory.FromFile(Environment.GetEnvironmentVariable("AZURE_AUTH_LOCATION"));
var azure = Azure
.Configure()
.WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
.Authenticate(credentials)
.WithDefaultSubscription();
var sqlServer = azure.SqlServers.Define(sqlServerName)
.WithRegion(Region.USEast)
.WithNewResourceGroup(rgName)
.WithAdministratorLogin(AdministratorLogin)
.WithAdministratorPassword(AdministratorPassword)
.WithNewFirewallRule(FirewallRuleIPAddress)
.WithNewFirewallRule(FirewallRuleStartIPAddress, FirewallRuleEndIPAddress)
.Create();
var database = sqlServer.Databases
.Define(DatabaseName)
.Create();
知道它是否也支持以编程方式创建 MySQL
服务器吗?
查看发行说明和 SDK 代码,似乎仍然不支持管理 MySQL
数据库的能力(从 1.3 版开始)。
您可以使用 REST API for managing Azure MySQL databses
directly. For creation of database, please look at Create Or Update Database
操作。
要开始使用 Azure REST API,您可能会发现此 link 有用:https://docs.microsoft.com/en-us/rest/api/。
我正在尝试以编程方式将新的 MySQL
数据库实例添加到 Azure 门户。
我查看了这个库:https://github.com/Azure/azure-libraries-for-net
但我只看到了如何创建 SQL Server
而不是 MySQL
的示例。
var credentials = SdkContext.AzureCredentialsFactory.FromFile(Environment.GetEnvironmentVariable("AZURE_AUTH_LOCATION"));
var azure = Azure
.Configure()
.WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
.Authenticate(credentials)
.WithDefaultSubscription();
var sqlServer = azure.SqlServers.Define(sqlServerName)
.WithRegion(Region.USEast)
.WithNewResourceGroup(rgName)
.WithAdministratorLogin(AdministratorLogin)
.WithAdministratorPassword(AdministratorPassword)
.WithNewFirewallRule(FirewallRuleIPAddress)
.WithNewFirewallRule(FirewallRuleStartIPAddress, FirewallRuleEndIPAddress)
.Create();
var database = sqlServer.Databases
.Define(DatabaseName)
.Create();
知道它是否也支持以编程方式创建 MySQL
服务器吗?
查看发行说明和 SDK 代码,似乎仍然不支持管理 MySQL
数据库的能力(从 1.3 版开始)。
您可以使用 REST API for managing Azure MySQL databses
directly. For creation of database, please look at Create Or Update Database
操作。
要开始使用 Azure REST API,您可能会发现此 link 有用:https://docs.microsoft.com/en-us/rest/api/。