Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
coolie
Helper I
Helper I

Accessing Azure KeyVault secret for Fabric CopyData Action

This post Microsoft Fabric connect to Azure Key Vault  descibes how to get a secret from Azure KeyVault and this works great. But is it possible to set a variable for CopyData (REST) action without using Notebook?

1 ACCEPTED SOLUTION
NandanHegde
Super User
Super User

You can use Web activity to get details from Azure Key vault

 

Settings :

NandanHegde_0-1708426784023.png

 

Connection details :

NandanHegde_1-1708426898903.png

 

where Base URL : https://<<KVName>>.vault.azure.net/secrets/<<SecretName>>?api-version=7.0

Token audience URI : https://vault.azure.net

Azuthorization : YOu can use any one like org or SP etc




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

View solution in original post

16 REPLIES 16
NandanHegde
Super User
Super User

You can use Web activity to get details from Azure Key vault

 

Settings :

NandanHegde_0-1708426784023.png

 

Connection details :

NandanHegde_1-1708426898903.png

 

where Base URL : https://<<KVName>>.vault.azure.net/secrets/<<SecretName>>?api-version=7.0

Token audience URI : https://vault.azure.net

Azuthorization : YOu can use any one like org or SP etc




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Hello @NandanHegde I cam across this accepted solution while trying to do this exact same thing: Get a Fabric Pipeline Web activity to retrieve a secret from an Azure Key Vault. But I'm getting errors. I suspect it might be due to the fact that I don't know where to plug in the settings for

Token audience URI : https://vault.azure.net

Can you help? 

I see that in classic Azure Data Factory Web task there is a space for "Resource" and the value of "https://vault.azure.net" goes there, but I don't see either Resource or Token Audience URI in Fabric Web Task. What am I missing?

Thanks in advance.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





It is in the connection settings that you have that option




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

I found it. And to clarify for potential future readers, as of this writing, that property is ONLY available in the NEW CONNECTION dialog box:

ToddChitt_0-1749560191245.png

It is NOT available in the Edit Connection dialog box:

ToddChitt_1-1749560221158.png

Commentary: Horrible user interface to use two different diagol boxes to set properties for a connection.

I have submitted an Idea to have this fixed here: Expose the Token Audience URI property for when ED... - Microsoft Fabric Community

If you are getting this far reading this thread, please go vote on the it.

Thanks.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Addendum:

After recreating my connection to include the Token Audience Uri property, Fabric simply takes that information and adds it as a Header:

ToddChitt_2-1749560667702.png

 




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Problem I see here is  you still need to keep a secret in your pipeline. Is there a way to access the keyvault using Managed Identity?

I'm attempting the same thing, but I'm getting the error below; I'm using Organization authentication.

I'm wondering if it's possible to construct a pipeline activity similar to the one we use in Synapse in Fabric by testing it while I'm on trial capacity.

 

Error

Operation on target Web1 failed: {"error":{"code":"BadParameter","message":"The specified version (7.0/https://<<xyz>>.vault.azure.net/secrets/test-key-vault-secret?api-version=7.0) is not recognized. Consider using the latest supported version (7.5)."}}

Thanks that looks promising. Where do I get TenantID, client ID and principal Key from?

You would need to create a Service principal.

https://learn.microsoft.com/en-us/entra/identity-platform/howto-create-service-principal-portal

 

but you can also use your org account and org authentication




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Great that worked with org thanks. However the source of the CopyData does not seem to be picking up the secret using: activity('AKV').output

Hey,

The Service principal key is the client secret and plz follow the below steps:

https://learn.microsoft.com/en-us/entra/identity-platform/howto-create-service-principal-portal#opti...

 

And you need to grant the App/service princiapl access on the key vault to read the secrets.

 

 

 




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Thanks that helps. I used org settings in the end and edited my reply, so think we overlapped. I'm trying to get the result into the CopyData action now.

Glad it helped!!!! 

Thanks for using Fabric Community.

Do send Kudo and Accept as solution for others to benefit on the solution 




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com
coolie
Helper I
Helper I

Hi thanks for the reply. The action I am using is CopyData from web (REST) which requires a bearer token. I do not want this in plain text so have it stored in Azure KeyVault. I would like to set the source header authorization with the secret from Azure KeyVault. I am assuming this would be done via a previously set variable (as dynamic content).

Anonymous
Not applicable

Hi @coolie ,

As I understand you are trying to copy data from rest api to lakehouse with the help of fabric pipelines.
Current challenge in your case is inorder to invoke rest api you required token ( i.e. Bearer token).

You can refer this forum conversation to get some idea -
Ingest data form a rest API with Oauth2 - Microsoft Fabric Community

Hope this helps.

Anonymous
Not applicable

Hi @coolie ,

Thanks for using Fabric Community.
I would like to understand what do you mean by "variable for CopyData (REST)" ?
Can you please help me in sharing these details, so I can guide you better.

If you are checking for Azure Key Vault feature in Data Factory Activities, then it will available soon.

vgchennamsft_0-1708418740848.png

 


You can refer this: What's new and planned for Data Factory in Microsoft Fabric - Microsoft Fabric | Microsoft Learn

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.