Dynamically retrieving name of storage account in Azure Data Factory

Michael Vu 26 Reputation points
2022-01-10T16:19:07.737+00:00

I have multiple pipelines in different environments (dev, test, stage etc...). Is there a way that I can dynamically retrieve the name of the storage account (the name tells you the environment it's running in) in azure data factory so that I can make changes based on the env?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,609 questions
{count} vote

1 answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 31,061 Reputation points Microsoft Employee
    2022-01-11T12:39:42.293+00:00

    Hi @Michael Vu ,
    Thanks for posting your question in Microsoft Q&A platform.
    By the above query , do you mean fetching the storage account name dynamically from Linked service or a dataset? If Yes , then it's not possible as there is a one to many mapping between Storage account and linked service. Moreover, I hope for different environments, you are using different ADF.
    In this scenario, you can create a lookup table and store the storage account names for different environment in the table and use this expression to fetch the details of storage account based on the environment.

    select * from LookUpTable where ADFEnvironment='@{pipeline().DataFactory}'  
    

    Please check the below screenshots for reference.

    163934-image.png

    163942-image.png

    163848-image.png

    Hope this will help. Please let us know if any further queries.

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

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators