https://pulumi.com logo
#azure
Title
# azure
m

millions-journalist-34868

09/13/2021, 10:55 PM
Maybe it's me, but I find it difficult to find lot of examples of using Pulumi with Azure (especially in C#). Some sample from the classic provider have not been upgraded to Native provider so I have trouble to understand how do to do some basic things. For instance assigning a Storage Blob Data Reader role to an Azure Function (through its managed identity) seems complicated. It seems to me that RoleAssignment is what I am looking for but I am not sure how to use it, especially because I think I have to use the guid from this role. Anyone has already done that ?
t

tall-librarian-49374

09/14/2021, 7:43 AM
I think you are on the right path. Indeed, the ARM API is a bit low-level here, and so is the native provider. Maybe this example would help? https://github.com/pulumi/examples/blob/master/azure-ts-call-azure-sdk/index.ts
m

millions-journalist-34868

09/14/2021, 8:01 PM
Thanks @tall-librarian-49374, interesting way to do that. To have something more simple I hardcoded the id from this page in the documentation which gives all the ids to use. What would be great is to have an enum with all these values directly in Pulumi (I guess these ids never change) , what do you think ?
t

tall-librarian-49374

09/14/2021, 8:29 PM
This is a good suggestion. Maybe we could treat it in line with https://github.com/pulumi/pulumi-azure-native/issues/797
Mind adding a comment there, or opening a new issue if you feel it’s better?
m

millions-journalist-34868

09/14/2021, 8:44 PM
I blogged about it by the way. I would love to have a retweet if you don't mind : https://twitter.com/TechWatching/status/1438244847148752900
3 Views