Failed to enable Always Encrypted

Category: azure disk encryption

Question

João Récio on Tue, 02 Jul 2019 13:22:05


Hi.

Sorry if this is posted on the wrong place :) 

We're having some issues setting up Always Encrypted on an SQL Azure DB using Azure Key Vault.

We've managed to set everything up, including the encryption keys on the azure instance, the issue is on the final step when it

actually starts to encrypt the table, or tries to in this case.

We've followed this page for how to set it up:
https://docs.microsoft.com/en-us/azure/sql-database/sql-database-always-encrypted-azure-key-vault

We didn't run the azure key vault creation through powershell, we did it through the portal, but did add the key permissions to my user, it managed to generate the server keys just fine.

Unsure if it needs anything else to proceed.

This is the log generated by the wizard (on SSMS v18.1)

Jul 2 2019 11:18:47: Log opened. TraceLevel:Informational
Jul 2 2019 11:19:05 [Informational] WizardSummary: Message:Source database settings.

Jul 2 2019 11:19:05 [Informational] WizardSummary: Message: Source server name: godtlevertdbtest.database.windows.net.

Jul 2 2019 11:19:05 [Informational] WizardSummary: Message: Source database name: CMS.

Jul 2 2019 11:19:05 [Informational] WizardSummary: Message:Encrypt column data.

Jul 2 2019 11:19:05 [Informational] WizardSummary: Message:   Table name: encryption_test.

Jul 2 2019 11:19:05 [Informational] WizardSummary: Message:   Encryption key name: CEK_Auto1.

Jul 2 2019 11:19:05 [Informational] WizardSummary: Message:   Encryption type: Deterministic.

Jul 2 2019 11:19:06 [Informational] WorkitemExecution: Message:Work item 'Performing encryption operations' started..

Jul 2 2019 11:19:06 [Informational] TaskUpdates: Message:Task: 'Performing encryption operations' -- Status: 'Started' -- Details: 'Task 'Performing encryption operations' started ....'.

Jul 2 2019 11:19:41 [Informational] DacFxMigration: Message:DacFx state update: Pending: Initializing deployment.

Jul 2 2019 11:19:41 [Informational] DacFxMigration: Message:DacFx state update: Pending: Analyzing deployment plan.

Jul 2 2019 11:19:41 [Informational] DacFxMigration: Message:DacFx state update: Pending: Updating database.

Jul 2 2019 11:19:41 [Informational] DacFxMigration: Message:DacFx state update: Pending: Creating deployment plan.

Jul 2 2019 11:19:41 [Informational] DacFxMigration: Message:DacFx state update: Pending: Verifying deployment plan.

Jul 2 2019 11:19:41 [Informational] DacFxMigration: Message:DacFx state update: Pending: Deploying package to database.

Jul 2 2019 11:19:41 [Informational] DacFxMigration: Message:DacFx state update: Running: Creating deployment plan.

Jul 2 2019 11:19:41 [Informational] DacFxMigration: Message:DacFx state update: Running: Initializing deployment.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Faulted: Initializing deployment.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Faulted: Creating deployment plan.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Faulted: Verifying deployment plan.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Faulted: Deploying package to database.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Pending: Initializing deployment.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Pending: Analyzing deployment plan.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Pending: Updating database.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Pending: Creating deployment plan.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Pending: Verifying deployment plan.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Pending: Deploying package to database.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Running: Creating deployment plan.

Jul 2 2019 11:19:59 [Informational] DacFxMigration: Message:DacFx state update: Running: Initializing deployment.

Jul 2 2019 11:20:09 [Informational] DacFxMigration: Message:DacFx state update: Faulted: Initializing deployment.

Jul 2 2019 11:20:09 [Informational] DacFxMigration: Message:DacFx state update: Faulted: Creating deployment plan.

Jul 2 2019 11:20:09 [Informational] DacFxMigration: Message:DacFx state update: Faulted: Verifying deployment plan.

Jul 2 2019 11:20:09 [Informational] DacFxMigration: Message:DacFx state update: Faulted: Deploying package to database.

Jul 2 2019 11:20:09 [Informational] TaskUpdates: Message:Task: 'Performing encryption operations' -- Status: 'Failed' -- Details: 'Task failed due to following error: Failed to configure the specified encryption settings.'.

Jul 2 2019 11:20:09 [Informational] WorkitemExecution: Message:Work item 'Performing encryption operations' stopped..

Jul 2 2019 11:20:09 [Error] WorkitemExecution: Message:Work item 'Performing encryption operations' did not complete. Details: Failed to configure the specified encryption settings..

Jul 2 2019 11:20:09 [Error] WorkitemExecution: Message:Inner exception: Microsoft.SqlServer.Dac.DacServicesException 
 Details: An error occurred during deployment plan generation. Deployment cannot continue.
Error SQL72018: Permission could not be imported but one or more of these objects exist in your source.
.

Jul 2 2019 11:20:09 [Error] WorkitemExecution: Message:Inner exception: Microsoft.Data.Tools.Schema.Sql.Deployment.DeploymentFailedException 
 Details: Errors occurred while modeling the target database.  Deployment can not continue..

Jul 2 2019 11:20:09 [Informational] Log Closed: Message:Job processing completed.

Any help is truly appreciated :) 

Thank you,

João Récio

Replies

João Récio on Tue, 02 Jul 2019 14:54:11


One big detail I forgot to mention, this is the script used to generate the table where the encryption was being applied (on the details column in this scenario)

CREATE TABLE encryption_test(

id uniqueidentifier primary key not null,

details int not null

)

we've had details set up as an nvarchar(256) didn't make any difference

SumanthMarigowda-MSFT on Thu, 04 Jul 2019 06:42:53


@João Récio Apologies for the delay!

You may refer to the suggestions mentioned in the below article. 
https://docs.microsoft.com/en-us/azure/sql-database/sql-database-always-encrypted-azure-key-vault

“Always Encrypted is a new data encryption technology in Azure SQL Database and SQL Server”

If the issue still persists, I would recommend you post your query in the below mentioned forum: https://social.msdn.microsoft.com/forums/azure/en-us/home?forum=ssdsgetstarted

Kindly let us know if the above helps or you need further assistance on this issue.

------------------------------------------------------------------------------------------

Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.


SumanthMarigowda-MSFT on Wed, 10 Jul 2019 06:49:06


@João Récio Just checking in to see if the above answer helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

João Récio on Wed, 10 Jul 2019 14:34:06


@João Récio Apologies for the delay!

You may refer to the suggestions mentioned in the below article. 
https://docs.microsoft.com/en-us/azure/sql-database/sql-database-always-encrypted-azure-key-vault

“Always Encrypted is a new data encryption technology in Azure SQL Database and SQL Server”

If the issue still persists, I would recommend you post your query in the below mentioned forum: https://social.msdn.microsoft.com/forums/azure/en-us/home?forum=ssdsgetstarted

Kindly let us know if the above helps or you need further assistance on this issue.

------------------------------------------------------------------------------------------

Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.


Hi,

The link you referred is the same that I posted on my initial post...

I'll post on the other forum, the issue remains as of today.


SumanthMarigowda-MSFT on Wed, 10 Jul 2019 15:04:54


@João Récio This issue is mainly related to SQL database, You have posted your query on right forum. 

If you need any assistance future, please feel free to contact us anytime.