Azure Key Vault: Securely Managing Secrets in ADF Pipelines

 

🔐 Azure Key Vault: Securely Managing Secrets in ADF Pipelines

🏗️ Introduction

Azure Key Vault (AKV) is a cloud service that securely stores secrets like API keys, passwords, and database connection strings. Integrating Azure Data Factory (ADF) pipelines with Azure Key Vault ensures enhanced security by managing sensitive information centrally.

This guide provides step-by-step instructions to:

  • Create an Azure Key Vault.
  • Store secrets securely.
  • Integrate Key Vault with ADF pipelines.
  • Retrieve credentials from Key Vault within ADF.

🏛️ Step 1: Creating Azure Key Vault

  1. 🔍 Search for Azure Key Vault in the Azure portal.
  2. ➕ Click Create Key Vault.
  3. Configure the settings:
    • Subscription: Free Tier
    • Resource Group:divyalearn_az
    • Key Vault Name: mysecurevault22
    • Region: Central India
    • Pricing Tier: Standard
  4. ✅ Click Next
  5. Access configures:
    • Permission Model: Vault Access Policy
    • Access Policy: + create
    • Create An Access Policy: Configure from Template (key secret certificate rotation permission) 
  6. principal:
    • Select principal: Rock2025(azure data factory)
    • Next Next other things are optional
    • Review and create => create
    • It is like AWS IAM, but IAM roles is dead easy but azure not

🔑 Step 2: Adding Secrets to Key Vault

  1. Navigate to mysecurevault22 "go to resources" in Azure Key Vault.
  2. Click Object=> Secrets+ Generate/Import.
  3. Configure the secret:
    • Name: MSSQLConnection
    • Password: Mypassword.02
    • Content value(optional):Mypassword
    • Value: jdbc:sqlserver://divyamysqldb.database.windows.net:1433;database=mysql13febdb;user=divya;password=YourSecurePassword;
  4. ✅ Click Create.

🔹 Note: Avoid hardcoding sensitive information. Always store connection strings and passwords in Key Vault.


🔗 Step 3: Assigning Permissions to ADF

  1. Navigate to mysecurevaultAccess Policies.
  2. Click + Add Access Policy.
  3. Set permissions:
    • Secret Permissions: Get, List
  4. Assign Azure Data Factory (ADF) as the Principal.
  5. ✅ Click Save.

⚙️ Step 4: Integrating Key Vault with Azure Data Factory

🔄 Linking Key Vault to ADF

  1. Open Azure Data FactoryManage.
  2. Click Linked Services+ New Linked Service.
  3. Select Azure Key Vault.
  4. Configure settings:
    • Name: LS_Acess_KV
    • Azure Subscription: Free Tier
    • Key Vault Name: mysecurevault22
    • Authentication Type: System-assigned managed identity
    • Test Connection
    • ✅ Click Create.

🔍 Retrieving Secrets in ADF

  1. Navigate to Linked Services → LS_acess_kv.
  2. Modify Authentication to Azure Key Vault.
  3. In Connection String, select Use Key Vault.
  4. Choose Secret Name: MSSQLConnection.
  5. ✅ Click Test ConnectionPublish.

🏗️ Step 5: Using Key Vault in ADF Pipeline

  1. Navigate to ADF → Author → Pipelines → + New.
  2. Drag & drop Copy Activity.
  3. Configure Source:
    • Dataset: ds_asldata
  4. Configure Sink:
    • Dataset: (Create New) → SQL Server
    • Linked Service: LS_SqlServer1 (Key Vault Secured)
    • Table Name: asltab
  5. ✅ Save and Publish the pipeline.
  6. Click Trigger Now to execute.

🎯 Conclusion

By integrating Azure Key Vault with Azure Data Factory, we have securely managed credentials and ensured data security. This approach eliminates the need to store sensitive information within the pipeline, enhancing security and compliance.

🚀 Stay Connected for more Azure AWS blog "Happy Valentine Day to All"😊

Comments

Popular posts from this blog

AWS Athena, AWS Lambda, AWS Glue, and Amazon S3 – Detailed Explanation

Kafka Integrated with Spark Structured Streaming

Azure Data Factory: Copying Data from ADLS to MSSQL