Build an Azure WebJob to act as a scheduled job for your Office 365
Azure WebJobs SDK
https://github.com/Azure/azure-webjobs-sdk/wiki
https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/getting-started-with-building-azure-webjobs-for-your-office365-sites
Azure WebJobs
Includes a declarative binding and trigger system that works with Azure Storage Blobs, Queues and Tables as well as Service Bus. The binding system makes it incredibly easy to write code that reads or writes Azure Storage objects. The trigger system automatically invokes a function in your code whenever any new data is received in a queue or blob. The SDK also provides an integrated Dashboard experience in the Azure management portal, with rich monitoring and diagnostics information for your WebJob runs.
Azure WebJobs SDK Samples
https://github.com/Azure/azure-webjobs-sdk-samples
GitHub Home Page
https://github.com/Azure/azure-webjobs-sdk
Check out the getting started guide, the how-to guide and the wiki. For more information on Azure and .NET see here.