An Azure platform as a service offer that is used to deploy web and cloud applications.
Hello Sachin K,
Thank you for posting your question in the Microsoft Q&A forum.
The recurring "Bad Request" error preventing your Azure VM from starting or stopping on schedule typically indicates a misalignment between the automation configuration and Azure's resource management policies. This issue often arises when the automation service lacks proper permissions, the VM is in a transitional state during execution, or the schedule conflicts with Azure's operational constraints.
- First, verify that the service principal or managed identity responsible for the automation has Contributor permissions on both the VM and its associated resources, as insufficient access rights frequently trigger generic "Bad Request" responses.
- Second, inspect the VM's provisioning state through Azure Monitor logs, as pending operations like extensions installation or disk resizing may block scheduled actions.
- Third, review the automation workflow logic whether using Azure Automation, Logic Apps, or Event Grid to ensure the schedule aligns with Azure's API rate limits and regional availability. If the problem persists, test manual start/stop commands via PowerShell or CLI to isolate whether the issue lies with the automation framework or the VM itself.
For immediate mitigation, leverage Azure's native auto-shutdown feature as a temporary workaround while troubleshooting the primary automation setup. Finally, cross-check the Azure status dashboard for ongoing service incidents in your region that might explain intermittent failures.
For comprehensive diagnostics, enable verbose logging in your automation solution and correlate timestamps with Azure Activity Logs to pinpoint the exact failure trigger.
Some reference documentation you may review:
https://learn.microsoft.com/en-us/azure/azure-functions/start-stop-vms/overview
https://learn.microsoft.com/en-us/azure/automation/troubleshoot/runbooks
If the above answer helped, please do not forget to "Accept Answer" as this may help other community members to refer the info if facing a similar issue. Your contribution to the Microsoft Q&A community is highly appreciated.