Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSTS Agent Extension in ARM template #1044

Closed
tarunaroraonline opened this Issue Jun 28, 2017 · 24 comments

Comments

Projects
None yet
7 participants
@tarunaroraonline
Copy link

commented Jun 28, 2017

I am trying to install the VSTS Agent as an extension through an ARM template. Unfortunately I can't find the list of parameters that it needs. There is documentation for most of the custom extensions for Compute, except VSTS https://docs.microsoft.com/en-us/azure/virtual-machines/windows/extensions-configuration-samples?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json

Here is the block that'll go in the ARM template, can u suggest what parameters need to go into the properties section?

{
"apiVersion": "2015-06-15",
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('vmName'),'/VsAgent')]",
"location": "uksouth",
"properties": {
"publisher": "Microsoft.Compute",
"type": "TeamServicesAgent",
"typeHandlerVersion": "1.9",
"autoUpgradeMinorVersion": true,
"settings": {
"Name": "",
?????
"commandToExecute": "???"
}
},
"dependsOn": [ ]
}

Tarun

@tarunaroraonline

This comment has been minimized.

Copy link
Author

commented Jun 28, 2017

I have made some progress and cobbled together the following...

{
      "apiVersion": "2015-06-15",
      "type": "Microsoft.Compute/virtualMachines/extensions",
      "name": "[concat(variables('vmName'),'/TeamServicesAgent')]",
      "location": "uksouth",
      "properties": {
        "publisher": "Microsoft.VisualStudio.Services",
        "type": "TeamServicesAgent",
        "typeHandlerVersion": "1.0",
        "autoUpgradeMinorVersion": true,
        "settings": {
          "VstsAccountName": "[parameters('vstsAccount')]",
          "TeamProject": "[parameters('TeamProject')]",
          "DeploymentGroup": "[parameters('DeploymentGroup')]",
          "AgentName": "[parameters('vmName')]",
          "Tags": "[parameters('Tags')]"
          },
          "protectedSettings": {
          "PATToken": "[parameters('personalAccessToken')]"
        }
      },
      "dependsOn": []
    }

It however fails with the following error message...

{
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'.",
    "details": [
      {
        "code": "VMExtensionHandlerNonTransientError",
        "message": "Handler 'Microsoft.VisualStudio.Services.TeamServicesAgent' has reported failure for VM Extension 'TeamServicesAgent' with terminal error code '1009' and error message: 'Enable failed for plugin (name: Microsoft.VisualStudio.Services.TeamServicesAgent, version 1.11.0.0) with exception Command C:\\Packages\\Plugins\\Microsoft.VisualStudio.Services.TeamServicesAgent\\1.11.0.0\\enable.cmd of Microsoft.VisualStudio.Services.TeamServicesAgent has exited with Exit code: -1'"
      }
    ]
  }
}
@TingluoHuang

This comment has been minimized.

Copy link
Member

commented Jun 29, 2017

@chshrikh for deployment group question.

@bishal-pdMSFT

This comment has been minimized.

Copy link

commented Jun 29, 2017

@tarunaroraonline can you please pull details error from Azure portal. Go to VM -> extensions -> Team Services Agent -> click on "view detailed status"

The parameters look fine.

@bishal-pdMSFT

This comment has been minimized.

Copy link

commented Jun 29, 2017

@tarunaroraonline also please provide us your VSTS account name.

@bishal-pdMSFT

This comment has been minimized.

Copy link

commented Jun 29, 2017

@chshrikh, please assign this issue to me and Tejas

@tarunaroraonline

This comment has been minimized.

Copy link
Author

commented Jun 29, 2017

Thank for offering to help. Looking at the logs, the error message is clear. The extension fails to download the Team services agent. The question is, where is the agent being downloaded from? I am behind a proxy in the Azure IaaS Vm...

@tarunaroraonline

This comment has been minimized.

Copy link
Author

commented Jun 29, 2017

@bishal-pdMSFT The VSTS account name is centrica-emt

