diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedInstanceTdeCertificatesOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedInstanceTdeCertificatesOperations.cs new file mode 100644 index 000000000000..3bdf7d8d7c85 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/IManagedInstanceTdeCertificatesOperations.cs @@ -0,0 +1,81 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ManagedInstanceTdeCertificatesOperations operations. + /// + public partial interface IManagedInstanceTdeCertificatesOperations + { + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task CreateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, TdeCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginCreateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, TdeCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs index 26f19bd85d49..f34948c645ee 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ISqlManagementClient.cs @@ -356,5 +356,15 @@ public partial interface ISqlManagementClient : System.IDisposable /// IBackupShortTermRetentionPoliciesOperations BackupShortTermRetentionPolicies { get; } + /// + /// Gets the ITdeCertificatesOperations. + /// + ITdeCertificatesOperations TdeCertificates { get; } + + /// + /// Gets the IManagedInstanceTdeCertificatesOperations. + /// + IManagedInstanceTdeCertificatesOperations ManagedInstanceTdeCertificates { get; } + } } diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ITdeCertificatesOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ITdeCertificatesOperations.cs new file mode 100644 index 000000000000..c015f96c2f96 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ITdeCertificatesOperations.cs @@ -0,0 +1,81 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TdeCertificatesOperations operations. + /// + public partial interface ITdeCertificatesOperations + { + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task CreateWithHttpMessagesAsync(string resourceGroupName, string serverName, TdeCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The name of the resource group that contains the resource. You can + /// obtain this value from the Azure Resource Manager API or the + /// portal. + /// + /// + /// The name of the server. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginCreateWithHttpMessagesAsync(string resourceGroupName, string serverName, TdeCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstanceTdeCertificatesOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstanceTdeCertificatesOperations.cs new file mode 100644 index 000000000000..35957338cd6d --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstanceTdeCertificatesOperations.cs @@ -0,0 +1,272 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ManagedInstanceTdeCertificatesOperations operations. + /// + internal partial class ManagedInstanceTdeCertificatesOperations : IServiceOperations, IManagedInstanceTdeCertificatesOperations + { + /// + /// Initializes a new instance of the ManagedInstanceTdeCertificatesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ManagedInstanceTdeCertificatesOperations(SqlManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SqlManagementClient + /// + public SqlManagementClient Client { get; private set; } + + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task CreateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, TdeCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginCreateWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, TdeCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (managedInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("managedInstanceName", managedInstanceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstanceTdeCertificatesOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstanceTdeCertificatesOperationsExtensions.cs new file mode 100644 index 000000000000..70c836dda5ea --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/ManagedInstanceTdeCertificatesOperationsExtensions.cs @@ -0,0 +1,115 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ManagedInstanceTdeCertificatesOperations. + /// + public static partial class ManagedInstanceTdeCertificatesOperationsExtensions + { + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + public static void Create(this IManagedInstanceTdeCertificatesOperations operations, string resourceGroupName, string managedInstanceName, TdeCertificate parameters) + { + operations.CreateAsync(resourceGroupName, managedInstanceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IManagedInstanceTdeCertificatesOperations operations, string resourceGroupName, string managedInstanceName, TdeCertificate parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.CreateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + public static void BeginCreate(this IManagedInstanceTdeCertificatesOperations operations, string resourceGroupName, string managedInstanceName, TdeCertificate parameters) + { + operations.BeginCreateAsync(resourceGroupName, managedInstanceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the managed instance. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this IManagedInstanceTdeCertificatesOperations operations, string resourceGroupName, string managedInstanceName, TdeCertificate parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, managedInstanceName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/Models/TdeCertificate.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/TdeCertificate.cs new file mode 100644 index 000000000000..87473f53ac48 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/Models/TdeCertificate.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A TDE certificate that can be uploaded into a server. + /// + [Rest.Serialization.JsonTransformation] + public partial class TdeCertificate : ProxyResource + { + /// + /// Initializes a new instance of the TdeCertificate class. + /// + public TdeCertificate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TdeCertificate class. + /// + /// The base64 encoded certificate private + /// blob. + /// Resource ID. + /// Resource name. + /// Resource type. + /// The certificate password. + public TdeCertificate(string privateBlob, string id = default(string), string name = default(string), string type = default(string), string certPassword = default(string)) + : base(id, name, type) + { + PrivateBlob = privateBlob; + CertPassword = certPassword; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the base64 encoded certificate private blob. + /// + [JsonProperty(PropertyName = "properties.privateBlob")] + public string PrivateBlob { get; set; } + + /// + /// Gets or sets the certificate password. + /// + [JsonProperty(PropertyName = "properties.certPassword")] + public string CertPassword { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrivateBlob == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PrivateBlob"); + } + } + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs index 368b40355265..051b12219119 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SdkInfo_SqlManagementClient.cs @@ -55,6 +55,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "Jobs", "2017-03-01-preview"), new Tuple("Sql", "LongTermRetentionBackups", "2017-03-01-preview"), new Tuple("Sql", "ManagedDatabases", "2017-03-01-preview"), + new Tuple("Sql", "ManagedInstanceTdeCertificates", "2017-10-01-preview"), new Tuple("Sql", "ManagedInstances", "2015-05-01-preview"), new Tuple("Sql", "Operations", "2015-05-01-preview"), new Tuple("Sql", "RecommendedElasticPools", "2014-04-01"), @@ -77,6 +78,7 @@ public static IEnumerable> ApiInfo_SqlManagementCl new Tuple("Sql", "SyncAgents", "2015-05-01-preview"), new Tuple("Sql", "SyncGroups", "2015-05-01-preview"), new Tuple("Sql", "SyncMembers", "2015-05-01-preview"), + new Tuple("Sql", "TdeCertificates", "2017-10-01-preview"), new Tuple("Sql", "TransparentDataEncryptionActivities", "2014-04-01"), new Tuple("Sql", "TransparentDataEncryptions", "2014-04-01"), new Tuple("Sql", "VirtualNetworkRules", "2015-05-01-preview"), diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs index 453f9ef3aff1..73054f828747 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/SqlManagementClient.cs @@ -361,6 +361,16 @@ public partial class SqlManagementClient : ServiceClient, I /// public virtual IBackupShortTermRetentionPoliciesOperations BackupShortTermRetentionPolicies { get; private set; } + /// + /// Gets the ITdeCertificatesOperations. + /// + public virtual ITdeCertificatesOperations TdeCertificates { get; private set; } + + /// + /// Gets the IManagedInstanceTdeCertificatesOperations. + /// + public virtual IManagedInstanceTdeCertificatesOperations ManagedInstanceTdeCertificates { get; private set; } + /// /// Initializes a new instance of the SqlManagementClient class. /// @@ -620,6 +630,8 @@ private void Initialize() DatabaseVulnerabilityAssessmentScans = new DatabaseVulnerabilityAssessmentScansOperations(this); InstanceFailoverGroups = new InstanceFailoverGroupsOperations(this); BackupShortTermRetentionPolicies = new BackupShortTermRetentionPoliciesOperations(this); + TdeCertificates = new TdeCertificatesOperations(this); + ManagedInstanceTdeCertificates = new ManagedInstanceTdeCertificatesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/TdeCertificatesOperations.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/TdeCertificatesOperations.cs new file mode 100644 index 000000000000..9b4ebb376440 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/TdeCertificatesOperations.cs @@ -0,0 +1,272 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TdeCertificatesOperations operations. + /// + internal partial class TdeCertificatesOperations : IServiceOperations, ITdeCertificatesOperations + { + /// + /// Initializes a new instance of the TdeCertificatesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal TdeCertificatesOperations(SqlManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SqlManagementClient + /// + public SqlManagementClient Client { get; private set; } + + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task CreateWithHttpMessagesAsync(string resourceGroupName, string serverName, TdeCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginCreateWithHttpMessagesAsync(string resourceGroupName, string serverName, TdeCertificate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Generated/TdeCertificatesOperationsExtensions.cs b/src/SDKs/SqlManagement/Management.Sql/Generated/TdeCertificatesOperationsExtensions.cs new file mode 100644 index 000000000000..16c498788fd6 --- /dev/null +++ b/src/SDKs/SqlManagement/Management.Sql/Generated/TdeCertificatesOperationsExtensions.cs @@ -0,0 +1,115 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Sql +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for TdeCertificatesOperations. + /// + public static partial class TdeCertificatesOperationsExtensions + { + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + public static void Create(this ITdeCertificatesOperations operations, string resourceGroupName, string serverName, TdeCertificate parameters) + { + operations.CreateAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this ITdeCertificatesOperations operations, string resourceGroupName, string serverName, TdeCertificate parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.CreateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + public static void BeginCreate(this ITdeCertificatesOperations operations, string resourceGroupName, string serverName, TdeCertificate parameters) + { + operations.BeginCreateAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a TDE certificate for a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the resource. You can obtain + /// this value from the Azure Resource Manager API or the portal. + /// + /// + /// The name of the server. + /// + /// + /// The requested TDE certificate to be created or updated. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this ITdeCertificatesOperations operations, string resourceGroupName, string serverName, TdeCertificate parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/src/SDKs/SqlManagement/Management.Sql/Microsoft.Azure.Management.Sql.csproj b/src/SDKs/SqlManagement/Management.Sql/Microsoft.Azure.Management.Sql.csproj index 0a780c08a1ec..cbd2226f898a 100644 --- a/src/SDKs/SqlManagement/Management.Sql/Microsoft.Azure.Management.Sql.csproj +++ b/src/SDKs/SqlManagement/Management.Sql/Microsoft.Azure.Management.Sql.csproj @@ -13,6 +13,7 @@ diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateManagedInstanceTdeCertificate.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateManagedInstanceTdeCertificate.json new file mode 100644 index 000000000000..7a339f25c613 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateManagedInstanceTdeCertificate.json @@ -0,0 +1,203 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/MlAndzic_RG/providers/Microsoft.Sql/managedInstances/midemoinstance/tdeCertificates?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL01sQW5kemljX1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL21hbmFnZWRJbnN0YW5jZXMvbWlkZW1vaW5zdGFuY2UvdGRlQ2VydGlmaWNhdGVzP2FwaS12ZXJzaW9uPTIwMTctMTAtMDEtcHJldmlldw==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"properties\": {\r\n \"privateBlob\": \"MIIJ+QIBAzCCCbUGCSqGSIb3DQEHAaCCCaYEggmiMIIJnjCCBhcGCSqGSIb3DQEHAaCCBggEggYEMIIGADCCBfwGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAgUeBd7F2KZUwICB9AEggTYSRi88/Xf0EZ9smyYDCr+jHa7a/510s19/5wjqGbLTT/CYBu2qSOhj+g9sNvjj5oWAcluaZ4XCl/oJhXlB+9q9ZYSC6pPhma7/Il+/zlZm8ZUMfgnUefpKXGj+Ilydghya2DOA0PONDGbqIJGBYC0JgtiL7WcYyA+LEiO0vXc2fZ+ccjQsHM+ePFOm6rTJ1oqE3quRC5Ls2Bv22PCmF+GWkWxqH1L5x8wR2tYfecEsx4sKMj318novQqBlJckOUPDrTT2ic6izFnDWS+zbGezSCeRkt2vjCUVDg7Aqm2bkmLVn+arA3tDZ/DBxgTwwt8prpAznDYG07WRxXMUk8Uqzmcds85jSMLSBOoRaS7GwIPprx0QwyYXd8H/go2vafuGCydRk8mA0bGLXjYWuYHAtztlGrE71a7ILqHY4XankohSAY4YF9Fc1mJcdtsuICs5vNosw1lf0VK5BR4ONCkiGFdYEKUpaUrzKpQiw3zteBN8RQs/ADKGWzaWERrkptf0pLH3/QnZvu9xwwnNWneygByPy7OVYrvgjD27x7Y/C24GyQweh75OTQN3fA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RLpUN50ZekFVska+C27hJRJEZ9rSdVhOVdL1UNknuwqF1cCQQriaNsnCbeVHN3/Wgsms9+Kt+glBNyZQlU8Fk+fafcQFI5MlxyMmARVwnC70F8AScnJPPFVZIdgIrvOXCDrEh8wFgkVM/MHkaTZUF51yy3pbIZaPmNd5dsUfEvMsW2IY6esnUUxPRQUUoi5Ib8EFHdiQJrYY3ELfZRXb2I1Xd0DVhlGzogn3CXZtXR2gSAakdB0qrLpXMSJNS65SS2tVTD7SI8OpUGNRjthQIAEEROPue10geFUwarWi/3jGMG529SzwDUJ4g0ix6VtcuLIDYFNdClDTyEyeV1f70NSG2QVXPIpeF7WQ8jWK7kenGaqqna4C4FYQpQk9vJP171nUXLR2mUR11bo1N4hcVhXnJls5yo9u14BB9CqVKXeDl7M5zwMDswHzAHBgUrDgMCGgQUT6Tjuka1G4O/ZCBxO7NBR34YUYQEFLaheEdRIIuxUd25/hl5vf2SFuZuAgIH0A==\",\r\n \"certPassword\": \"\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "3488" + ], + "x-ms-client-request-id": [ + "d8d1b7cf-0476-4232-a065-5a07574b1a54" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertManagedInstanceTdeCertificate\",\r\n \"startTime\": \"2018-06-15T22:06:17.927Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "90" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:06:17 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/MlAndzic_RG/providers/Microsoft.Sql/locations/westeurope/managedInstanceTdeCertOperationResults/fe7af442-b831-41e1-b175-99f62b4cab46?api-version=2017-10-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/MlAndzic_RG/providers/Microsoft.Sql/locations/westeurope/managedInstanceTdeCertAzureAsyncOperation/fe7af442-b831-41e1-b175-99f62b4cab46?api-version=2017-10-01-preview" + ], + "x-ms-request-id": [ + "fe7af442-b831-41e1-b175-99f62b4cab46" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "b4e8cb25-47d4-41b5-b95a-1cf236d1e5dd" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220618Z:b4e8cb25-47d4-41b5-b95a-1cf236d1e5dd" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/MlAndzic_RG/providers/Microsoft.Sql/locations/westeurope/managedInstanceTdeCertAzureAsyncOperation/fe7af442-b831-41e1-b175-99f62b4cab46?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL01sQW5kemljX1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy93ZXN0ZXVyb3BlL21hbmFnZWRJbnN0YW5jZVRkZUNlcnRBenVyZUFzeW5jT3BlcmF0aW9uL2ZlN2FmNDQyLWI4MzEtNDFlMS1iMTc1LTk5ZjYyYjRjYWI0Nj9hcGktdmVyc2lvbj0yMDE3LTEwLTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"fe7af442-b831-41e1-b175-99f62b4cab46\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-06-15T22:06:17.927Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:06:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "d5303ee2-5b95-4955-82c2-b6a254fbb2e4" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "4eea8947-daf2-46e2-a59e-44f5a1c1d464" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220628Z:4eea8947-daf2-46e2-a59e-44f5a1c1d464" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/MlAndzic_RG/providers/Microsoft.Sql/locations/westeurope/managedInstanceTdeCertOperationResults/fe7af442-b831-41e1-b175-99f62b4cab46?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL01sQW5kemljX1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL2xvY2F0aW9ucy93ZXN0ZXVyb3BlL21hbmFnZWRJbnN0YW5jZVRkZUNlcnRPcGVyYXRpb25SZXN1bHRzL2ZlN2FmNDQyLWI4MzEtNDFlMS1iMTc1LTk5ZjYyYjRjYWI0Nj9hcGktdmVyc2lvbj0yMDE3LTEwLTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"certificateName\": \"CN=TdeTestCert\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/MlAndzic_RG/providers/Microsoft.Sql/managedInstances/midemoinstance/tdeCertificates\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/managedInstances/tdeCertificates\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:06:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "c0842e7d-d6e3-4b5e-87e9-7bbaf6b5a76c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14998" + ], + "x-ms-correlation-request-id": [ + "8431455b-278b-4d9e-a114-fd00a3d66745" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220628Z:8431455b-278b-4d9e-a114-fd00a3d66745" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a8c9a924-06c0-4bde-9788-e7b1370969e1" + } +} \ No newline at end of file diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateManagedInstanceTdeCertificate_InvalidBlob.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateManagedInstanceTdeCertificate_InvalidBlob.json new file mode 100644 index 000000000000..08fa5dc0f0e2 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateManagedInstanceTdeCertificate_InvalidBlob.json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/MlAndzic_RG/providers/Microsoft.Sql/managedInstances/midemoinstance/tdeCertificates?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL01sQW5kemljX1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL21hbmFnZWRJbnN0YW5jZXMvbWlkZW1vaW5zdGFuY2UvdGRlQ2VydGlmaWNhdGVzP2FwaS12ZXJzaW9uPTIwMTctMTAtMDEtcHJldmlldw==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"properties\": {\r\n \"privateBlob\": \"MIIJ+QIBAzCCCbUGCSqGSIb3DQEHAaCCCaYEggmiMIIJnjCCBhcGCSqGSIb3DasdsadasdasdQEHAaCCBggEggYEMIIGADCCBfwGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAgUeBd7F2KZUwICB9AEggTYSRi88/Xf0EZ9smyYDCr+jHa7a/510s19/5wjqGbLTT/CYBu2qSOhj+g9sNvjj5oWAcluaZ4XCl/oJhXlB+9q9ZYSC6pPhma7/Il+/zlZm8ZUMfgnUefpKXGj+Ilydghya2DOA0PONDGbqIJGBYC0JgtiL7WcYyA+LEiO0vXc2fZ+ccjQsHM+ePFOm6rTJ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DQa8+CGiWMm6mxboUOIcUGasaDqYQ8pSAgZZqQf8lU0uH4FP/z/5Dd7PniDHjvqlwYa+vB6flgtrwh6jYFeTKluhkucLrfzusFR52kHpg8K4GaUL8MhvlsNdd8iHSFjfyOdXRpY9re+B8X9Eorx0Z3xsSsVWaCwmI+Spq+BZ5CSXVm9Um6ogeM0et8JciZS2yFLIlbl2o4U1BWblskYfj/29jm4/2UKjKzORZnpjE0O+qP4hReSrx6os9dr8sNkq/7OafZock8zXjXaOpW6bqB1V5NWMPiWiPxPxfRi1F/MQp6CPY03H7MsDALEFcF7MmtY4YpN/+FFfrrOwS19Fg0OnQzNIgFpSRywX9dxyKICt/wbvhM+RLpUN50ZekFVska+C27hJRJEZ9rSdVhOVdL1UNknuwqF1cCQQriaNsnCbeVHN3/Wgsms9+Kt+glBNyZQlU8Fk+fafcQFI5MlxyMmARVwnC70F8AScnJPPFVZIdgIrvOXCDrEh8wFgkVM/MHkaTZUF51yy3pbIZaPmNd5dsUfEvMsW2IY6esnUUxPRQUUoi5Ib8EFHdiQJrYY3ELfZRXb2I1Xd0DVhlGzogn3CXZtXR2gSAakdB0qrLpXMSJNS65SS2tVTD7SI8OpUGNRjthQIAEEROPue10geFUwarWi/3jGMG529SzwDUJ4g0ix6VtcuLIDYFNdClDTyEyeV1f70NSG2QVXPIpeF7WQ8jWK7kenGaqqna4C4FYQpQk9vJP171nUXLR2mUR11bo1N4hcVhXnJls5yo9u14BB9CqVKXeDl7M5zwMDswHzAHBgUrDgMCGgQUT6Tjuka1G4O/ZCBxO7NBR34YUYQEFLaheEdRIIuxUd25/hl5vf2SFuZuAgIH0A==\",\r\n \"certPassword\": \"\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "3500" + ], + "x-ms-client-request-id": [ + "466423d4-6ef0-40ce-8e4a-0c1af9d67ec0" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"InvalidPrivateBlobOrPassword\",\r\n \"message\": \"Invalid private blob or password specified: Cannot find the requested object.\\r\\n\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "143" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:06:39 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "732893a1-d781-4434-8a0c-5ea2c7f118ef" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "0e12b92f-7dd9-4524-9907-82aebac29420" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220639Z:0e12b92f-7dd9-4524-9907-82aebac29420" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 400 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a8c9a924-06c0-4bde-9788-e7b1370969e1" + } +} \ No newline at end of file diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateManagedInstanceTdeCertificate_InvalidPassword.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateManagedInstanceTdeCertificate_InvalidPassword.json new file mode 100644 index 000000000000..cfd51c30117b --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateManagedInstanceTdeCertificate_InvalidPassword.json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/MlAndzic_RG/providers/Microsoft.Sql/managedInstances/midemoinstance/tdeCertificates?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL01sQW5kemljX1JHL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3FsL21hbmFnZWRJbnN0YW5jZXMvbWlkZW1vaW5zdGFuY2UvdGRlQ2VydGlmaWNhdGVzP2FwaS12ZXJzaW9uPTIwMTctMTAtMDEtcHJldmlldw==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"properties\": {\r\n \"privateBlob\": \"MIIJ+QIBAzCCCbUGCSqGSIb3DQEHAaCCCaYEggmiMIIJnjCCBhcGCSqGSIb3DQEHAaCCBggEggYEMIIGADCCBfwGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAgUeBd7F2KZUwICB9AEggTYSRi88/Xf0EZ9smyYDCr+jHa7a/510s19/5wjqGbLTT/CYBu2qSOhj+g9sNvjj5oWAcluaZ4XCl/oJhXlB+9q9ZYSC6pPhma7/Il+/zlZm8ZUMfgnUefpKXGj+Ilydghya2DOA0PONDGbqIJGBYC0JgtiL7WcYyA+LEiO0vXc2fZ+ccjQsHM+ePFOm6rTJ1oqE3quRC5Ls2Bv22PCmF+GWkWxqH1L5x8wR2tYfecEsx4sKMj318novQqBlJckOUPDrTT2ic6izFnDWS+zbGezSCeRkt2vjCUVDg7Aqm2bkmLVn+arA3tDZ/DBxgTwwt8prpAznDYG07WRxXMUk8Uqzmcds85jSMLSBOoRaS7GwIPprx0QwyYXd8H/go2vafuGCydRk8mA0bGLXjYWuYHAtztlGrE71a7ILqHY4XankohSAY4YF9Fc1mJcdtsuICs5vNosw1lf0VK5BR4ONCkiGFdYEKUpaUrzKpQiw3zteBN8RQs/ADKGWzaWERrkptf0pLH3/QnZvu9xwwnNWneygByPy7OVYrvgjD27x7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RywX9dxyKICt/wbvhM+RLpUN50ZekFVska+C27hJRJEZ9rSdVhOVdL1UNknuwqF1cCQQriaNsnCbeVHN3/Wgsms9+Kt+glBNyZQlU8Fk+fafcQFI5MlxyMmARVwnC70F8AScnJPPFVZIdgIrvOXCDrEh8wFgkVM/MHkaTZUF51yy3pbIZaPmNd5dsUfEvMsW2IY6esnUUxPRQUUoi5Ib8EFHdiQJrYY3ELfZRXb2I1Xd0DVhlGzogn3CXZtXR2gSAakdB0qrLpXMSJNS65SS2tVTD7SI8OpUGNRjthQIAEEROPue10geFUwarWi/3jGMG529SzwDUJ4g0ix6VtcuLIDYFNdClDTyEyeV1f70NSG2QVXPIpeF7WQ8jWK7kenGaqqna4C4FYQpQk9vJP171nUXLR2mUR11bo1N4hcVhXnJls5yo9u14BB9CqVKXeDl7M5zwMDswHzAHBgUrDgMCGgQUT6Tjuka1G4O/ZCBxO7NBR34YUYQEFLaheEdRIIuxUd25/hl5vf2SFuZuAgIH0A==\",\r\n \"certPassword\": \"asdsadsad\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "3497" + ], + "x-ms-client-request-id": [ + "7ed3847b-3cf4-48e4-b10c-b2de0f84be9d" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"InvalidPrivateBlobOrPassword\",\r\n \"message\": \"Invalid private blob or password specified: The specified network password is not correct.\\r\\n\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "156" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:06:45 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "bb72bc97-00fb-42ce-aa7d-01ac143a3f38" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "9e257b6d-5a6d-4d6f-9662-624c6dfa1461" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220646Z:9e257b6d-5a6d-4d6f-9662-624c6dfa1461" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 400 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "a8c9a924-06c0-4bde-9788-e7b1370969e1" + } +} \ No newline at end of file diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificate.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificate.json new file mode 100644 index 000000000000..9d4ecc9f33d5 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificate.json @@ -0,0 +1,653 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourcegroups/sqlcrudtest-3224?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTMyMjQ/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westeurope\",\r\n \"tags\": {\r\n \"sqlcrudtest-3224\": \"2018-06-15 22:04:50Z\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "99" + ], + "x-ms-client-request-id": [ + "cfb1e272-b909-4556-a2d3-6dbb05f0506b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224\",\r\n \"name\": \"sqlcrudtest-3224\",\r\n \"location\": \"westeurope\",\r\n \"tags\": {\r\n \"sqlcrudtest-3224\": \"2018-06-15 22:04:50Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "240" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:04:53 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "cb9a6754-fcdb-4fe2-b4fe-d0bb8fae2ac1" + ], + "x-ms-correlation-request-id": [ + "cb9a6754-fcdb-4fe2-b4fe-d0bb8fae2ac1" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220453Z:cb9a6754-fcdb-4fe2-b4fe-d0bb8fae2ac1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/servers/sqlcrudtest-3415?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTMyMjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNDE1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"version\": \"12.0\"\r\n },\r\n \"tags\": {},\r\n \"location\": \"westeurope\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "184" + ], + "x-ms-client-request-id": [ + "f2097bdc-0458-4e82-b7c7-1dccc199595e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertLogicalServer\",\r\n \"startTime\": \"2018-06-15T22:05:02.61Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "73" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:05:02 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/locations/westeurope/serverOperationResults/fcab1380-74b7-4734-8a4b-1095e54757f8?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/fcab1380-74b7-4734-8a4b-1095e54757f8?api-version=2015-05-01-preview" + ], + "x-ms-request-id": [ + "fcab1380-74b7-4734-8a4b-1095e54757f8" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "7e9570fe-2f2d-4252-9b5d-82bd4eb0aa97" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220502Z:7e9570fe-2f2d-4252-9b5d-82bd4eb0aa97" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/fcab1380-74b7-4734-8a4b-1095e54757f8?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTMyMjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi9mY2FiMTM4MC03NGI3LTQ3MzQtOGE0Yi0xMDk1ZTU0NzU3Zjg/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"fcab1380-74b7-4734-8a4b-1095e54757f8\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-06-15T22:05:02.61Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:05:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "bc16c4f8-09ea-4330-90eb-318589d1966a" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "679cd681-7aad-475f-8c68-5ebbc168d669" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220513Z:679cd681-7aad-475f-8c68-5ebbc168d669" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/fcab1380-74b7-4734-8a4b-1095e54757f8?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTMyMjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi9mY2FiMTM4MC03NGI3LTQ3MzQtOGE0Yi0xMDk1ZTU0NzU3Zjg/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"fcab1380-74b7-4734-8a4b-1095e54757f8\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-06-15T22:05:02.61Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:05:33 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "4918bec2-daec-4a5e-8d16-67219ad377f1" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14998" + ], + "x-ms-correlation-request-id": [ + "7891a525-f38e-43ab-b288-94413ee92748" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220533Z:7891a525-f38e-43ab-b288-94413ee92748" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/fcab1380-74b7-4734-8a4b-1095e54757f8?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTMyMjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi9mY2FiMTM4MC03NGI3LTQ3MzQtOGE0Yi0xMDk1ZTU0NzU3Zjg/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"fcab1380-74b7-4734-8a4b-1095e54757f8\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-06-15T22:05:02.61Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:05:53 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "5545cc89-d7fc-4a83-bcf1-5f772ec2fbfb" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14997" + ], + "x-ms-correlation-request-id": [ + "2ea538d9-3b94-4f16-b5f2-a24cd192aa97" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220553Z:2ea538d9-3b94-4f16-b5f2-a24cd192aa97" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/servers/sqlcrudtest-3415?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTMyMjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC0zNDE1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\",\r\n \"fullyQualifiedDomainName\": \"sqlcrudtest-3415.database.windows.net\"\r\n },\r\n \"location\": \"westeurope\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/servers/sqlcrudtest-3415\",\r\n \"name\": \"sqlcrudtest-3415\",\r\n \"type\": \"Microsoft.Sql/servers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:05:53 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "c9ea6be4-36a1-4845-87bf-00a557679e67" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14996" + ], + "x-ms-correlation-request-id": [ + "546d1c0c-13c4-41a5-a43c-a305e20e281a" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220553Z:546d1c0c-13c4-41a5-a43c-a305e20e281a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/servers/sqlcrudtest-3415/tdeCertificates?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTMyMjQvcHJvdmlkZXJzL01pY3Jvc29md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HdiQJrYY3ELfZRXb2I1Xd0DVhlGzogn3CXZtXR2gSAakdB0qrLpXMSJNS65SS2tVTD7SI8OpUGNRjthQIAEEROPue10geFUwarWi/3jGMG529SzwDUJ4g0ix6VtcuLIDYFNdClDTyEyeV1f70NSG2QVXPIpeF7WQ8jWK7kenGaqqna4C4FYQpQk9vJP171nUXLR2mUR11bo1N4hcVhXnJls5yo9u14BB9CqVKXeDl7M5zwMDswHzAHBgUrDgMCGgQUT6Tjuka1G4O/ZCBxO7NBR34YUYQEFLaheEdRIIuxUd25/hl5vf2SFuZuAgIH0A==\",\r\n \"certPassword\": \"\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "3488" + ], + "x-ms-client-request-id": [ + "d526dfd8-2a47-493a-9506-610707883a8b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertCustomerTdeCertificate\",\r\n \"startTime\": \"2018-06-15T22:05:54.147Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "83" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:05:53 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/locations/westeurope/tdeCertOperationResults/63c4b0e8-b8e1-4b47-83b0-92f554c1f5a7?api-version=2017-10-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/locations/westeurope/tdeCertAzureAsyncOperation/63c4b0e8-b8e1-4b47-83b0-92f554c1f5a7?api-version=2017-10-01-preview" + ], + "x-ms-request-id": [ + "63c4b0e8-b8e1-4b47-83b0-92f554c1f5a7" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "3325109a-f4c8-4347-8ee4-467044ef6089" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220554Z:3325109a-f4c8-4347-8ee4-467044ef6089" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/locations/westeurope/tdeCertAzureAsyncOperation/63c4b0e8-b8e1-4b47-83b0-92f554c1f5a7?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTMyMjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvdGRlQ2VydEF6dXJlQXN5bmNPcGVyYXRpb24vNjNjNGIwZTgtYjhlMS00YjQ3LTgzYjAtOTJmNTU0YzFmNWE3P2FwaS12ZXJzaW9uPTIwMTctMTAtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"63c4b0e8-b8e1-4b47-83b0-92f554c1f5a7\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-06-15T22:05:54.147Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:06:03 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e6036f1d-7db9-4038-af84-46163ae04362" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-correlation-request-id": [ + "5c23eada-9161-451f-abef-02c10d46f172" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220604Z:5c23eada-9161-451f-abef-02c10d46f172" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/locations/westeurope/tdeCertOperationResults/63c4b0e8-b8e1-4b47-83b0-92f554c1f5a7?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTMyMjQvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvdGRlQ2VydE9wZXJhdGlvblJlc3VsdHMvNjNjNGIwZTgtYjhlMS00YjQ3LTgzYjAtOTJmNTU0YzFmNWE3P2FwaS12ZXJzaW9uPTIwMTctMTAtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"certificateName\": \"CN=TdeTestCert\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-3224/providers/Microsoft.Sql/servers/sqlcrudtest-3415/tdeCertificates/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/tdeCertificates\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:06:04 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "dcb341f5-4422-4475-a47a-dc4d7487676d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14994" + ], + "x-ms-correlation-request-id": [ + "fc6a57c4-8698-43be-8085-295996506c33" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220605Z:fc6a57c4-8698-43be-8085-295996506c33" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourcegroups/sqlcrudtest-3224?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTMyMjQ/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e63d41d8-1d0f-4da2-bb34-9ccf310a0ce9" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:06:07 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDMyMjQtV0VTVEVVUk9QRSIsImpvYkxvY2F0aW9uIjoid2VzdGV1cm9wZSJ9?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-request-id": [ + "fd89eb38-8045-4ec8-ae6d-3817e0bcc79e" + ], + "x-ms-correlation-request-id": [ + "fd89eb38-8045-4ec8-ae6d-3817e0bcc79e" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220607Z:fd89eb38-8045-4ec8-ae6d-3817e0bcc79e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + } + ], + "Names": { + "CreateResourceGroup": [ + "sqlcrudtest-3224" + ], + "CreateServer": [ + "sqlcrudtest-3415" + ] + }, + "Variables": { + "SubscriptionId": "a8c9a924-06c0-4bde-9788-e7b1370969e1", + "DefaultLocation": "westeurope" + } +} \ No newline at end of file diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificateInvalidBlob.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificateInvalidBlob.json new file mode 100644 index 000000000000..78418057d5a9 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificateInvalidBlob.json @@ -0,0 +1,653 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourcegroups/sqlcrudtest-7275?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTcyNzU/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westeurope\",\r\n \"tags\": {\r\n \"sqlcrudtest-7275\": \"2018-06-14 22:15:41Z\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "99" + ], + "x-ms-client-request-id": [ + "f93896a9-dd5c-4c06-999d-f81489392ef4" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275\",\r\n \"name\": \"sqlcrudtest-7275\",\r\n \"location\": \"westeurope\",\r\n \"tags\": {\r\n \"sqlcrudtest-7275\": \"2018-06-14 22:15:41Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "240" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 14 Jun 2018 22:15:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "c4720a7d-3c5e-403a-9bf6-d459af451904" + ], + "x-ms-correlation-request-id": [ + "c4720a7d-3c5e-403a-9bf6-d459af451904" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180614T221544Z:c4720a7d-3c5e-403a-9bf6-d459af451904" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/servers/sqlcrudtest-5333?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyNzUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC01MzMzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"version\": \"12.0\"\r\n },\r\n \"tags\": {},\r\n \"location\": \"westeurope\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "184" + ], + "x-ms-client-request-id": [ + "3e4e858e-49ce-41f6-9800-bf0ee6c14824" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertLogicalServer\",\r\n \"startTime\": \"2018-06-14T22:15:47.93Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "73" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 14 Jun 2018 22:15:47 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/locations/westeurope/serverOperationResults/e5bd3017-8ed4-4edf-b947-f267183311dc?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/e5bd3017-8ed4-4edf-b947-f267183311dc?api-version=2015-05-01-preview" + ], + "x-ms-request-id": [ + "e5bd3017-8ed4-4edf-b947-f267183311dc" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "24fff422-0c4f-46e7-8cf3-ffae92a37700" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180614T221548Z:24fff422-0c4f-46e7-8cf3-ffae92a37700" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/e5bd3017-8ed4-4edf-b947-f267183311dc?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyNzUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi9lNWJkMzAxNy04ZWQ0LTRlZGYtYjk0Ny1mMjY3MTgzMzExZGM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"e5bd3017-8ed4-4edf-b947-f267183311dc\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-06-14T22:15:47.93Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 14 Jun 2018 22:15:57 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "d8fb14f8-ee80-43c3-807f-0ee84a570f12" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "7ead9252-20c7-465c-9203-a2ba9483f842" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180614T221558Z:7ead9252-20c7-465c-9203-a2ba9483f842" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/e5bd3017-8ed4-4edf-b947-f267183311dc?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyNzUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi9lNWJkMzAxNy04ZWQ0LTRlZGYtYjk0Ny1mMjY3MTgzMzExZGM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"e5bd3017-8ed4-4edf-b947-f267183311dc\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-06-14T22:15:47.93Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 14 Jun 2018 22:16:17 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "8c206f85-f66e-423b-b09c-1838c10fc2ba" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14998" + ], + "x-ms-correlation-request-id": [ + "9406f18a-37cb-434d-8c2f-7e3886dc260d" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180614T221618Z:9406f18a-37cb-434d-8c2f-7e3886dc260d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/e5bd3017-8ed4-4edf-b947-f267183311dc?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyNzUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi9lNWJkMzAxNy04ZWQ0LTRlZGYtYjk0Ny1mMjY3MTgzMzExZGM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"e5bd3017-8ed4-4edf-b947-f267183311dc\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-06-14T22:15:47.93Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 14 Jun 2018 22:16:38 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "2b6f9918-33ed-4bfc-aa1f-ee751b7f56de" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14997" + ], + "x-ms-correlation-request-id": [ + "531b4c1f-7b9b-4de5-b83c-e73492a74b36" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180614T221638Z:531b4c1f-7b9b-4de5-b83c-e73492a74b36" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/servers/sqlcrudtest-5333?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyNzUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC01MzMzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\",\r\n \"fullyQualifiedDomainName\": \"sqlcrudtest-5333.database.windows.net\"\r\n },\r\n \"location\": \"westeurope\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/servers/sqlcrudtest-5333\",\r\n \"name\": \"sqlcrudtest-5333\",\r\n \"type\": \"Microsoft.Sql/servers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 14 Jun 2018 22:16:39 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "780a593a-a42e-445a-859f-f6ebe1c78791" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14996" + ], + "x-ms-correlation-request-id": [ + "ae041360-b54b-44be-9aae-378a540b7262" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180614T221639Z:ae041360-b54b-44be-9aae-378a540b7262" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/servers/sqlcrudtest-5333/tdeCertificates?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyNzUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC01MzMzL3RkZUNlcnRpZmljYXRlcz9hcGktdmVyc2lvbj0yMDE3LTEwLTAxLXByZXZpZXc=", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"properties\": {\r\n \"privateBlob\": \"MIIJ9QIBAzCCCbUGCSqGSIb3DQEHAaCCCaYEggmiMIIJnjCCBhcGCSqGSIb3DQEHAaCCBggEggYEMIIGADCCBfwGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAjp5NSulWTLKgICB9AEggTY6N0hFe0bGOOeA8QWerN5lPLFBji0GFQzkVFrgywKKjt0iI93Z8nUFUI2Y+1iVihuPBkOzJsR260p1ULPJBcBsXUuCS7iS6VA17D0EFRuO8/Ua7jNvVoajNmJixbRpebZRkq9ZRrzaq5l6Q5hlluz0YDuq6nTr6p1ual4V1I9sa3fOy7K4GCB/bnm8+SeC0je2sma0SePlU+W9/nnzWwZln00Qr3X4fHf1ndhwvwm0J/71jO2YeQmJJnZ74DHy2bFXOhWkrdkxPHGNWdreEQQKFOh8DZMXHdg7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RdrYs8xp6ArQHG34LjKOFjkB40x83SOdWiPemmdk9uo9mR03Eg2stW9i0woClKJ4bI2vBCHxy1V1Zehu6N07yYM5ywa0Y38Z90Yj+DVSPCh3YUsuTSFf6sGHWPE8BzvKLE/7DFJfIbd2P+1690nwbFSMMhXNHCjQGdx+8pJtLDffEOQiYTiEmK4qLPBYmh6rQSDPrHGiKJe1iPCb3EAJI+0HWZpE3K5mZ/pjy5cHTnl03M7qRReGUXwBXOGZXfBuEAg2bhUR+WOzrQaqyno9d9Gqo3navwJ3GRDQwEdcAsvfa1ntfcWExQ9gLZf2hMDqGUydn7pRyZYAso6uONNppmGgYHd+NGBsjLURoo/av87ChcMacdE8ceVyW0+lutqWH6FMDRemUi2K2Bw0z2S6pOB9WuIiw6zEtRgXhrwynPuHpc84Q9aYE+JENZNe+fWzpLiY+34brojCaCrObCbh343nzmSdDKuoHcl/9bvf2euG/Hj8B5CMvWPWeBkrvQrqgBPt3BqfR/ayidNen0DXHI9UIKeZlneYo0Al2YKx9GdQK+5JkMLBbi+ceTuvhmHV2TnXHkHPDxiCm0WJ02GVhPV8wmCrCTMVRDqAlSTzLUM7yHxslbxHEuLu9TI1669VFa6Tcll3ES2o2lVEGNHW2HVJHnejJmPNVoOIgz2PrX8XES2DWS/rudoOyW2AFjoOPO3v0gojBxnO9xMi1zEYMDcwHzAHBgUrDgMCGgQUQOMflYKW/5ZZBFc+2qc5c/PzY4sEFKQq2cakpNRQSo8nuSOJQgcqTsjy\",\r\n \"certPassword\": \"\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "3480" + ], + "x-ms-client-request-id": [ + "6354789a-3d53-434e-b647-c84d2fa2640f" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertCustomerTdeCertificate\",\r\n \"startTime\": \"2018-06-14T22:16:39.893Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "83" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 14 Jun 2018 22:16:39 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/locations/westeurope/tdeCertOperationResults/1b936b28-d1c4-484f-9080-04574cb387ed?api-version=2017-10-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/locations/westeurope/tdeCertAzureAsyncOperation/1b936b28-d1c4-484f-9080-04574cb387ed?api-version=2017-10-01-preview" + ], + "x-ms-request-id": [ + "1b936b28-d1c4-484f-9080-04574cb387ed" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "2bba4e9c-8767-4d99-ab23-a5d6e730ee1f" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180614T221639Z:2bba4e9c-8767-4d99-ab23-a5d6e730ee1f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/locations/westeurope/tdeCertAzureAsyncOperation/1b936b28-d1c4-484f-9080-04574cb387ed?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyNzUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvdGRlQ2VydEF6dXJlQXN5bmNPcGVyYXRpb24vMWI5MzZiMjgtZDFjNC00ODRmLTkwODAtMDQ1NzRjYjM4N2VkP2FwaS12ZXJzaW9uPTIwMTctMTAtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"1b936b28-d1c4-484f-9080-04574cb387ed\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-06-14T22:16:39.893Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 14 Jun 2018 22:16:49 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "6538a07c-76b9-4e8e-bcfc-4c943dbec7e5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-correlation-request-id": [ + "3a67fa89-a7b4-40d4-8371-824fa8544b27" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180614T221650Z:3a67fa89-a7b4-40d4-8371-824fa8544b27" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/locations/westeurope/tdeCertOperationResults/1b936b28-d1c4-484f-9080-04574cb387ed?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTcyNzUvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvdGRlQ2VydE9wZXJhdGlvblJlc3VsdHMvMWI5MzZiMjgtZDFjNC00ODRmLTkwODAtMDQ1NzRjYjM4N2VkP2FwaS12ZXJzaW9uPTIwMTctMTAtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"certificateName\": \"CN=TdeTestCert\"\r\n },\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7275/providers/Microsoft.Sql/servers/sqlcrudtest-5333/tdeCertificates/current\",\r\n \"name\": \"current\",\r\n \"type\": \"Microsoft.Sql/servers/tdeCertificates\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 14 Jun 2018 22:16:50 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "16bd181f-16d4-4591-b374-0e4b6728173f" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14994" + ], + "x-ms-correlation-request-id": [ + "d6a569ef-252f-4428-a7a7-bda3d824f5d3" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180614T221651Z:d6a569ef-252f-4428-a7a7-bda3d824f5d3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourcegroups/sqlcrudtest-7275?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTcyNzU/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "558b1f87-c54f-49f9-a4f4-0dd04b4eda34" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 14 Jun 2018 22:16:53 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDcyNzUtV0VTVEVVUk9QRSIsImpvYkxvY2F0aW9uIjoid2VzdGV1cm9wZSJ9?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14998" + ], + "x-ms-request-id": [ + "a04b1501-9f0e-44ee-ae16-896350e8228c" + ], + "x-ms-correlation-request-id": [ + "a04b1501-9f0e-44ee-ae16-896350e8228c" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180614T221653Z:a04b1501-9f0e-44ee-ae16-896350e8228c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + } + ], + "Names": { + "CreateResourceGroup": [ + "sqlcrudtest-7275" + ], + "CreateServer": [ + "sqlcrudtest-5333" + ] + }, + "Variables": { + "DefaultLocation": "westeurope", + "SubscriptionId": "a8c9a924-06c0-4bde-9788-e7b1370969e1" + } +} \ No newline at end of file diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificate_InvalidBlob.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificate_InvalidBlob.json new file mode 100644 index 000000000000..b85397e8466e --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificate_InvalidBlob.json @@ -0,0 +1,525 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourcegroups/sqlcrudtest-7621?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTc2MjE/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westeurope\",\r\n \"tags\": {\r\n \"sqlcrudtest-7621\": \"2018-06-15 22:06:56Z\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "99" + ], + "x-ms-client-request-id": [ + "8572685e-455b-444f-841d-34c4f7300f91" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7621\",\r\n \"name\": \"sqlcrudtest-7621\",\r\n \"location\": \"westeurope\",\r\n \"tags\": {\r\n \"sqlcrudtest-7621\": \"2018-06-15 22:06:56Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "240" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:06:57 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "442c0124-548a-49cd-849a-33771af54cee" + ], + "x-ms-correlation-request-id": [ + "442c0124-548a-49cd-849a-33771af54cee" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220657Z:442c0124-548a-49cd-849a-33771af54cee" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7621/providers/Microsoft.Sql/servers/sqlcrudtest-8818?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTc2MjEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC04ODE4P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"version\": \"12.0\"\r\n },\r\n \"tags\": {},\r\n \"location\": \"westeurope\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "184" + ], + "x-ms-client-request-id": [ + "d3cb120a-75c4-4140-ab3b-3987607bf9d3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertLogicalServer\",\r\n \"startTime\": \"2018-06-15T22:07:06.527Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "74" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:07:05 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7621/providers/Microsoft.Sql/locations/westeurope/serverOperationResults/0153c60f-17a7-4ff4-99f0-22ee05320283?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7621/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/0153c60f-17a7-4ff4-99f0-22ee05320283?api-version=2015-05-01-preview" + ], + "x-ms-request-id": [ + "0153c60f-17a7-4ff4-99f0-22ee05320283" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "fd391a25-c355-4d29-bce0-c7e015b1a66a" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220706Z:fd391a25-c355-4d29-bce0-c7e015b1a66a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7621/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/0153c60f-17a7-4ff4-99f0-22ee05320283?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTc2MjEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi8wMTUzYzYwZi0xN2E3LTRmZjQtOTlmMC0yMmVlMDUzMjAyODM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"0153c60f-17a7-4ff4-99f0-22ee05320283\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-06-15T22:07:06.527Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:07:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "7580fb5d-785f-437b-81eb-999a5f53b72d" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "ffe66f97-8606-47e4-a676-4701888541f8" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220716Z:ffe66f97-8606-47e4-a676-4701888541f8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7621/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/0153c60f-17a7-4ff4-99f0-22ee05320283?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTc2MjEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi8wMTUzYzYwZi0xN2E3LTRmZjQtOTlmMC0yMmVlMDUzMjAyODM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"0153c60f-17a7-4ff4-99f0-22ee05320283\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-06-15T22:07:06.527Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:07:37 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "608fdeac-301e-4342-b4b8-6290e458b680" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14998" + ], + "x-ms-correlation-request-id": [ + "557a2788-03e7-4b3a-a73a-56cf9d155926" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220737Z:557a2788-03e7-4b3a-a73a-56cf9d155926" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7621/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/0153c60f-17a7-4ff4-99f0-22ee05320283?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTc2MjEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvbG9jYXRpb25zL3dlc3RldXJvcGUvc2VydmVyQXp1cmVBc3luY09wZXJhdGlvbi8wMTUzYzYwZi0xN2E3LTRmZjQtOTlmMC0yMmVlMDUzMjAyODM/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"0153c60f-17a7-4ff4-99f0-22ee05320283\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-06-15T22:07:06.527Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:07:56 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "28b08a59-474f-4107-bc55-b14db63dad26" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14997" + ], + "x-ms-correlation-request-id": [ + "fcf3dc21-f0e1-4cd2-ab34-f42116eb10ef" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220757Z:fcf3dc21-f0e1-4cd2-ab34-f42116eb10ef" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7621/providers/Microsoft.Sql/servers/sqlcrudtest-8818?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTc2MjEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC04ODE4P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\",\r\n \"fullyQualifiedDomainName\": \"sqlcrudtest-8818.database.windows.net\"\r\n },\r\n \"location\": \"westeurope\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7621/providers/Microsoft.Sql/servers/sqlcrudtest-8818\",\r\n \"name\": \"sqlcrudtest-8818\",\r\n \"type\": \"Microsoft.Sql/servers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:07:57 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "c355db7c-8093-4fad-9483-19e7fd55cfe3" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14996" + ], + "x-ms-correlation-request-id": [ + "0fdaddf8-8aa7-4265-bafe-2cdbcab5697d" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220758Z:0fdaddf8-8aa7-4265-bafe-2cdbcab5697d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-7621/providers/Microsoft.Sql/servers/sqlcrudtest-8818/tdeCertificates?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTc2MjEvcHJvdmlkZXJzL01pY3Jvc29mdC5TcWwvc2VydmVycy9zcWxjcnVkdGVzdC04ODE4L3RkZUNlcnRpZmljYXRlcz9hcGktdmVyc2lvbj0yMDE3LTEwLTAxLXByZXZpZXc=", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"properties\": {\r\n \"privateBlob\":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QVXPIpeF7WQ8jWK7kenGaqqna4C4FYQpQk9vJP171nUXLR2mUR11bo1N4hcVhXnJls5yo9u14BB9CqVKXeDl7M5zwMDswHzAHBgUrDgMCGgQUT6Tjuka1G4O/ZCBxO7NBR34YUYQEFLaheEdRIIuxUd25/hl5vf2SFuZuAgIH0A==\",\r\n \"certPassword\": \"\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "3500" + ], + "x-ms-client-request-id": [ + "2690bc53-98e5-4c68-b030-26d39c59abcc" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"InvalidPrivateBlobOrPassword\",\r\n \"message\": \"Invalid private blob or password specified: Cannot find the requested object.\\r\\n\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "143" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:07:57 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "95081536-efe3-4dde-b83c-7d40d72be013" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "ae188525-22a8-48d2-a8a4-22a0abe83b5e" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220758Z:ae188525-22a8-48d2-a8a4-22a0abe83b5e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 400 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourcegroups/sqlcrudtest-7621?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTc2MjE/YXBpLXZlcnNpb249MjAxNy0wNS0xMA==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e82a551c-704a-4961-a0a9-6117e3798297" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:08:01 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDc2MjEtV0VTVEVVUk9QRSIsImpvYkxvY2F0aW9uIjoid2VzdGV1cm9wZSJ9?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-request-id": [ + "e42b7283-54de-41df-b85a-ab7bd2a27bdf" + ], + "x-ms-correlation-request-id": [ + "e42b7283-54de-41df-b85a-ab7bd2a27bdf" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220802Z:e42b7283-54de-41df-b85a-ab7bd2a27bdf" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + } + ], + "Names": { + "CreateResourceGroup": [ + "sqlcrudtest-7621" + ], + "CreateServer": [ + "sqlcrudtest-8818" + ] + }, + "Variables": { + "DefaultLocation": "westeurope", + "SubscriptionId": "a8c9a924-06c0-4bde-9788-e7b1370969e1" + } +} \ No newline at end of file diff --git a/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificate_InvalidPassword.json b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificate_InvalidPassword.json new file mode 100644 index 000000000000..1c1e9ee7a4bf --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/SessionRecords/Sql.Tests.UploadTdeCertificateScenarioTests/TestCreateTdeCertificate_InvalidPassword.json @@ -0,0 +1,525 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourcegroups/sqlcrudtest-475?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTQ3NT9hcGktdmVyc2lvbj0yMDE3LTA1LTEw", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westeurope\",\r\n \"tags\": {\r\n \"sqlcrudtest-475\": \"2018-06-15 22:08:11Z\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "98" + ], + "x-ms-client-request-id": [ + "12689f99-ba84-414a-831e-f52ad3b3ff32" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-475\",\r\n \"name\": \"sqlcrudtest-475\",\r\n \"location\": \"westeurope\",\r\n \"tags\": {\r\n \"sqlcrudtest-475\": \"2018-06-15 22:08:11Z\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "237" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:08:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "45cab3de-5e15-42be-abe9-dd496a4f824b" + ], + "x-ms-correlation-request-id": [ + "45cab3de-5e15-42be-abe9-dd496a4f824b" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220813Z:45cab3de-5e15-42be-abe9-dd496a4f824b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-475/providers/Microsoft.Sql/servers/sqlcrudtest-9502?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTQ3NS9wcm92aWRlcnMvTWljcm9zb2Z0LlNxbC9zZXJ2ZXJzL3NxbGNydWR0ZXN0LTk1MDI/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"administratorLoginPassword\": \"Un53cuRE!\",\r\n \"version\": \"12.0\"\r\n },\r\n \"tags\": {},\r\n \"location\": \"westeurope\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "184" + ], + "x-ms-client-request-id": [ + "21ba7553-55c5-4c3b-bff1-508ae3392434" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"operation\": \"UpsertLogicalServer\",\r\n \"startTime\": \"2018-06-15T22:08:21.697Z\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "74" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:08:21 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-475/providers/Microsoft.Sql/locations/westeurope/serverOperationResults/1d624852-80af-4cda-8dbf-193733d3a748?api-version=2015-05-01-preview" + ], + "Retry-After": [ + "1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-475/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/1d624852-80af-4cda-8dbf-193733d3a748?api-version=2015-05-01-preview" + ], + "x-ms-request-id": [ + "1d624852-80af-4cda-8dbf-193733d3a748" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "a4827ac1-7483-4ffe-80ab-377748882092" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220821Z:a4827ac1-7483-4ffe-80ab-377748882092" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-475/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/1d624852-80af-4cda-8dbf-193733d3a748?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTQ3NS9wcm92aWRlcnMvTWljcm9zb2Z0LlNxbC9sb2NhdGlvbnMvd2VzdGV1cm9wZS9zZXJ2ZXJBenVyZUFzeW5jT3BlcmF0aW9uLzFkNjI0ODUyLTgwYWYtNGNkYS04ZGJmLTE5MzczM2QzYTc0OD9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"1d624852-80af-4cda-8dbf-193733d3a748\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-06-15T22:08:21.697Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:08:31 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "598f3819-a2fe-4491-88c5-46e8e41950c2" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14998" + ], + "x-ms-correlation-request-id": [ + "3c2d0196-ec0d-4ee1-bbc5-cadff5efc56b" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220832Z:3c2d0196-ec0d-4ee1-bbc5-cadff5efc56b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-475/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/1d624852-80af-4cda-8dbf-193733d3a748?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTQ3NS9wcm92aWRlcnMvTWljcm9zb2Z0LlNxbC9sb2NhdGlvbnMvd2VzdGV1cm9wZS9zZXJ2ZXJBenVyZUFzeW5jT3BlcmF0aW9uLzFkNjI0ODUyLTgwYWYtNGNkYS04ZGJmLTE5MzczM2QzYTc0OD9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"1d624852-80af-4cda-8dbf-193733d3a748\",\r\n \"status\": \"InProgress\",\r\n \"startTime\": \"2018-06-15T22:08:21.697Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:08:51 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "20" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "8f46674b-ad89-45e9-8591-4ba6e442c098" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14997" + ], + "x-ms-correlation-request-id": [ + "988ccb49-34d3-44ca-ac61-c09bf821a1fe" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220852Z:988ccb49-34d3-44ca-ac61-c09bf821a1fe" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-475/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/1d624852-80af-4cda-8dbf-193733d3a748?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTQ3NS9wcm92aWRlcnMvTWljcm9zb2Z0LlNxbC9sb2NhdGlvbnMvd2VzdGV1cm9wZS9zZXJ2ZXJBenVyZUFzeW5jT3BlcmF0aW9uLzFkNjI0ODUyLTgwYWYtNGNkYS04ZGJmLTE5MzczM2QzYTc0OD9hcGktdmVyc2lvbj0yMDE1LTA1LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"1d624852-80af-4cda-8dbf-193733d3a748\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2018-06-15T22:08:21.697Z\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:09:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "1e172ce7-858f-42f0-b5e2-e285f71095ad" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14996" + ], + "x-ms-correlation-request-id": [ + "04808a31-1806-4118-a26e-5e3205923607" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220912Z:04808a31-1806-4118-a26e-5e3205923607" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-475/providers/Microsoft.Sql/servers/sqlcrudtest-9502?api-version=2015-05-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTQ3NS9wcm92aWRlcnMvTWljcm9zb2Z0LlNxbC9zZXJ2ZXJzL3NxbGNydWR0ZXN0LTk1MDI/YXBpLXZlcnNpb249MjAxNS0wNS0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"v12.0\",\r\n \"properties\": {\r\n \"administratorLogin\": \"dummylogin\",\r\n \"version\": \"12.0\",\r\n \"state\": \"Ready\",\r\n \"fullyQualifiedDomainName\": \"sqlcrudtest-9502.database.windows.net\"\r\n },\r\n \"location\": \"westeurope\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-475/providers/Microsoft.Sql/servers/sqlcrudtest-9502\",\r\n \"name\": \"sqlcrudtest-9502\",\r\n \"type\": \"Microsoft.Sql/servers\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:09:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "59f2af44-87d2-45bc-a9c9-1e0e217368bd" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-correlation-request-id": [ + "1d4b9526-eebd-4ff8-bc12-dc06ae699dfa" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220912Z:1d4b9526-eebd-4ff8-bc12-dc06ae699dfa" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/sqlcrudtest-475/providers/Microsoft.Sql/servers/sqlcrudtest-9502/tdeCertificates?api-version=2017-10-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlR3JvdXBzL3NxbGNydWR0ZXN0LTQ3NS9wcm92aWRlcnMvTWljcm9zb2Z0LlNxbC9zZXJ2ZXJzL3NxbGNydWR0ZXN0LTk1MDIvdGRlQ2VydGlmaWNhdGVzP2FwaS12ZXJzaW9uPTIwMTctMTAtMDEtcHJldmlldw==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"properties\": {\r\n \"privateBlob\": \"MIIJ+QIBAzCCCbUGCSqGSIb3DQEHAaCCCaYEggmiMIIJnjCCBhcGCSqGSIb3DQEHAaCCBggEggYEMIIGADCCBfwGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAgUeBd7F2KZUwICB9AEggTYSRi88/Xf0EZ9smyY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asdsadsad\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "3497" + ], + "x-ms-client-request-id": [ + "14837767-055d-4aab-900d-73fb5742a710" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.Sql.SqlManagementClient/1.16.0.0" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"InvalidPrivateBlobOrPassword\",\r\n \"message\": \"Invalid private blob or password specified: The specified network password is not correct.\\r\\n\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "156" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:09:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "2e20ba25-9913-408d-b806-846c5e3fdd12" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "a110b5ee-c4cd-4c23-adf1-cfac1d74d21f" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220913Z:a110b5ee-c4cd-4c23-adf1-cfac1d74d21f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 400 + }, + { + "RequestUri": "/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourcegroups/sqlcrudtest-475?api-version=2017-05-10", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYThjOWE5MjQtMDZjMC00YmRlLTk3ODgtZTdiMTM3MDk2OWUxL3Jlc291cmNlZ3JvdXBzL3NxbGNydWR0ZXN0LTQ3NT9hcGktdmVyc2lvbj0yMDE3LTA1LTEw", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "cbcf77e9-ea02-46a8-ad1f-12c95dac7683" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.26201.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 15 Jun 2018 22:09:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1TUUxDUlVEVEVTVDoyRDQ3NS1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2017-05-10" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-request-id": [ + "b065e5b7-6462-4f22-a143-70c4012bc7e1" + ], + "x-ms-correlation-request-id": [ + "b065e5b7-6462-4f22-a143-70c4012bc7e1" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180615T220916Z:b065e5b7-6462-4f22-a143-70c4012bc7e1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + } + ], + "Names": { + "CreateResourceGroup": [ + "sqlcrudtest-475" + ], + "CreateServer": [ + "sqlcrudtest-9502" + ] + }, + "Variables": { + "DefaultLocation": "westeurope", + "SubscriptionId": "a8c9a924-06c0-4bde-9788-e7b1370969e1" + } +} \ No newline at end of file diff --git a/src/SDKs/SqlManagement/Sql.Tests/UploadTdeCertificateScenarioTests.cs b/src/SDKs/SqlManagement/Sql.Tests/UploadTdeCertificateScenarioTests.cs new file mode 100644 index 000000000000..42ee37d0d5a0 --- /dev/null +++ b/src/SDKs/SqlManagement/Sql.Tests/UploadTdeCertificateScenarioTests.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using Microsoft.Azure.Management.ResourceManager; +using Microsoft.Azure.Management.ResourceManager.Models; +using Microsoft.Azure.Management.Sql; +using Microsoft.Azure.Management.Sql.Models; +using System.Collections.Generic; +using System.Security.Cryptography.X509Certificates; +using System.Threading.Tasks; +using Microsoft.Rest.Azure; +using Xunit; + +namespace Sql.Tests +{ + public class UploadTdeCertificateScenarioTests + { + private static readonly TdeCertificate TdeCertificate = new TdeCertificate() + { + PrivateBlob = RandomValidPrivateBlob, + CertPassword = String.Empty + }; + + private static readonly TdeCertificate TdeCertificateWithInvalidBlob = new TdeCertificate() + { + PrivateBlob = InvalidPrivateBlob, + CertPassword = String.Empty + }; + + private static readonly TdeCertificate TdeCertificateWithInvalidPassword = new TdeCertificate() + { + PrivateBlob = RandomValidPrivateBlob, + CertPassword = InvalidPassword + }; + + private const string RandomValidPrivateBlob = @"MIIJ+QIBAzCCCbUGCSqGSIb3DQEHAaCCCaYEggmiMIIJnjCCBhcGCSqGSIb3DQEHAaCCBggEggYEMIIGADCCBfwGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAgUeBd7F2KZUwICB9AEggTYSRi88/Xf0EZ9smyYDCr+jHa7a/510s19/5wjqGbLTT/CYBu2qSOhj+g9sNvjj5oWAcluaZ4XCl/oJhXlB+9q9ZYSC6pPhma7/Il+/zlZm8ZUMfgnUefpKXGj+Ilydghya2DOA0PONDGbqIJGBYC0JgtiL7WcYyA+LEiO0vXc2fZ+ccjQsHM+ePFOm6rTJ1oqE3quRC5Ls2Bv22PCmF+GWkWxqH1L5x8wR2tYfecEsx4sKMj318novQqBlJckOUPDrTT2ic6izFnDWS+zbGezSCeRkt2vjCUVDg7Aqm2bkmLVn+arA3tDZ/DBxgTwwt8prpAznDYG07WRxXMUk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C4ZauHdMZch38N7BPH2usrAQfr3omYcScFzSeN2onhE1JBURCPDQa8+CGiWMm6mxboUOIcUGasaDqYQ8pSAgZZqQf8lU0uH4FP/z/5Dd7PniDHjvqlwYa+vB6flgtrwh6jYFeTKluhkucLrfzusFR52kHpg8K4GaUL8MhvlsNdd8iHSFjfyOdXRpY9re+B8X9Eorx0Z3xsSsVWaCwmI+Spq+BZ5CSXVm9Um6ogeM0et8JciZS2yFLIlbl2o4U1BWblskYfj/29jm4/2UKjKzORZnpjE0O+qP4hReSrx6os9dr8sNkq/7OafZock8zXjXaOpW6bqB1V5NWMPiWiPxPxfRi1F/MQp6CPY03H7MsDALEFcF7MmtY4YpN/+FFfrrOwS19Fg0OnQzNIgFpSRywX9dxyKICt/wbvhM+RLpUN50ZekFVska+C27hJRJEZ9rSdVhOVdL1UNknuwqF1cCQQriaNsnCbeVHN3/Wgsms9+Kt+glBNyZQlU8Fk+fafcQFI5MlxyMmARVwnC70F8AScnJPPFVZIdgIrvOXCDrEh8wFgkVM/MHkaTZUF51yy3pbIZaPmNd5dsUfEvMsW2IY6esnUUxPRQUUoi5Ib8EFHdiQJrYY3ELfZRXb2I1Xd0DVhlGzogn3CXZtXR2gSAakdB0qrLpXMSJNS65SS2tVTD7SI8OpUGNRjthQIAEEROPue10geFUwarWi/3jGMG529SzwDUJ4g0ix6VtcuLIDYFNdClDTyEyeV1f70NSG2QVXPIpeF7WQ8jWK7kenGaqqna4C4FYQpQk9vJP171nUXLR2mUR11bo1N4hcVhXnJls5yo9u14BB9CqVKXeDl7M5zwMDswHzAHBgUrDgMCGgQUT6Tjuka1G4O/ZCBxO7NBR34YUYQEFLaheEdRIIuxUd25/hl5vf2SFuZuAgIH0A=="; + private const string ManagedInstanceResourceGroup = "MlAndzic_RG"; + private const string ManagedInstanceName = "midemoinstance"; + private const string InvalidPassword = "asdsadsad"; + private const string InvalidPrivateBlobOrPasswordMessage = "Invalid private blob or password"; + + [Fact] + public void TestCreateTdeCertificate() + { + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + ResourceGroup resourceGroup = context.CreateResourceGroup(); + Server server = context.CreateServer(resourceGroup); + SqlManagementClient sqlClient = context.GetClient(); + + sqlClient.TdeCertificates.Create(resourceGroup.Name, server.Name, TdeCertificate); + } + } + + [Fact] + public void TestCreateTdeCertificate_InvalidBlob() + { + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + ResourceGroup resourceGroup = context.CreateResourceGroup(); + Server server = context.CreateServer(resourceGroup); + SqlManagementClient sqlClient = context.GetClient(); + + var exception = Assert.Throws(() => sqlClient.TdeCertificates.Create(resourceGroup.Name, server.Name, TdeCertificateWithInvalidBlob)); + + Assert.Contains(InvalidPrivateBlobOrPasswordMessage, exception.Message); + } + } + + + [Fact] + public void TestCreateTdeCertificate_InvalidPassword() + { + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + ResourceGroup resourceGroup = context.CreateResourceGroup(); + Server server = context.CreateServer(resourceGroup); + SqlManagementClient sqlClient = context.GetClient(); + + var exception = Assert.Throws(() => sqlClient.TdeCertificates.Create(resourceGroup.Name, server.Name, TdeCertificateWithInvalidPassword)); + + Assert.Contains(InvalidPrivateBlobOrPasswordMessage, exception.Message); + } + } + + [Fact] + public void TestCreateManagedInstanceTdeCertificate() + { + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + SqlManagementClient sqlClient = context.GetClient(); + + // Update with values from a current MI on the region + // + string resourceGroup = ManagedInstanceResourceGroup; + string managedInstanceName = ManagedInstanceName; + + sqlClient.ManagedInstanceTdeCertificates.Create(resourceGroup, managedInstanceName, TdeCertificate); + } + } + + + [Fact] + public void TestCreateManagedInstanceTdeCertificate_InvalidBlob() + { + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + SqlManagementClient sqlClient = context.GetClient(); + + // Update with values from a current MI on the region + // + string resourceGroup = ManagedInstanceResourceGroup; + string managedInstanceName = ManagedInstanceName; + + + var exception = Assert.Throws(() => sqlClient.ManagedInstanceTdeCertificates.Create(resourceGroup, managedInstanceName, TdeCertificateWithInvalidBlob)); + + Assert.Contains(InvalidPrivateBlobOrPasswordMessage, exception.Message); + } + } + + [Fact] + public void TestCreateManagedInstanceTdeCertificate_InvalidPassword() + { + using (SqlManagementTestContext context = new SqlManagementTestContext(this)) + { + SqlManagementClient sqlClient = context.GetClient(); + + // Update with values from a current MI on the region + // + string resourceGroup = ManagedInstanceResourceGroup; + string managedInstanceName = ManagedInstanceName; + + + var exception = Assert.Throws(() => sqlClient.ManagedInstanceTdeCertificates.Create(resourceGroup, managedInstanceName, TdeCertificateWithInvalidPassword)); + + Assert.Contains(InvalidPrivateBlobOrPasswordMessage, exception.Message); + } + } + + } +} diff --git a/src/SDKs/_metadata/sql_resource-manager.txt b/src/SDKs/_metadata/sql_resource-manager.txt index ec52f7a71809..9e806462fd93 100644 --- a/src/SDKs/_metadata/sql_resource-manager.txt +++ b/src/SDKs/_metadata/sql_resource-manager.txt @@ -1,35 +1,11 @@ -Installing AutoRest version: latest +2018-06-15 21:51:52 UTC -> autorest@2.0.4280 preinstall C:\Users\yaiyun\AppData\Roaming\npm\node_modules\autorest -> node ./preinstall-check - -C:\Users\yaiyun\AppData\Roaming\npm\autorest -> C:\Users\yaiyun\AppData\Roaming\npm\node_modules\autorest\dist\app.js -+ autorest@2.0.4280 -updated 1 package in 2.315s - -AutoRest installed successfully. -Commencing code generation -Generating CSharp code -Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\code\azure-sdk-for-net\src\SDKs -AutoRest code generation utility [version: 2.0.4280; node: v8.11.1] -(C) 2018 Microsoft Corporation. -https://aka.ms/autorest - Loading AutoRest core 'C:\Users\yaiyun\.autorest\@microsoft.azure_autorest-core@2.0.4280\node_modules\@microsoft.azure\autorest-core\dist' (2.0.4280) - Loading AutoRest extension '@microsoft.azure/autorest.csharp' (~2.2.51->2.2.57) - Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.43->2.3.43) - -2018-06-14 07:14:29 UTC 1) azure-rest-api-specs repository information -GitHub fork: Azure -Branch: master -Commit: 69592a62dd01225f16a9b398664c3b9d6ddc8268 +GitHub user: nivimsft +Branch: uploadCustomerTdeCertificate +Commit: d1953e5c7f65c8ef39b58316601308977649a561 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Users\yaiyun\AppData\Roaming\npm `-- autorest@2.0.4280 - - -Latest installed version: - - +Bootstrapper version: C:\Users\nivithla\AppData\Roaming\npm `-- autorest@2.0.4280 +Latest installed version: