【问题标题】:List databricks secret scope and find referred keyvault in azure databricks列出 databricks 秘密范围并在 azure databricks 中找到引用的密钥库
【发布时间】:2022-08-11 16:32:39
【问题描述】:

我们如何在 databricks 工作区中找到现有的秘密范围。 Azure Databricks 中的特定 SecretScope 引用了哪个密钥库?

    标签: databricks azure-databricks azure-keyvault


    【解决方案1】:

    您可以使用以下任一方法执行此操作:

    【讨论】:

      【解决方案2】:

      你可以在这里用 Python 试试这个 sn-p:

      import pandas
      import json
      import requests
      
      # COMMAND ----------
      
      # MAGIC %md ### define variables
      
      # COMMAND ----------
      
      pat           = 'EnterPATHere'           # paste PAT. Get it from settings > user settings
      workspaceURL  = 'EnterWorkspaceURLHere'  # paste the workspace url in the format of 'https://adb-1234567.89.azuredatabricks.net' Note, the URL must not end with '/'
      
      # COMMAND ----------
      
      # MAGIC %md ### list secret scopes
      
      # COMMAND ----------
      
      response = requests.get(workspaceURL + '/api/2.0/secrets/scopes/list',\
                  headers = {'Authorization' :      'Bearer '+ pat,\
                  'Content-Type': 'application/json'})
      
      pandas.json_normalize(json.loads(response.content), record_path = 'scopes')
      

      我碰巧写了一个 blog post 关于这个,其中提供了一个完整的 Python 脚本来管理 Azure Databricks 中的秘密范围。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-11-24
        • 2019-10-25
        • 2022-11-19
        • 2021-09-27
        • 2022-01-18
        • 2021-12-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多