question

AndreasFrank-9491 avatar image
0 Votes"
AndreasFrank-9491 asked AndreasFrank-9491 commented

Azure Automation - Azure DevOps GIT Incremental Sync Fails

Hello,

We have an Azure Devops GIT repo where we store scripts for our Azure Automation Account.

The sync works successfully when setting up or running 'Start Sync' which triggers a full sync.
124575-image.png


As you can see we have the option for auto-sync and publish runbooks enabled since we want the push to be considered an change to the running runbook.

But as you can see they continuosly fail and i cant find anything in the logs.
124500-image.png



The logs as below, does anyone have an idea what the issue at hand could be? In the folder which is being synced there is only '.ps1' scripts.

========================================================================================================

Azure Automation Source Control.
Supported runbooks to sync: PowerShell Workflow, PowerShell Scripts, DSC Configurations, Graphical, and Python 2.

Setting AzureRmEnvironment.

Cannot verify the Microsoft .NET Framework version 4.5.2 because it is not included in the list of permitted versions.

Loading module from path 'C:\Modules\User\AzureRM.Profile\AzureRM.Profile.psm1'.

Loading module from path 'C:\Modules\User\AzureRM.Profile\Microsoft.Azure.Commands.Profile.dll'.

Importing cmdlet 'Disconnect-AzureRmAccount'.

Importing cmdlet 'Disable-AzureRmDataCollection'.

Importing cmdlet 'Enable-AzureRmDataCollection'.

Importing cmdlet 'Remove-AzureRmEnvironment'.

Importing cmdlet 'Get-AzureRmEnvironment'.

Importing cmdlet 'Set-AzureRmEnvironment'.

Importing cmdlet 'Add-AzureRmEnvironment'.

Importing cmdlet 'Send-Feedback'.

Importing cmdlet 'Get-AzureRmSubscription'.

Importing cmdlet 'Connect-AzureRmAccount'.

Importing cmdlet 'Get-AzureRmContext'.

Importing cmdlet 'Set-AzureRmContext'.

Importing cmdlet 'Import-AzureRmContext'.

Importing cmdlet 'Save-AzureRmContext'.

Importing cmdlet 'Get-AzureRmTenant'.

Importing cmdlet 'Resolve-AzureRmError'.

Importing cmdlet 'Clear-AzureRmDefault'.

Importing cmdlet 'Get-AzureRmDefault'.

Importing cmdlet 'Set-AzureRmDefault'.

Importing cmdlet 'Disable-AzureRmContextAutosave'.

Importing cmdlet 'Get-AzureRmContextAutosaveSetting'.

Importing cmdlet 'Enable-AzureRmContextAutosave'.

Importing cmdlet 'Clear-AzureRmContext'.

Importing cmdlet 'Remove-AzureRmContext'.

Importing cmdlet 'Rename-AzureRmContext'.

Importing cmdlet 'Select-AzureRmContext'.

Importing alias 'Logout-AzAccount'.

Importing alias 'Logout-AzureRmAccount'.

Importing alias 'Remove-AzureRmAccount'.

Importing alias 'Login-AzAccount'.

Importing alias 'Login-AzureRmAccount'.

Importing alias 'Add-AzureRmAccount'.

Importing alias 'Select-AzureRmSubscription'.

Importing alias 'Save-AzureRmProfile'.

Importing alias 'Get-AzureRmDomain'.

Importing alias 'Resolve-Error'.

Getting AzureRunAsConnection.

Logging in to Azure...

Because the Az modules have all the capabilities of AzureRM modules and more, we will retire the AzureRM modules on 29 February 2024. Learn more about the migration to Az: http://aka.ms/azpsmigrate.

Because the Az modules have all the capabilities of AzureRM modules and more, we will retire the AzureRM modules on 29 February 2024. Learn more about the migration to Az: http://aka.ms/azpsmigrate.

Because the Az modules have all the capabilities of AzureRM modules and more, we will retire the AzureRM modules on 29 February 2024. Learn more about the migration to Az: http://aka.ms/azpsmigrate.

GET https://management.azure.com//subscriptions/e61fd8d2-77dc-42a8-a356-5537e74d8a87/resourceGroups/SE-TYR-Automation-Operations/providers/Microsoft.Automation/automationAccounts/SE-TYR-Operations/sourceControls/affärstöd fo operations?api-version=2017-05-15-preview with 0-byte payload

received 688-byte response of content type application/json; charset=utf-8

POST https://management.azure.com//subscriptions/e61fd8d2-77dc-42a8-a356-5537e74d8a87/resourceGroups/SE-TYR-Automation-Operations/providers/Microsoft.Automation/automationAccounts/SE-TYR-Operations/sourceControls/affärstöd fo operations/listKeys?api-version=2017-05-15-preview with 0-byte payload

