コード例 #1
0
 /// <summary>
 /// Creates a new Azure SQL Database server.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Management.Sql.IServerOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the server
 /// belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Database Server on which the
 /// database is hosted.
 /// </param>
 /// <param name='parameters'>
 /// Required. The required parameters for createing or updating a
 /// database.
 /// </param>
 /// <returns>
 /// Represents the response to a Get Azure Sql Database Server request.
 /// </returns>
 public static ServerGetResponse CreateOrUpdate(this IServerOperations operations, string resourceGroupName, string serverName, ServerCreateOrUpdateParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IServerOperations)s).CreateOrUpdateAsync(resourceGroupName, serverName, parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #2
0
 /// <summary>
 /// Creates or updates a Azure Sql Database SErver
 /// </summary>
 public Management.Sql.Models.Server CreateOrUpdate(string resourceGroupName, string serverName, string clientRequestId, ServerCreateOrUpdateParameters parameters)
 {
     return GetCurrentSqlClient(clientRequestId).Servers.CreateOrUpdate(resourceGroupName, serverName, parameters).Server;
 }
コード例 #3
0
        private void CreateServer()
        {
            using (var client = new SqlManagementClient(GetCredentials()))
            {
                var properties = new ServerCreateOrUpdateParameters()
                {
                    Location = Parameters.Location(Position),
                    Properties = new ServerCreateOrUpdateProperties()
                    {
                        AdministratorLogin = Parameters.Tenant.UserName,
                        AdministratorLoginPassword = Parameters.Tenant.Password,
                        Version = Parameters.Tenant.SqlVersion
                    }
                };

                var createResult = client.Servers.CreateOrUpdateAsync(Parameters.Tenant.SiteName, Parameters.GetSiteName(Position), properties).Result;
            }
        }
コード例 #4
0
 /// <summary>
 /// Creates a new Azure SQL Database server.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Management.Sql.IServerOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the server
 /// belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Azure SQL Database Server on which the
 /// database is hosted.
 /// </param>
 /// <param name='parameters'>
 /// Required. The required parameters for createing or updating a
 /// database.
 /// </param>
 /// <returns>
 /// Represents the response to a Get Azure Sql Database Server request.
 /// </returns>
 public static Task<ServerGetResponse> CreateOrUpdateAsync(this IServerOperations operations, string resourceGroupName, string serverName, ServerCreateOrUpdateParameters parameters)
 {
     return operations.CreateOrUpdateAsync(resourceGroupName, serverName, parameters, CancellationToken.None);
 }