@chshrikh chshrikh assigned chshrikh and unassigned chshrikh Jun 30, 2017

@bishal-pdMSFT

This comment has been minimized.

Copy link

commented Jun 30, 2017

@tarunaroraonline Agent gets downloaded from our agent's github repo.
However, currently TeamAgent VM extension does not explicitly use proxy settings which is resulting in this error.

@tarunaroraonline

This comment has been minimized.

Copy link
Author

commented Jun 30, 2017

@bishal-pdMSFT The trouble is GitHub uses s3.amazon.com to store the artifacts, which isn't white listed in many enterprises since you have to open access to all of s3 since there isn't a specific pattern in the URL that will allow you to open up subset of access. It would be great if you could server up the extension from an Azure blob store instead?

What are the plans for enabling proxy support for the TeamAgent VM extension?

@RoopeshNair

This comment has been minimized.

Copy link
Member

commented Jun 30, 2017

Hi Tarun( @tarunaroraonline ),

I have added this to our backlog. No time-lines yet :)

@tarunaroraonline

This comment has been minimized.

Copy link
Author

commented Jun 30, 2017

@RoopeshNair Is there a work around you could propose in the interim?

@RoopeshNair

This comment has been minimized.

Copy link
Member

commented Jul 3, 2017

@tarunaroraonline
Can they white-list or bypass proxy for https://github.com/Microsoft/vsts-agent/releases/download/* and visualstudio account url?

@tarunaroraonline

This comment has been minimized.

Copy link
Author

commented Jul 3, 2017

Roopesh we've already white listed .github.com unfortunately github redirects to s3.amazon for all artifacts which is what's causing the real problem.

@bryanmacfarlane

This comment has been minimized.

Copy link
Member

commented Jul 4, 2017

we have a backlog item to server up from azure blob instead of relying on GH releases (which uses s3 internally)

@tarunaroraonline

This comment has been minimized.

Copy link
Author

commented Nov 9, 2017

When is this likes to be available?

@bryanmacfarlane

This comment has been minimized.

Copy link
Member

commented Nov 9, 2017

It's the story after next in our agent backlog. I would guess early in the new year

@tarunaroraonline

This comment has been minimized.

Copy link
Author

commented Jan 26, 2018

@bryanmacfarlane When is this expected to release?

@TingluoHuang

This comment has been minimized.

Copy link
Member

commented Jan 26, 2018

@tarunaroraonline the agent release is already on Azure Blob Storage since https://github.com/Microsoft/vsts-agent/releases/tag/v2.126.0

@tarunaroraonline

This comment has been minimized.

Copy link
Author

commented Jan 30, 2018

Ace! @TingluoHuang can this extension be used to simply deploy a VSTS agent for build (or does it only support deployment group)?

If it supports agent only, should i pass empty values for tags and deployment group? How do I specify the agent queue this should be assigned to?

Is there a schema available for this extension somewhere so i can find out the settings that can be configured?

@RoopeshNair

This comment has been minimized.

Copy link
Member

commented Jan 30, 2018

@tarunaroraonline agent extension supports only deployment group agents.

@tarunaroraonline

This comment has been minimized.

Copy link
Author

commented Feb 17, 2018

@RoopeshNair @bryanmacfarlane @TingluoHuang... Please can i confirm that the update all agents option in VSTS uses the new Microsoft Edge URL (Microsoft Blob) rather than GitHub to download the agent?

@bryanmacfarlane

This comment has been minimized.

Copy link
Member

commented Feb 17, 2018

@tarunaroraonline - yes it does. Actually, the backend just has an url by platform in the DB so it's up to us where it points. But, as of the last couple of releases, we have started pointing VSTS at the azure CDN.

@TingluoHuang

This comment has been minimized.

Copy link
Member

commented Apr 9, 2018

I am going to close this as the original question has been solved.
Agent download got blocked by proxy rules

@TheAzureGuy007

This comment has been minimized.

Copy link

commented Dec 6, 2018

Good Read !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.