Linux Hosted Agents and Azure Artifacts (Symbols Publishing) - azure-devops

Currently when I run the Publish symbols task on the Ubuntu hosted agent I get the following error "The current operating system is not capable of running this task. That typically means the task was written for Windows only. For example, written for Windows Desktop PowerShell."
I have run this task successfully on a Windows Agent but what I have seen it doesn't work on Linux. The only thing that I have seen that could work on Linux is SourceLink but that doesn't work with Azure DevOps Artifacts yet.
Looking around I'm not able to see any way to publish symbols to Azure DevOps artifacts on a Linux agent? Has anybody else encountered this issue and were you able to get around it?

Related

Azure DevOps Self-hosted Agent Capabilities Ubuntu

I'm building a packer image for Azure Devops based on Ubuntu 20.04 for self-hosting. But I can't figure out how I should be adding capabilities. I've installed things like Java and Android SDK and set environment variables for their paths. I can see these when I run printenv but they aren't picked up by the agent. I've stopped & re-started the service, the only way I can get capabilities is by adding them to the .env in the folder where the devops agent is installed and stopping / restarted. How should this work ?

Set up bash inside self-hosted Windows agents in Azure DevOps

Microsoft's own documentation provides the links to the images used for various operating systems, on top of which Microsoft-hosted agents get created.
For Windows Server 2019, the link shows bash as one of the tools included, and it also mentions WSL1 (Windows Subsystem for Linux v1) as installed. And it works just as expected, with Bash tasks running just fine inside Azure DevOps pipelines.
We're currently in the process of setting up our own self-hosted Windows agents, and we're looking for this capability as well. But to my knowledge, having Linux tools such as bash working on Windows requires 1) WSL installed and 2) a Linux distribution installed per a specific user. The procedure for deploying on Windows Server is here.
WSL doesn't currently have multiple-user support (GitHub issue here) and trying to run Linux tools as LOCAL SYSTEM presents challenges of their own. So in this context, how does the image used by the Microsoft-hosted Azure DevOps agents allow them to seamlessly run bash?
I heard about Cygwin, and know that it can provide similar functionality, but for now I'm trying to get bash configured similar to how it's done on Microsoft's own hosted agents.
As of this time, however, I think it is not supported running bash in Azure DevOps self-hosted Windows agent.
The Bash task runs on the agent as the user "NT Authority \ Network Service". However, we cannot install Linux distribution for this user. It will show that the user haven't logged in.
But for Microsoft, its virtual machines should have a specific user from whom bash starts rather than the default NT Authority \ Network Service.

AzurePS System capability is not available on a newly installed vsts-agent

I have successfully installed a new VSTS agent on a new Azure VM - Windows Server 2012 R2 (64bit). When I am try to execute any pipelines containing azure powershell tasks on the new vsts agent, I get an error message :-
Error message 'No agent found in pool BuildAgent2 which satisfies the specified demands:azureps Agent.Version -gtVersion 2.119.1'
Is there any way to add AzurePS as a system capability ?
Please advise on the steps to do this - thanks.
AzurePS System capability is not available on a newly installed vsts-agent
Agree with jessehouwing.
If you want to enable AzurePS System capability, you could install the PowerShell 5.1 or higher on Windows, or PowerShell Core 6.x and later on all platforms, then install/update the Azure PowerShell module on the Azure VM:
Install the Azure PowerShell module
But the error you got should more related to the demands you set on the option tab of your build :
Check the agent version you have installed, make sure you set the correct version, or you can try to remove that demands to check if you still have this issue.
Hope this helps.
I got the same error using the AzureFileCopy#4 task in a self-hosted agent, but I solved it by installing the az module https://www.powershellgallery.com/packages/Az
Install-Module -Name Az

How to deploy an msi from visual studio online to azure vm?

I have a build definition on visual studio online which creates an msi installation package using WiX.
How can I automatically deploy the msi package from VSO build agent to Azure VM after the build completes successfully?
Note: I prefer to use a post-build batch or powershell script as part of the build process. The script should copy the msi to the vm and install it.
You should use Release Management Online. It comes with VSO and allows you to easily orchestrate installing an MSI on any Azure server.
http://nakedalm.com/building-release-pipeline-release-management-visual-studio-2013/
Microsoft just added RM in VSO and its simple to use. I setup an end to end web app deployment, buy as its just a PowerShell to do the install an MSI would be trivial. RM takes care of getting all of the bits to the right spot...
http://nakedalm.com/create-release-management-pipeline-professional-developers/
Honestly, it sounds hard, but is much easier than trying to do it all yourself.

TFS 2010 - Nightly Builds of WiX MSI for WebApplication/Windows Service and install to web server

Can you please enlighten me on my task?
My task is to create a nightly builds of MSI (done in WiX) and install it to our web server using powershell.
TFSBuild server build an MSI
Run Powershell to uninstall and install the newly build MSI.
Run Powershell to Start the windows service.
The WiX MSI contains WindowsService and a Web Application.
Below are list of what i have done so far:
Solution.sln : Configuration Manager and "x86|debug" (check all the files that needs to be built '.wixproj' already checked)
Created a build definition and set "x86|debug" for configurations to build and set projects to build is my solution file.
but after the build has completed, there is no MSI files on the binaries build folder on the build server. :(
Thanks in advance.
Few pointers:
Have you installed Wix on the buildserver?
Which version of Team Build are you using? 2010 has the preference here as the tooling has progressed a lot since 2008.
Did you configure to run msbuild in auto or x86 mode (auto can result in 64-bit which has some issues with the latest stable version of wix) link link
Is your build agent running on a 64 bit server? If so, you either need to run the build agent under an administrative account or do some mucking around in the registry to fix issues with Wix. link
To install the build using Powershell, I personally prefer TFSDeployer, which can monitor your build output and trigger powershell scripts based on the build outcome. It takes away the deployment responsibility from the build server and saves a lot of headaches around security and account configurations.