Hi Nagaraj Kadade,
Thanks for posting question in Microsoft Q&A portal.
Yes, you are on the right track. Integrating Microsoft Forms with Power Automate to trigger Azure Automation runbooks is a valid approach.Below, I’ve outlined the considerations, recommended implementation, and alternative options .
considerations:
- Microsoft Forms does not have a native direct integration into Azure Automation runbooks. You must use an orchestration layer either Power Automate or Azure Logic Apps to: Capture the form submission Transform or map the answers into parameters Call the runbook via webhook or the Azure Automation API/connector
- Ensure the runbook is published, tested, and accepts parameters (
TagName
,TagValue
,Operation
), with unique tag values to avoid mismatches, proper handling when no VM matches, and robust error handling in the script (e.g., try/catch, logging). - If the runbook needs to access firewall-protected resources (e.g., storage in a private network), use a Hybrid Runbook Worker with private endpoints or VNet integration.
- Treat webhook URLs (with SAS tokens) like passwords if security is a concern, use Azure Functions or Logic App HTTP triggers for validation instead of exposing webhooks directly, ensure the runbook’s Managed Identity or Automation Account has the required RBAC roles (e.g., Contributor on target VMs’ resource group) and avoid storing or transmitting sensitive information in form responses.
- Use retry policies (basic in Power Automate, advanced in Logic Apps), validate form responses before triggering the runbook, account for webhook execution timeouts by triggering long-running jobs asynchronously (e.g., via "Create Job" action), and enable runbook logging with alerts for failures.
Recommended Power Automate Implementation Steps:
Prepare Runbook
- Verify your runbooks in your Azure Automation account are published and tested to start/stop VMs by accepting input parameters (Tag Name, Tag Value, Operation).
Create Runbook Webhook
- Create a webhook for each runbook In Power Automate
- Azure Portal → Automation Account → Runbooks → Select runbook → Webhooks → Add Webhook → Copy URL(it includes the authentication token)
Create Power Automate Flow
- Trigger-When a new response is submitted (Microsoft Forms).
- Action-Get response details (Microsoft Forms) – select Form ID.
- Action-HTTP (built-in)
Method: POST URI: <your runbook webhook URL> Headers: Content-Type: application/json Body: { "TagName": "Environment", "TagValue": "@{body('Get_response_details')?['yourQuestionField']}", "Operation": "@{body('Get_response_details')?['startOrStopField']}" } ```- Save and test by submitting the form.
Referral documentations:
https://learn.microsoft.com/en-us/azure/automation/automation-webhooks?tabs=portal#create-a-webhook
Yes, there are better/alternative way to achieve this
1.Power Automate ➝ Azure Function ➝ Runbook (via REST API)
- Power Automate sends data to a secured Azure Function.
- Function validates the request (e.g., user, action, input).
- Then it calls the Runbook via REST API or triggers it with hybrid worker
2.Logic App (Standard or Consumption) ➝ Azure Runbook (via API or connector)
Yes, we can also integrate this solution with logic app.
- Create a Logic App with the same trigger When a new response is submitted.
- Use the built-in Azure Automation connector “Create job” or an HTTP action to call the webhook.
- Logic Apps are often preferable for:
Complex workflows Built-in Azure connectors Robust error handling & retry policies ```- You can use **Logic App** instead of Power Automate, especially for **enterprise-grade** solutions.
If the requirement is simple, user-triggered automation with low/medium volume, Power Automate + Webhook is sufficient.
If you need enterprise-grade reliability, enhanced security, or complex orchestration, I recommend Logic Apps with Azure Automation connector or Azure Function as an intermediary.
Please refer below documentation for azure automation related issues:
Explore Azure Automation with DevOps - Training | Microsoft Learn
I hope the provided answer is helpful, do let me know if you have any further questions on this Please accept as Yes if the answer is helpful so that it can help others in the community.