sparse-intern-71089
08/15/2022, 3:26 PMbillowy-army-68599
adamant-waiter-67103
08/15/2022, 3:30 PMbillowy-army-68599
adamant-waiter-67103
08/15/2022, 3:35 PMadamant-waiter-67103
08/15/2022, 3:35 PMbillowy-army-68599
az keyvault set policy
adamant-waiter-67103
08/15/2022, 3:40 PMAccessPolicy
, where you can supply a key vault name, an object id and some policies, and it will just run the single command...adamant-waiter-67103
08/15/2022, 3:42 PMAccessPolicy
pulumi resource to each of the projects that can update the keyvault seems like a good approachbillowy-army-68599
generating new system assigned idsWhy would updating the policy generate new system assigned ids?
billowy-army-68599
It sounds like pulumi doesn’t expose an API like AccessPolicyPulumi maps every ARM API to a resource, so it definitely does. I’m sure this is a misunderstanding. Can you share any code?
billowy-army-68599
adamant-waiter-67103
08/15/2022, 3:51 PMWhy would updating the policy generate new system assigned ids?other projects will create resources that will have their own system identities, these will be created if the resource is every re-created
adamant-waiter-67103
08/15/2022, 3:52 PMbillowy-army-68599
vault = keyvault.KeyVault(
"vault",
resource_group_name=resource_group.name,
sku_name="standard",
tenant_id=tenant_id,
access_policies=[keyvault.KeyVaultAccessPolicyArgs(
tenant_id=tenant_id,
object_id=current_principal,
secret_permissions=["delete", "get", "list", "set"]
)]
)
Then you want to add a new policy:
vault = keyvault.KeyVault(
"vault",
resource_group_name=resource_group.name,
sku_name="standard",
tenant_id=tenant_id,
access_policies=[
keyvault.KeyVaultAccessPolicyArgs(
tenant_id=tenant_id,
object_id=current_principal,
secret_permissions=["delete", "get", "list", "set"]
),
keyvault.KeyVaultAccessPolicyArgs(
tenant_id=new_tenant_id,
object_id=new_current_principal,
secret_permissions=["delete", "get", "list", "set"])
]
)
It’ll just update the policy.billowy-army-68599
billowy-army-68599
adamant-waiter-67103
08/15/2022, 4:01 PMadamant-waiter-67103
08/15/2022, 4:01 PM