Azure RBAC propagation latency

Xavier Bermudez 26 Reputation points
2021-08-23T18:50:23.99+00:00

Hi, Community. I'm working with azure CLI creating new service principals and later adding them the role over a specified subscription, I have this in a automation script, so when the script executes the azure cli command, right after, I execute a terraform provisioning using the credentials of that service principal. but Sometimes it seams that the role is no granted, then I wait a copple of minutes more re-deploy the terraform script and it works.

My question is, is there a way to minimize this behavior? a command or do I need to add delay?

Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
666 questions
{count} vote

Accepted answer
  1. Marilee Turscak-MSFT 33,801 Reputation points Microsoft Employee
    2021-08-25T21:05:08.477+00:00

    Hi @Xavier Bermudez ,

    The behavior you are describing is discussed in the documentation. Since Azure Resource Manager sometimes caches configurations and data to improve performance, it can sometimes take up to 30 minutes for changes to take effect when you assign roles or remove role assignments.

    Using Azure CLI, you can force a refresh of your role assignment changes by signing out and signing in.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful