Azure VM's Custom Script Extension should do the trick: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/tutorial-automate-vm-deployment
If you're able to run the Installation through PowerShell in the VM, then the Custom Script Extension will automatically run it after Startup.
Windows Task Scheduler can also be setup to automatically run PowerShell on Startup, or Software Installation.
And another solution would be to use GPO for Domain Joined machines: https://learn.microsoft.com/en-us/troubleshoot/windows-server/group-policy/use-group-policy-to-install-software