SQL Server encrypted migration to Azure SQL Database

Gavin Cheal 1 Reputation point
2022-08-16T14:15:58.213+00:00

Hi

This is a link to a question that I have asked about migrating data from SQL Server to Azure SQL Database, using the Copy function in the data factory.
I didn't want to just copy the question.
I cannot get the encrypted data stored in a table in SQL Server to migrate it to Azure SQL Database.
I have created a key in SQL Server that now sits in the Azure Key Vault. The Key value has the same 10 character as that in the error. I have created a link service I have ticked the Encrypted box.

The error now is showing a 2200 error, which is different to the initial error, but I can't figure out from the comment other than it being an error in the source.
The source is a 3rd party data source that sits is unpacked daily to SQL Server, that is sitting on a VM in Azure.
The key works OK when run from the server or within SSMS, however it does not want to work on Azure Data Factory.

Presently it runs via a SSIS package that decrypts the data, I want to swap this SSIS to a pipeline run in the Data Factory. I would have thought this would have been a simple task, but after 2-3 days of searching I have not found a solution to this problem. If there is someone who knows how this can be achieved, please.

Many thanks.

Azure SQL Database
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
{count} votes

1 answer

Sort by: Most helpful
  1. Bhargava-MSFT 31,361 Reputation points Microsoft Employee Moderator
    2022-08-18T17:15:48.403+00:00

    Hello @Gavin Cheal ,
    Thanks for the reply.

    It seems like a permission issue. Can you please perform the steps below on the Azure Key vault?

    Go to Key Vault Blade:

    •Select Access Policies from the Key Vault resource blade menu on the left
    •Click the "add access policy"
    •Select data factory Principal
    •From the Key permissions drop-down, please select all cryptographic operations permissions
    •save changes

    232506-image.png

    I was able to reproduce the issue by removing the cryptographic permissions on the key vault.

    232520-image.png


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.