From the error message, it appears that you are missing the "Microsoft.Graph" powershell module in the Azure function. To add the module, please follow the below steps
- Select App files in the Azure Functions portal
- Select requirements.psd1 file in the drop down list
- Add the module as mentioned below
There is no need to add install module command in the script as Azure functions use dependency management to add modules to the script. Once you have added the module in the requirements.psd1 file, run the script. When you run the script, you should see a message stating that the module is downloaded.
Hope this helps!