https://pulumi.com logo
Title
b

brash-musician-70232

05/03/2023, 4:22 AM
Hi All, I am trying to fetch the role definition name using below code (it has valid subscription_id in real code)
subscription_id = 00000000-0000-0000-0000-000000000000
role_definition_id = "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c"
role_assignment_name = azure.authorization.get_role_definition(
                    scope=f"/subscriptions/{subscription_id}",
                    role_definition_id=role_definition_id,
                ).name
However I get error message like : In the error message it is seen that few things are getting repeated, not sure why.
RBAC name Error: invoke of azure-native:authorization:getRoleDefinition failed: invocation of azure-native:authorization:getRoleDefinition returned an error: request failed /%2Fsubscriptions%2F00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/%2Fsubscriptions%2F00000000-0000-0000-0000-000000000000%2Fproviders%2FMicrosoft.Authorization%2FroleDefinitions%2Fb24988ac-6180-42a0-ab88-20f7382dd24c: autorest/azure: Service returned an error. Status=404 <nil>
i

icy-doctor-13719

05/03/2023, 1:59 PM
should role_definition_id be the fully qualified one or just the last GUID?
the error message looks to me like you’re duplicating the path though, so maybe try just the GUID
b

brash-musician-70232

05/04/2023, 7:30 AM
Hi Patrick, I checked by providing just the GUID as well. But somehow the path is getting duplicated. And I am not able to fetch the role name correctly. However when I used azure classic it worked. Thank you.