This is a sample Windows Console app that reads events from a Microsoft 365 calendar, determines what bandwidth update actions to take, and then calls the Lumen IoD APIs to update the bandwidth at the scheduled time.
The period in which to monitor the Microsoft 365 calendar is configurable (defaults to 6 hours). To monitor a calendar around the clock, you would run a process like this via a cronjob, scheduled task, Windows service, etc. No data is written or stored locally other than output log files. To view examples of how bandwidth actions are determined (including how conflict resolution works), please see the Lumen-IoD-Scheduler overview.
Microsoft 365 license for work/school (Personal account can be used for testing)
- Microsoft 365 calendar created and permissioned to specified user(s)
- Registered application in Azure Entra ID to allow calendar access through Microsoft Graph APIs:
- Including client secret and Graph API permissions (Calendars.Read and User.Read.All)
- To test with a personal Outlook account in Visual Studio or VS Code:
- configure the Entra ID app to enable device code flow
- Add https://localhost as the Redirect URI
- Set the tenantId in appsetting.json to "common"
- Registered application in Lumen Developer Center for IoD
- Including client secret
One manner of finding your calendar Id value is by using Graph Explorer, such as the via the list calendars call. There are other methods to get this Id that can be found with a quick web search.
Most settings are in the appsettings.json file. This includes the ability to change the time interval, set the regular expression pattern to match the calendar event subject line, the location of the output log file, as well as connection information for Graph APIs and Lumen APIs.
In addition, configuration information is in IoD-Json/bandwidthUpdate.json, specifically in the "relatedContactInformation" section at the bottom. You should specify an emailAddress here in order to receive the status notification mail from Lumen once the bandwidth update action has processed.
For questions or feedback, please contact Jacob Johansen at jakejoh@hotmail.com.
Use the Microsoft Graph API - Microsoft Graph | Microsoft Learn
Microsoft Graph authentication and authorization overview | Microsoft Learn
Register an application with the Microsoft identity platform - Microsoft Graph | Microsoft Learn