Share via

How to fix Microsoft GRaph Module installation in Azure function to use sdk ps graph script

Kumar, Dheeraj 40 Reputation points
2026-03-17T14:08:46.98+00:00

How to fix Microsoft Graph Module installation in Azure function to use sdk ps graph script

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


Answer accepted by question author
  1. Pravallika KV 12,820 Reputation points Microsoft External Staff Moderator
    2026-03-17T16:57:35.5166667+00:00

    Hi @Kumar, Dheeraj ,

    Thanks for reaching out to Microsoft Q&A.

    Steps followed to install the module.

    • Create a new PowerShell function app and a httptrigger
    • Navigate to Appfiles=> and edit requirements.psd1 as below:
    
    @{
        # For latest supported version, go to 'https://www.powershellgallery.com/packages/Az'. 
        # To use the Az module in your function app, please uncomment the line below.
        # 'Az' = '15.*'
        'Microsoft.Graph' = '2.*'
    }
    
    
    • Enable System Managed Identity under function App=>Identity.
    • Add Connect-MgGraph -Identity in the function code run.ps1 to test the connection. Hope this helps!

    If the resolution was helpful, kindly take a moment to click on 210246-screenshot-2021-12-10-121802.pngand click on Yes for was this answer helpful. And, if you have any further query do let us know


0 additional answers

Sort by: Most helpful

Your answer

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