MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.3k stars 21.48k forks source link

Grant access to Azure Logic Apps service principal using RBAC #119690

Closed BigSlimeGuy closed 8 months ago

BigSlimeGuy commented 9 months ago

In the following step, it does not specify how to do something similar using RBAC, or is this not supported?

_Authorize the Azure Logic Apps service to perform operations on your key vault. To grant access to the Azure Logic Apps service principal, use the PowerShell command, Set-AzKeyVaultAccessPolicy, for example:

Set-AzKeyVaultAccessPolicy -VaultName 'TestcertKeyVault' -ServicePrincipalName '7cd684f4-8a78-49b0-91ec-6a35d38739ba' -PermissionsToKeys decrypt, sign, get, list_


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ManoharLakkoju-MSFT commented 9 months ago

@BigSlimeGuy Thanks for your feedback! We will investigate and update as appropriate.

mumurug-MSFT commented 9 months ago

@divyaswarnkar @ecfan The access policy is a legacy authorization system, and the recommended approach is to use RBAC role https://learn.microsoft.com/en-us/azure/key-vault/general/rbac-guide?tabs=azure-cli. Can you please review if we can update this doc?

ecfan commented 9 months ago

assign:wsilveiranz

mcowart123 commented 8 months ago

Any word on this? I'm trying to set this up via terraform with an RBAC-enabled key vault and running into this problem. Trying to add the permission with the hard-coded principal ID times out:

...
# magic number principal ID for Logic Apps
resource "azurerm_role_assignment" "as2-edi-logicapp-global" {
  scope                = azurerm_key_vault.as2-edi.id
  role_definition_name = "Key Vault Administrator"
  principal_id         = "7cd684f4-8a78-49b0-91ec-6a35d38739ba"
}
ecfan commented 8 months ago

@BigSlimeGuy, @mcowart123, and @mumurug-MSFT: I've pinged the product team about this, thanks!

ecfan commented 8 months ago

@BigSlimeGuy & @mumurug-MSFT: The following docs have more info about using RBAC with a key vault, so I can add these links to the doc:

@mcowart123: For the timeout issue with the key vault, please post the issue on the Key Vault customer feedback page.

ecfan commented 8 months ago

Doc updates to be published after 4 PM Pacific Time.