SonarQube in Azure DevOps wtih Microsoft Hosted Agent - azure-devops

As our SonarQube instance was not accessible over internet, I am getting the below error in "Prepare analysis on SonarQube" task during the analysis of a java project.
[SQ] API GET '/api/server/version' failed, error was: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"ABC.XYZ.com","host":"ABC.XYZ.com","port":443}
Some links suggests that by adding proxy variable will solve this issue. But don't know how to do it. Some links suggests to install agent service (from Deployment Pool section) will solve this issue. In that case we need to do it for multiple organization.
So anyone please let me know what will be the proper solution for this issue.

For this problem when using SonarQube on Azure DevOps Services (VSTS), installing self-hosted agents generally is a better way to solve the problem.
To install self-hosted agents on multiple organizations, you can try to set up a shell script that executing the installation command lines in a loop to install a self-hosted agent for each organization.

Related

Azure Pipeline error "Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available."

I am trying to create CI/CD pipeline in azure databricks with azure devops using a windows self hosted agent. I am following this blog: https://www.linkedin.com/pulse/ci-cd-azure-databricks-using-devops-deepak-rajak I am getting this error and I am not able to resolve it any idea how can I resolve this?
Looks like you're hitting a known issue. Make sure the most recent version of the Azure CLI ir installed and available on the %path% for the user that runs the Azure Pipelines agent.

Not able to find SonarQube Service Connection in Azure Devops in new service connection list

Tried looking all over couldn't find the option or the solution to get the option, any inputs would be deeply helpful.
My Azure DevOps Version:
I'm pretty sure the Azure DevOps is the latest.
You need to install the SonarQube extension:
After that you will see it:
you need to install these both extensions
sonar cloud -- https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarcloud
sonar qube -- https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarqube
after that you can see the service endpoints.

Azure Pipelines - Clone or Copy Hosted Agent

Is it possible to clone or copy an Azure Pipeline Hosted Agent for use as a Self-Hosted Agent?
I'd like to reuse one of the Hosted Agents simply to enable me recreate and reuse all of its
capabilities, saving me the headache. Is this possible and if so I'd really appreciate some help.
Thanks
This is not possible, but you can try to reuse what is already available here https://github.com/actions/virtual-environments
This repository contains the source used to create the virtual environments for GitHub Actions hosted runners, as well as the VM images of Microsoft-hosted agents used for Azure Pipelines. To file bug reports, or request that tools be added/updated, please open an issue using the appropriate template. To build a VM machine from this repo's source, see the instructions.
So you can use the same scripts which are used to create Microsoft Hosted agents.
There is no such build-in feature.
Azure DevOps provides free hosted agents that have a predefined set
of tools installed and configured for building and releasing your
apps.
There is another option where you set up and manage your own agents.
This can be done by simply downloading the agent package, and run it
either on your local machine or any other computing platform even on
Docker container. It also gives you more freedom to install specific
dependencies for your build and release.
If you want to build your own agent during the pipeline. I would suggest you use Docker container to handle the process.
Microsoft has already created pre-configured container images on Docker Hub for everybody to use. But they’re Linux based and don’t contain any additional applications and/or packages so you’d probably still need to add those every time you run your build.
This repository contains images for the Visual Studio Team Services
(VSTS) agent that runs tasks as part of a build or release.
VSTS agent images are tagged according to the base OS, an optional
Team Foundation Server (TFS) version, and tools that are installed.
When used with VSTS, the agent version is automatically determined and
downloaded at container startup based on the account to which the
agent is connecting.
More detail step, you could refer this article: Build your own Azure DevOps agents with pipelines

'Can not determine workspaces' error -> Azure DevOps Services and Build Agent on VM

I'm trying to set Build Server machine in way that Build Agent is configured on it, and is targeting Azure DevOps Service (Cloud) collection, or organization as it is named like that for now. There is established connection but problem that I'm faced with is regarding workspaces.
When I try to run build definition, checkout step fails due to "Can not determine workspace..." error. As I run the advised command
tf workspaces /collection:<collection_url>
on Build Server, I can build given project, but, when try another project, the same story. I have to run the mentioned command again (new workspace is appeared in the list) and then I'm able to build that project.
Can someone point me on right way in diagnostic or tell the cause/solution if faced with this already?
According to the description and this thread which i assume is also posted by you,seems the agent in Azure DevOps is the one you used in TFS which is called as migration.
As I run the advised command
tf workspaces /collection:<collection_url>
on Build Server, I can build given project, but, when try another project, the same story.
It looks like the build definition requires a specific workspace which you managed by manual command.
What about create a new agent in Azure DevOps which is quite simple see if the problem can be resolved.

Is it possible to run an On premise SonarQube Server on azure devops deploy pipeline?

I'm deploying my application to an on promise IIS server and I would like to run a sonarQube Analytics at the same time, using a self-hosted agent, but the sonarQube server is in another server.
I was thinking to run a command using cmd to start the analytics, but I'm not sure how to do this because sonarQube is in another server.
Is it possible to run an On premise SonarQube Server on azure devops deploy pipeline?
The short answer is yes.
You don't need SonarQube to be hosted on same server. You can use SonarScanner as client on your build server and the scanner will push data to SonarQube.
There is an image about SonarQube Architecture and Integration:
obviously, SonarQube Scanner should be what you are looking for.
Read more about SonarScanner here:
https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
Certificate from: how to use one sonar server on multiple machines.
Hope this helps.
Yes, you can use your server. The main condition is availability of your SonarQube server from internet because Azure DevOps creates a service connection. You can find lessons here: Managing technical debt with SonarQube and Azure DevOps