簡體   English   中英

如何使用 Azure Key Vault Python SDK 添加訪問策略?

[英]How to use Azure Key Vault Python SDK to add access policy?

我試圖找到一種方法來動態地將新的訪問策略添加到 Azure Key Vault 資源。

我的基礎堆棧是 Pulumi(azure-native),它不提供這樣做的功能; 它只允許在創建 Key Vault 資源時添加訪問策略。

顯然,有一些 Python SDK 可用於 Azure Key Vault,但我找不到使用它們來管理訪問策略的方法。

Azure Key Vault Python SDK 是否提供了向 Key Vault 添加訪問策略的方法? 如果沒有,我在這里有什么選擇(替代解決方案)?

管理 Key Vault 訪問策略。

 import pulumi import pulumi_azure as azure current = azure.core.get_client_config() example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", location=example_resource_group.location, resource_group_name=example_resource_group.name, tenant_id=current.tenant_id, sku_name="premium") example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", key_vault_id=example_key_vault.id, tenant_id=current.tenant_id, object_id=current.object_id, key_permissions=["Get"], secret_permissions=["Get"])

您可以將經典提供程序的資源用於此特定用例。 您可以根據需要在同一程序中混合和匹配兩個提供商。 該功能在此處進行跟蹤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM