A new developer joins and needs to deploy to the dev resource group only. How do you give access?
BeginnerScenarioIdentity, Access and Governance
Answer
Situation read → Access should come from group membership, at the smallest useful scope, and never touch prod.
What I'd do →
- Add the developer to the existing Entra group
grp-shop-dev-contributors(create it once if missing) - Make sure that group holds Contributor on the dev RG only:
az role assignment create --assignee-object-id <groupObjectId> --assignee-principal-type Group \ --role Contributor --scope /subscriptions/<sub>/resourceGroups/rg-shop-dev - Developer runs
az logout && az login, thenaz group show -n rg-shop-devto confirm - For prod, they get nothing by default; read access comes later through a separate reader group
Why → Group-based access survives team changes, keeps the subscription under the role assignment limit, and makes access reviews readable.
Interview tip → Say "groups, not users, at the lowest scope" before naming any role.
More on Identity, Access and Governance
Your GitHub Actions workflow uses a client secret stored in a repo secret. Security wants it gone. What do you do?BeginnerAuditors ask "who has Owner on production, and why?" How do you answer and fix it?IntermediateA VM application needs to read blobs from one container. How do you set up access without keys?IntermediateTeams keep creating resources in random regions and without tags. How do you stop it?BeginnerA contractor needs temporary read access to logs for two weeks. How do you handle it?BeginnerYou need to let an app team create their own role assignments for their identities, without giving them Owner.Advanced