Python script in Azure Databricks

Vijay Kumar 2,031 Reputation points
2021-02-05T06:59:37.177+00:00

We are using below python script in Azure Databricks to call below secrets from azure key vault.

userSNF = dbutils.secrets.get(scope="SNF-DOPS-USER-DB-abc", key="SnowUsername") -->This is for username
passwordSNF = dbutils.secrets.get(scope="SNF-DOPS-USER-DB-abc", key="SnowPrivateKey") --> This is for Private

These two scripts are working fine.

But as per my company rules we have to protect private key my passcode. it means that can't directly see the private if we don't know the pass code.

It means that whenerve we call secret key ("SnowPsswdKey") i till asks for passcode.

i have created one more secret key called SnowPaascode. (The Private key is protected by passcode instead of plain)

passwordSNF = dbutils.secrets.get(scope="SNF-DOPS-USER-DB-abc", key="Passcode") --> This is for Private

My question is whenever i call
passwordSNF = dbutils.secrets.get(scope="SNF-DOPS-USER-DB-abc", key="SnowPrivateKey")

it shoud ask for passcode.

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,080 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 85,746 Reputation points Microsoft Employee
    2021-02-05T08:58:32.627+00:00

    Hello @Vijay Kumar ,

    Unfortunately, dbutils.secrets.get doesn't ask for the passcode as per your requirement.

    Secrets allow you to store and access sensitive credential information without making them visible in notebooks.

    64521-image.png

    Reference: Databricks Utilities - Secrets utilities.

    Hope this helps. Do let us know if you any further queries.

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

    • Please accept an answer if correct. 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.