new day, new question: 10 points for the answer! ...
# azure
d
new day, new question: 10 points for the answer! I find myself writing resource ID's too often, in order to create a RoleAssignment. E.g. role assignment for key vault crypto officer is "14b46e9e-c2b7-41b4-b07b-48a6ebf60603" - where's the SDK that I can include/use to get these, or even better generate the combined resource string with the role ID in it? e.g surely I am not the first one to write something like:
Copy code
private string SubScope(string id) =>
    $"{SubscriptionScope}/providers/Microsoft.Authorization/roleDefinitions/{id}";
c
Never tried it but appears Pulumi has a built in function. https://www.pulumi.com/registry/packages/azure-native/api-docs/authorization/getroledefinition/ The thing I don't like about the API is defining a scope. With CLI or PowerShell I can do a generic list and get all the roles. I can then write my own filter. https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions-list#rest-api