Hello, @Teltec - Hugo !
How do you prevent an unexpected VM shutdown when there is an attached VHD?
The short answer is that while you can't prevent the VM shutdown when IOPS have been exceeded on VHDs in a single storage account, you can place your VHDs in multiple storage accounts to make sure that this limit isn't exceeded. That in turn will prevent the unexpected shutdown from happening.
When does Azure turn off a VM?
There are several maintenance scenarios that you have control over, many of which do not require a reboot. There's a lot to go through here which I'll include for others who may be reading this however your issue seems to be VHD related which I'll address further down below.
Unexpected VM Restarts and Attached VHDs
Generally speaking, there are a number of unexpected restart scenarios however VHDs have special considerations. If a virtual machine has a large number of attached VHDs that are in the same storage account, it's possible to exceed the scalability targets for the individual storage account which will cause the VM to reboot unexpectedly.
You can tune how many VHDs you have in a single storage account based on the estimated IOPS for your environment specific to your application. Microsoft recommends having 40 or fewer disks in a single storage account. If you are exceeding the scalability targets for your storage account, place your VHDs in multiple storage accounts to reduce the activity in each individual account.