Hello Paul !
Thank you for posting on Microsoft Learn.
You're right, as of now, Azure Automation does not officially support Git-based source control integration (like Azure DevOps or GitHub) for PowerShell 7.2 runbooks. This is a known limitation, and many teams encounter issues like the 400 Bad Request error when attempting to link or sync PS7.2 runbooks via version control mechanisms that worked for PS5.1.
Microsoft source control integration for Azure Automation was originally built around PowerShell 5.1 and Python 2/3, and the tooling (especially for the GitSync backend) has not been updated to accommodate PowerShell 7.2. When you attempt to sync a 7.2 runbook using the Azure DevOps integration UI, the system may reject it due to incompatible or missing metadata, which triggers the 400 error.
Microsoft has not officially announced support for source control (Git integration) for PowerShell 7.2 runbooks in Azure Automation.
The roadmap for Azure Automation increasingly emphasizes Azure Functions and GitHub Actions, which offer first-class DevOps integration and support PS7+.
You can automate the sync yourself via DevOps pipelines by storing the .ps1 runbooks in your ADO repo and use an Azure DevOps release pipeline or GitHub Action to deploy the scripts using the Azure Automation API or Az PowerShell module:
$runbookPath = "path\to\Runbook.ps1"
$automationAccount = "MyAutomationAccount"
$resourceGroup = "MyResourceGroup"
$content = Get-Content $runbookPath -Raw
Set-AzAutomationRunbook `
-AutomationAccountName $automationAccount `
-Name "RunbookName" `
-ResourceGroupName $resourceGroup `
-Type PowerShell7 `
-Description "Updated via pipeline" `
-Content $content
If you’re open to platform changes, Azure Functions or GitHub Actions support native PS7 environments, source control, CI/CD, and better integration for modern workflows.
You can even create "runbook-style" workflows using GitHub Actions or Logic Apps for recurring tasks.