Since this question was first asked, there is now another alternative to handle this problem:
Azure Functions
Here are a couple of examples that could easily be modified to call a stored procedure that rebuilds your indexes
Also see
A few things to keep in mind with Azure functions
- They are built on top of Azure Web Jobs SDK and offer additional functionality
- There are two different pricing models:
- App Service plan (attach it to an existing plan)
- Predictable cost model
- It puts extra load on the same VM used by your web site
- Consumption plan
Edit September 5, 2021 to add additional information
It should be noted that if you need SQL Agent, you have another option now. I would suggest reading up on Azure SQL Managed Instances. You can see a comparison of Azure SQL to Azure SQL Managed instance here in the Microsoft Documentation. With Azure SQL Managed Instances, your transition to the cloud could be a lot simpler since a lot of the on-premise features you are used to are already there (including SQL Server Agent, DB Mail, etc.).