Beispiel #1
0
 /// <summary>
 /// Begins creating a new Azure SQL Server Key or updating an existing
 /// Azure SQL Server Key. To determine the status of the operation
 /// call GetCreateOrUpdateOperationStatus.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.IServerKeyOperations.
 /// </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 Server to which to add the
 /// Server Key.
 /// </param>
 /// <param name='keyName'>
 /// Required. The name of the Azure SQL Server Key.
 /// </param>
 /// <param name='parameters'>
 /// Required. The required parameters for createing or updating a
 /// Server Key.
 /// </param>
 /// <returns>
 /// Represents the response to a Azure Sql Server Key operation request.
 /// </returns>
 public static ServerKeyCreateOrUpdateResponse BeginCreateOrUpdate(this IServerKeyOperations operations, string resourceGroupName, string serverName, string keyName, ServerKeyCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IServerKeyOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, serverName, keyName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #2
0
 /// <summary>
 /// Creates or updates an Azure Sql Server Key
 /// </summary>
 /// <param name="resourceGroupName">Resource Group</param>
 /// <param name="serverName">Sql Server name</param>
 /// <param name="keyName">Server Key Vault Key name</param>
 /// <param name="clientRequestId">Client request Id</param>
 /// <param name="parameters">CreateOrUpdateParameters for ServerKey</param>
 /// <returns>Created ServerKey</returns>
 public Microsoft.Azure.Management.Sql.LegacySdk.Models.ServerKey CreateOrUpdate(string resourceGroupName, string serverName, string keyName, string clientRequestId, ServerKeyCreateOrUpdateParameters parameters)
 {
     return(GetCurrentSqlClient(clientRequestId).ServerKey.CreateOrUpdate(resourceGroupName, serverName, keyName, parameters).ServerKey);
 }
Beispiel #3
0
 /// <summary>
 /// Creates a new Azure SQL Server Key or updates an existing Azure SQL
 /// Server Key.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.IServerKeyOperations.
 /// </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 Server to which to add the
 /// Server Key.
 /// </param>
 /// <param name='keyName'>
 /// Required. The name of the Azure SQL Server Key.
 /// </param>
 /// <param name='parameters'>
 /// Required. The required parameters for createing or updating a
 /// Server Key.
 /// </param>
 /// <returns>
 /// Represents the response to a Azure Sql Server Key operation request.
 /// </returns>
 public static Task <ServerKeyCreateOrUpdateResponse> CreateOrUpdateAsync(this IServerKeyOperations operations, string resourceGroupName, string serverName, string keyName, ServerKeyCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, serverName, keyName, parameters, CancellationToken.None));
 }