Assigning ad role - global reader role to service principal

Nitin Naidu 21 Reputation points
2022-08-04T14:02:20.103+00:00

I am trying to assign ad role- global reader to service principal in terraform. I says role not found. Want to know whether I can assign ad role to service principal. I am getting this error on trying to assign global reader role to service principal-

Error: loading Role Definition List: could not find role 'Global Reader'

│ with module.infrastructure_cloud-scanner-app.azurerm_role_assignment.main["/subscriptions/aeca76e8-1861-4aed-b28a-b8c48923f89b"],
│ on ../../modules/infrastructure/cloud-scanner-app/main.tf line 49, in resource "azurerm_role_assignment" "main":
│ 49: resource "azurerm_role_assignment" "main" {

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Andy David - MVP 157.8K Reputation points
    2022-08-04T14:20:14.073+00:00

    Yes, go to the Role in Azure and add there
    228097-image.png


  2. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2022-11-09T20:39:36.117+00:00

    Hi @Nitin Naidu , please try using role_definition_id in place of role_definition_name as suggested in the GitHub link above. Please let me know if this works or not.

    Best,
    James

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.