An Azure service that provides an event-driven serverless compute platform.
Thanks for reaching out.
The error you're seeing (Connect-MgGraph : The term 'Connect-MgGraph' is not recognized...) usually means that the Microsoft Graph PowerShell SDK isn't available in the Azure Function environment.
To fix this, you can add a requirements.psd1 file to your Function App with the following content:
@{
'Microsoft.Graph' = '2.*'
}
Azure Functions will automatically download and install the module when it starts, as long as managed dependencies are enabled (which is the default). There's no need to manually install the module unless you're testing locally.
Also, make sure your function is running on PowerShell 7 since the Graph SDK requires it. If you're using Connect-MgGraph -Identity, please ensure that the Function App’s Managed Identity has the right permissions in Azure AD (like User.Read.All).