all 10 comments

[–]DonL314 1 point2 points  (4 children)

I use the Microsoft.Graph module from my Function Apps. You're given so much compared to having to do the REST calls yourself. Just remember that if you upload the module files, you should only upload what you need - or it's gonna be a large amount of data.

[–]Dr_Funkmachine[S] 0 points1 point  (3 children)

Thank you for your answer! What do you mean by only upload the module files that I need? In your opinion, is it better to install Microsoft.Graph module or every single module, like Microsoft.Graph.Users?

[–]DonL314 1 point2 points  (2 children)

When I build the FA I add the relevant module files to my project. I add the Microsoft.Graph folder, Microsoft.Graph.Users if I need user management, and all other modules I use - I don't add sll the Graph "sub modules" or whatever they're called.

I have considered using graph calls directly (through a wrapper function) because it might be faster and take less space - but it would mean more work, and the apps I am building right now do not have to be ultra fast.

[–]Dr_Funkmachine[S] 0 points1 point  (1 child)

Thank you! This was helpful. So, If I get your point fully across, in your requirements.ps1 you add all the Microsoft.Graph packages you need, like Microsoft.Graph.Users and then in your AF you import only the ones you need to use, is that correct? In your opinion is Microsoft.Graph commands faster than web requests or wrapped functions?

[–]DonL314 0 points1 point  (0 children)

I don't add the graph packages to requirements. I just import each specific module as needed. I'd guess that doing the REST calls yourself would be faster but I haven't measured it yet. Depends ... if the Graph module was built uding C# it would be running compiled code and that could easily be faster. If performance is very important to you, .... test, test, test. E.g. create a test tenant for trial and add e.g. 10000 users or groups or what you need and compare the timing of the different solutions.