received 904-byte response of content type application/json; charset=utf-8

Source control information for syncing:

[RepoUrl = https://tyrensit.visualstudio.com/FO%20Aff%C3%A4rst%C3%B6d%20Operations/_git/FO%20Aff%C3%A4rst%C3%B6d%20Operations] [Branch = master] [FolderPath = OperationsInfra/OperationsAutomation/Azure/AzureAutomation/RunBooks]

Verifying url: https://tyrensit.visualstudio.com/FO%20Aff%C3%A4rst%C3%B6d%20Operations/_git/FO%20Aff%C3%A4rst%C3%B6d%20Operations

Connecting to VSTS...

Syncing to commit id: 'd5107fc5a12971562375081ab5120401b238e9aa'.

GET https://dev.azure.com/tyrensit/FO Affärstöd Operations/_apis/git/repositories/FO Affärstöd Operations?api-version=1.0 with 0-byte payload

received 2319-byte response of content type application/json; charset=utf-8; api-version=1.0

GET https://dev.azure.com/tyrensit/FO Affärstöd Operations/_apis/git/repositories/FO Affärstöd Operations/commits/d5107fc5a12971562375081ab5120401b238e9aa/changes?api-version=1.0 with 0-byte payload

received 3459-byte response of content type application/json; charset=utf-8; api-version=1.0

Because the Az modules have all the capabilities of AzureRM modules and more, we will retire the AzureRM modules on 29 February 2024. Learn more about the migration to Az: http://aka.ms/azpsmigrate.

POST https://management.azure.com//subscriptions/e61fd8d2-77dc-42a8-a356-5537e74d8a87/resourceGroups/SE-TYR-Automation-Operations/providers/Microsoft.Automation/automationAccounts/SE-TYR-Operations/sourceControls/affärstöd fo operations/listKeys?api-version=2017-05-15-preview with 0-byte payload

received 904-byte response of content type application/json; charset=utf-8

GET https://dev.azure.com/tyrensit/FO Affärstöd Operations/_apis/git/repositories/FO Affärstöd Operations/commits/d5107fc5a12971562375081ab5120401b238e9aa/changes?api-version=1.0 with 0-byte payload

received 3459-byte response of content type application/json; charset=utf-8; api-version=1.0

Because the Az modules have all the capabilities of AzureRM modules and more, we will retire the AzureRM modules on 29 February 2024. Learn more about the migration to Az: http://aka.ms/azpsmigrate.

POST https://management.azure.com//subscriptions/e61fd8d2-77dc-42a8-a356-5537e74d8a87/resourceGroups/SE-TYR-Automation-Operations/providers/Microsoft.Automation/automationAccounts/SE-TYR-Operations/sourceControls/affärstöd fo operations/listKeys?api-version=2017-05-15-preview with 0-byte payload

received 904-byte response of content type application/json; charset=utf-8

azure-automation
image.png (39.2 KiB)
image.png (52.2 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AndreasFrank-9491 Can you please provide below information

  • What source control repository are you attempting to sync with? (GitHub ,Azure Devops(Git))

  • Region of Automation Account.

  • How are you setting this up? (PowerShell, Azure Portal , ARM Template)

  • Are you enabling auto-sync or just manual sync?

  • Did this used to work? If so when did it stop working? Note that when setting up using source control integration using a PAT token that they will have a limited lifetime and will need renewal (typically annually). You can renew the PAT with the instructions in this link.

  • Kindly make sure if the permissions are set up correctly. Do share permissions of the account used to set this up on the source repository.
    Reference Link : https://docs.microsoft.com/en-us/azure/automation/source-control-integration#personal-access-token-pat-permissions


0 Votes 0 ·

Hi,

im syncing from Azure Devops (GIT).

The automation Account is in WestEurope. (Same with subscription, resource group)

I'm doing it via the GUI in Azure Portal.

I am enabling the Auto Sync feature which is the only one that doesnt work, manual sync works fine.

Yes, it stopped working perhaps halfways threw our project with moving scripts to Azure, perhaps when we had about 20 runbooks,I will try the PAT renewal but i have tried rebuilding the sync with an new auth without success.

There has also been some Runbooks that have been edited in the automation account to work out bugs and test on fly, to later be synced with the correct "script".
Could that effect something? all Scripts are currently in the same version as in the GIT Repo i Azure Devops.

The account used for permission is global admin and owner of subscription in Azure.
In Devops the account is a Contributor for the project/organization.



0 Votes 0 ·

0 Answers