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

[Question]: Offline upgrade of Deployment targets #4785

Closed
1 of 4 tasks
hedasp opened this issue May 7, 2024 · 7 comments
Closed
1 of 4 tasks

[Question]: Offline upgrade of Deployment targets #4785

hedasp opened this issue May 7, 2024 · 7 comments
Assignees

Comments

@hedasp
Copy link

hedasp commented May 7, 2024

Describe your question

For offline Deployment targets(doubling as environment targets too) we try to upgrade the installed agent using the "Upgrade targets" option in Azure DevOps UI for the Deployment group.
This triggers the src/Agent.Listener/SelfUpdater.cs script as expected and tries to download the current version 'https://vstsagentpackage.azureedge.net/agent/3.238.0/vsts-agent-win-x64-3.238.0.zip' to 'C:\agentfolder_work_update\agent1.zip'
This fails, due to lacking firewall opening.

The following should be an option according to this documentation: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/agents
"For servers with no internet access, manually copy the agent zip file to the following folder to use as a local file. Create the Agents folder if it is not present.
Windows: %ProgramData%\Microsoft\Azure DevOps\Agents"

But the SelfUpdater does not check this folder at all.
Adding the zip file directly to the '_work_update' folder does not work either, as it's cleaned when update script is running. Renaming it to "agent1.zip" did nothing either.

What is the recommended approach for upgrading offline deployment groups?

Versions

Azure DevOps Agent Version: 3.224.1
Windows Server 2022
Azure DevOps Services

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Operation system

Windows 2022

Version controll system

Azure Repo

Azure DevOps Server Version (if applicable)

No response

@ivanduplenskikh
Copy link
Contributor

@hedasp, have you attempted to place the agent zip file on Azure DevOps Server machine?
From your description it looks like you tried to place the agent on the machine that runs the agent itself

@hedasp
Copy link
Author

hedasp commented May 8, 2024

Hi @ivanduplenskikh
We use Azure DevOps Service - so we don't have our own Azure DevOps Servers to place the agent zip file.
The machine that runs the agent itself tries to download the zip from the official URL, so the question is if we could point it to a local path containing the zip file with updated version instead.

@ivanduplenskikh
Copy link
Contributor

@hedasp, in this context, you have two options. You may either configure your security system settings as per the documentation which includes setting up allowed address lists and network connections, or you can manually install the latest version of the agent.

Also, there is an issue that can be related

@hedasp
Copy link
Author

hedasp commented May 8, 2024

@ivanduplenskikh thanks for getting back to me so quickly.
So basically, manually install the latest version = re-configuring the agent?
Will lose some history then I guess, so not super ideal.

@ivanduplenskikh ivanduplenskikh self-assigned this May 9, 2024
@ivanduplenskikh
Copy link
Contributor

@hedasp, in this case you have the option to replace the old agent version with the new agent version.
The credentials files and _work/_diag folders will be preserved.

@hedasp
Copy link
Author

hedasp commented May 16, 2024

Thanks for getting back to me,@ivanduplenskikh
" replace the old agent version with the new agent version " This is probably what I'm looking for, but the question is how to actually do this.

@ivanduplenskikh
Copy link
Contributor

@hedasp, you may download the release from the releases page and extract it to the existing directory.

An example would be:

Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$HOME\Downloads\vsts-agent-win-x64-agent-version.zip", "agent_directory", $true)

In this way, files and directories which were generated by the agent will be persist.

@hedasp hedasp closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants