无法在Azure Databricks上创建Azure-Keyvault支持的秘密范围

发布于 2025-01-24 07:23:41 字数 1177 浏览 0 评论 0原文

我无法从Databricks CLI上创建秘密范围。我运行了这样的命令:

databricks secrets "create-scope" --scope "edap-dev-kv" --scope-backend-type AZURE_KEYVAULT --resource-id "/subscriptions/ba426b6f-65cb-xxxx-xxxx-9a1e1656xxxx/resourceGroups/edap-dev-rg/providers/Microsoft.KeyVault/vaults/edap-dev-kv" --profile profile_edap_dev2_dbx --dns-name "https://edap-dev-kv.vault.azure.net/"

我会收到错误msg:

Error: b'<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>\n<title>
Error 400 io.jsonwebtoken.IncorrectClaimException: 
Expected aud claim to be: 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d, but was: https://management.core.windows.net/.
</title>\n</head>\n<body><h2>HTTP ERROR 400</h2>\n<p>
Problem accessing /api/2.0/secrets/scopes/create. 
Reason:\n<pre>    io.jsonwebtoken.IncorrectClaimException: 
Expected aud claim to be: 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d, 
but was: https://management.core.windows.net/.</pre></p>\n</body>\n</html>\n'

我尝试与用户(个人)和服务主体的AAD代币进行此操作。 (我在某个地方发现它应该是用户帐户的aad代价。)
我可以使用相同的参数使用GUI进行操作。

I am not able to create secret scope on Azure Databricks from Databricks CLI. I run a command like this:

databricks secrets "create-scope" --scope "edap-dev-kv" --scope-backend-type AZURE_KEYVAULT --resource-id "/subscriptions/ba426b6f-65cb-xxxx-xxxx-9a1e1656xxxx/resourceGroups/edap-dev-rg/providers/Microsoft.KeyVault/vaults/edap-dev-kv" --profile profile_edap_dev2_dbx --dns-name "https://edap-dev-kv.vault.azure.net/"

I get error msg:

Error: b'<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>\n<title>
Error 400 io.jsonwebtoken.IncorrectClaimException: 
Expected aud claim to be: 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d, but was: https://management.core.windows.net/.
</title>\n</head>\n<body><h2>HTTP ERROR 400</h2>\n<p>
Problem accessing /api/2.0/secrets/scopes/create. 
Reason:\n<pre>    io.jsonwebtoken.IncorrectClaimException: 
Expected aud claim to be: 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d, 
but was: https://management.core.windows.net/.</pre></p>\n</body>\n</html>\n'

I have tried doing it with both user (personal) and service principal's AAD token. (I've found somewhere that it it should be a AAD token of user account.)
I am able to do it with GUI using same parameters.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十二 2025-01-31 07:23:41

在您的情况下,发行了个人访问令牌以进行不正确的服务 - 它是为https://management.core.windows.net/。 - 2FF814A6-3304-4AB8-85CB-CD0E6F879C1D

最简单的方法是将AZ-CLI与以下命令:

az account get-access-token -o tsv --query accessToken \
  --resource 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d

In your case, the personal access token was issued for incorrect service - it was issued for https://management.core.windows.net/. but it's required that you use resource ID of the Azure Databricks - 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d.

Simplest way to do that is to use az-cli with following command:

az account get-access-token -o tsv --query accessToken \
  --resource 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文