/// <summary> /// Creates or updates an Azure Sql Database Transparent Data Encryption Protector /// </summary> public Management.Sql.Models.EncryptionProtector CreateOrUpdateEncryptionProtector(string resourceGroupName, string serverName, Management.Sql.Models.EncryptionProtector parameters) { return(GetCurrentSqlClient().EncryptionProtectors.CreateOrUpdate(resourceGroupName, serverName, parameters)); }
/// <summary> /// Convert a Management.Sql.LegacySdk.Models.TransparentDataEncryption.EncryptionProtector to AzureSqlServerTransparentDataEncryptionProtectorModel /// </summary> /// <param name="resourceGroup">The resource group the server is in</param> /// <param name="serverName">The name of the server</param> /// <param name="resp">The management client server response to convert</param> /// <returns>The converted server model</returns> private static AzureSqlServerTransparentDataEncryptionProtectorModel CreateEncryptionProtectorModelFromResponse(string resourceGroup, string serverName, Management.Sql.Models.EncryptionProtector resp) { AzureSqlServerTransparentDataEncryptionProtectorModel EncryptionProtector = new AzureSqlServerTransparentDataEncryptionProtectorModel(); EncryptionProtector.ResourceGroupName = resourceGroup; EncryptionProtector.ServerName = serverName; EncryptionProtector.ServerKeyVaultKeyName = resp.ServerKeyName; Model.EncryptionProtectorType type = Model.EncryptionProtectorType.ServiceManaged; Enum.TryParse <Model.EncryptionProtectorType>(resp.ServerKeyType, true, out type); EncryptionProtector.Type = type; EncryptionProtector.AutoRotationEnabled = resp.AutoRotationEnabled; if (type == Model.EncryptionProtectorType.AzureKeyVault) { EncryptionProtector.KeyId = resp.Uri; } return(EncryptionProtector); }