MSGraph.MeetingRecordingNotifier.mp4
This sample demonstrates how to use the Microsoft Graph .NET SDK to get a notification email about the meeting recording URL.
NOTE: This sample is still has points to be imporved and it's for running locally.
This sample requires an Azure AD application registration:
-
Open a browser and navigate to the Azure Active Directory admin center and login using an Microsoft 365 tenant organization admin.
-
Select Azure Active Directory in the left-hand navigation, then select App registrations .
-
go to App Registrations, and select New registration. On the Register an application page, set the values as follows.
- Set Name to
Graph Azure Function Notifier
. - Set Supported account types to Accounts in this organizational directory only.
- Leave Redirect URI blank.
- Set Name to
-
Select Register. On the Graph Azure Function Notifier page, copy the value of the Application (client) ID and save it, you will need it in the next step.
-
Select Certificates & secrets under Manage. Select the New client secret button. Enter a value in Description and select one of the options for Expires and select Add.
-
Copy the client secret value before you leave this page. You will need it in the next step.
-
Select API Permissions under Manage. Choose Add a permission.
-
Select Microsoft Graph, then Application Permissions. Add User.Read.All and Mail.ReadWrite and Mail.send and Chat.Read.All and Chat.ReadWrite.All, ChatMessage.Read.All then select Add permissions.
-
In the Configured permissions, remove the delegated User.Read permission under Microsoft Graph by selecting the ... to the right of the permission and selecting Remove permission. Select Yes, remove to confirm.
-
Select the Grant admin consent for... button, then select Yes to grant admin consent for the configured application permissions. The Status column in the Configured permissions table changes to Granted for ....
-
Create Self Signed Certificate using the Powershell script Create-SelfSignedCertificate.ps1
-
copy the the generated CertificateThumbprint. You will need it in the next step.
-
Use
dotnet user-secrets init
anddotnet user-secrets set
in the MSGraph.MeetingRecordingNotifier directory to set the following values.- dotnet user-secrets init --project "project path"
- dotnet user-secrets set --project "project path" "webhookClientId" "webhookClientIdValue"
- dotnet user-secrets set --project "project path" "webhookClientSecret" "webhookClientSecretValue"
- dotnet user-secrets set --project "project path" "tenantId" "tenantIdIdValue"
- dotnet user-secrets set --project "project path" "ngrokUrl" "ngrokUrlIdValue"
- dotnet user-secrets set --project "project path" "CertificateThumbprint" "CertificateThumbprintValue"
- dotnet user-secrets set --project "project path" "ClientState" "ClientStateValue"
- dotnet user-secrets set --project "project path" "MessageSubject" "MessageSubjectValue"
- dotnet user-secrets set --project "project path" "MessageBody"
"<p>Hello!</p><p><span> Please find the {0} meeting recording <a href=\"{1}\">URL.</a></span></p>"
-
Run ngrok using the following command.
ngrok http 7071
NOTE If you restart ngrok, you will need to update the
ngrokUrl
value in user secrets with the new ngrok URL and restart the Azure Function project.
The following command (run in the GraphSampleFunctions directory) will start the Azure Function project locally on your machine.
- run the azure function from visual studio or from VS.
func start
- run a post request using SetSubacription with a payload in the body then a new subscription vaild for one hour will be created.
{"requestType": "subscribe"}