Azure-docs: Auto sync feature is not working for azure git repo.

Created on 23 Sep 2019  Â·  16Comments  Â·  Source: MicrosoftDocs/azure-docs

Is this by design?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author automatiosvc process-automatiosubsvc product-question triaged

All 16 comments

@girishgouda Thanks for the comment. We are actively investigating on the issue and will get back to you shortly with an update.

@girishgouda Normally, auto sync feature works. Seems, there is an issue related to it.
@bobbytreed Can you please provide your inputs?

Even I am facing the same issue. Auto-Sync feature is not working for the repo which is under Azure Devops.

I have the same issue.
Things I have found:

  • The problem is autosync through Azure DevOps GIT
  • manual sync is working without issues
  • I have set up source control through PowerShell with a PAT key with full access. Azure DevOps and Azure tenant are not connected through AzureAD
  • Friend of mine says his sync is working. He has a manual set up sync, Azure DevOps and Azure Ad are the same tenant

Errors in the autosync job:

The property 'refUpdates' cannot be found on this object. Verify that the property exists. At line:911 char:5 + $actualBranch = $WebhookDataObject.resource.refUpdates.name + ~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException + FullyQualifiedErrorId : PropertyNotFoundStrict

Compare-Branch : Cannot validate argument on parameter 'ActualBranch'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At line:912 char:62 + ... (Compare-Branch -ExpectedBranch $Branch -ActualBranch $actualBranch) + ~~~~~ + CategoryInfo : InvalidData: (:) [Compare-Branch], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Compare-Branch

Our organization is having the same issue, is there any status update?

I raised a support ticket with Microsoft and they said that the update to
fix this issue will be released on 10/18 across all regions. Subscribe
again to the sync feature, once the update is available and then the
auto-sync feature will work.

On Tue 8 Oct, 2019, 6:54 PM Gerbrand van der Weg, notifications@github.com
wrote:

Our organization is having the same issue, is there any status update?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/MicrosoftDocs/azure-docs/issues/39347?email_source=notifications&email_token=ANJSIOSO2PMX4OB2ACTXFQTQNSCYDA5CNFSM4IZHO3Y2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAUEUMY#issuecomment-539511347,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANJSIOT6CPN5ROLNAS224PLQNSCYDANCNFSM4IZHO3YQ
.

It doesn't work for me as well, we have AzureDevops git and Auto-Sync enabled.

Microsoft support have advised that they know about this bug and a fix is planned for deployment on the 12th December.
The workaround is to update the service hook in Azure DevOps to use a specific API version:

  1. Go to Project Settings
  2. Click on Service hooks.
  3. Double click on Webhook for this repository.
  4. Click Next and scroll down to Resource version.
  5. Select 1.0 as the value from the dropdown.

Microsoft support have advised that they know about this bug and a fix is planned for deployment on the 12th December.
The workaround is to update the service hook in Azure DevOps to use a specific API version:

  1. Go to Project Settings
  2. Click on Service hooks.
  3. Double click on Webhook for this repository.
  4. Click Next and scroll down to Resource version.
  5. Select 1.0 as the value from the dropdown.

This seemed to work untill (I think) yesterday. Now when I try this the Process-SourceControlWebhook runbook starts but I get an output like this:

`Getting Azure Connection information

Getting the source control information

SourceControl Properties : [RepoUrl = https://XXXX.visualstudio.com/XXXX/_git/Azure-Control] ,[Branch = Control-TEST] , [FolderPath = /Automation_Runbooks/]

UrlConnectionInformation: [AccountName = XXXX] [RepoName = Azure-Control] [ProjectName = XXXX]

Start a sync job for commit id : 8c8551cf20ab0820f8a1f67ad0f7bb7cb0b9075c

Name Value
---- -----
ProvisioningState Running
SourceControlSyncJobId 9bc460a5-c192-4874-b19b-f067ea6880a6
EndTime
CreationTime 2019-12-04T03:49:06.3520648+00:00
StartTime
SyncType PartialSync `

For some reason the job outputs the still running state and can't seem to finish (or even start). because of this the sync job also fails.
Anyone else also experiencing this?
When settings the webhook version back to the latest I get the earlier mentioned error still.
I tried updating the azureRM modules and setting the connection up again but both to no avail.

