I have created an azure automation account and wish to setup a source control connection with github using a PAT.
The PAT has been created with the correct permissions but when I try to run the powershell command I get the following error
New-AzAutomationSourceControl : Resource 'datacenterAzureAutomation' was disallowed by policy. Policy identifiers: '[{"policyAssignment":{"name":"Deny Disallowed Locations","id":"/providers/Microsoft.Management/managementGroups/xxx/providers/Microsoft.Authorization/policyAssignments/Deny Locations Assign"},"policyDefinition":{"name":"Deny Disallowed Locations","id":"/providers/Microsoft.Management/managementgroups/xxx/providers/Microsoft.Authorization/policyDefinitions/Deny Disallowed Locations"}},{"policyAssignment":{"name":"Whitelist Azure Regions","id":"/providers/Microsoft.Management/managementGroups/xxx/providers/Microsoft.Authorization/policyAssignments/whitelist_regions"},"policyDefinition":{"name":"Whitelist Azure Regions","id":"/providers/Microsoft.Management/managementGroups/xxx/prov iders/Microsoft.Authorization/policyDefinitions/whitelist_regions"}}]'.
However when I try to add the sourcecontrol using the UI it works (but no option to authenticate by using the PAT).
The automation account has been created in the correct location and there is no location parameter for the sourcecontrol connection so I am confused why I am getting this error.
The cmdlet I am running:
New-AzAutomationSourceControl -ResourceGroupName "