Edit:
Some more info. The runbook itself seems to be completing but in the sync job I get this output:
`Getting AzureRunAsConnection.

Logging in to Azure...

GET https://management.azure.com//subscriptions/XXXXXXXX/resourceGroups/Henk_BV_Powershell_Casus/providers/Microsoft.Automation/automationAccounts/HBV-Control-TEST/sourceControls/devops to azure test?api-version=2017-05-15-preview with 0-byte payload

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

POST https://management.azure.com//subscriptions/XXXXXXXXXX/resourceGroups/Henk_BV_Powershell_Casus/providers/Microsoft.Automation/automationAccounts/HBV-Control-TEST/sourceControls/devops to azure test/listKeys?api-version=2017-05-15-preview with 0-byte payload

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

Source control information for syncing:

[RepoUrl = https://XXXX.visualstudio.com/XXXX/_git/Azure-Control] [Branch = Control-TEST] [FolderPath = /Automation_Runbooks/]

Verifying url: https://XXXX.visualstudio.com/XXXX/_git/Azure-Control

Connecting to VSTS...

Syncing to commit id: 'e685517a1c722475509551714a56910c39dd247e'.

GET https://dev.azure.com/XXXX/XXXX/_apis/git/repositories/Azure-Control?api-version=1.0 with 0-byte payload

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

GET https://dev.azure.com/XXXX/XXXX/_apis/git/repositories/Azure-Control/commits/e685517a1c722475509551714a56910c39dd247e/changes?api-version=1.0 with 0-byte payload

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

POST https://management.azure.com//subscriptions/XXXXXXXXX/resourceGroups/Henk_BV_Powershell_Casus/providers/Microsoft.Automation/automationAccounts/HBV-Control-TEST/sourceControls/devops to azure test/listKeys?api-version=2017-05-15-preview with 0-byte payload

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

GET https://dev.azure.com/XXXX/XXXX/_apis/git/repositories/Azure-Control/commits/e685517a1c722475509551714a56910c39dd247e/changes?api-version=1.0 with 0-byte payload

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

POST https://management.azure.com//subscriptions/XXXXXXXXXXXXXXX/resourceGroups/Henk_BV_Powershell_Casus/providers/Microsoft.Automation/automationAccounts/HBV-Control-TEST/sourceControls/devops to azure test/listKeys?api-version=2017-05-15-preview with 0-byte payload

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

After this I shows failed. I tried it with another repository and for some reason it does seem to work there. In one of my pipelines I'm checking if the sync job is complete already. Could this be the cause of the "fail" ?

Edit2: I ran it again without the check if it's completed and it still doesn't work. I will check some more to see if I can find a difference between the two repositories and see if I can narrow down why it's failing.

Okay I did some more testing, and from what I see the problem only seems to be when there is folder is defined. When you are syncing the root directory everything seems to work okay. but when using a folder in the directory the script seems to break...

I did not specify the folder and it does not work. Having the same erros in logs as Ba4bes commented 3 months ago

I did not specify the folder and it does not work. Having the same erros in logs as Ba4bes commented 3 months ago

Did you set the webhook version to V1.0 as stuartin sugested?

Did you set the webhook version to V1.0 as stuartin sugested?

No, stuartin mention that tomorrow (12 Dec) it will be fixed. Fingers crossed

Did you set the webhook version to V1.0 as stuartin sugested?

No, stuartin mention that tomorrow (12 Dec) it will be fixed. Fingers crossed

For me when not having a subfolder settings the webhook to v1.0 worked

No, stuartin mention that tomorrow (12 Dec) it will be fixed. Fingers crossed

It still fails but now with different errors:

The property 'refUpdates' cannot be found on this object. Verify that the property exists. At line:978 char:5 + $actualBranch = $WebhookDataObject.resource.refUpdates.name + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException + FullyQualifiedErrorId : PropertyNotFoundStrict

Compare-Branch : Cannot validate argument on parameter 'ActualBranch'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At line:979 char:62 + ... (Compare-Branch -ExpectedBranch $Branch -ActualBranch $actualBranch) + ~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Compare-Branch], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Compare-Branch

Have same issue (manual sync works OK, but auto sync fails with error "Invalid project or repo name ")
And found that reason is when Repo name is different from project name. In case if U will use default repo for project (usually on creating project U have repo with name same as project name).

Was this page helpful?
0 / 5 - 0 ratings