Azure-related repository
SonarQube is an open source platform to perform automatic reviews with static analysis of code to detect bugs, code smells and security vulnerabilities.
In this tutorial, we will learn how to deploy ready-to-use SonarQube environment on Azure.
To reproduce the solution we will need to download and run script.sh, which will:
As a result, we will get running VM (with NGINX and containerized SonarQube instance) and PostgreSQL instance (used as a database for SonarQube):
To complete this tutorial, we will need:
There is one thing which should be done before running a deployment - we need to create a new resource group:
Now we can open our Linux environment (in this example has been used Ubuntu on Linux), login to Azure CLI (by running command ‘az login’), download script.sh file and execute it. As an input ‘script.sh’ requires following 3 parameters:
Now we can start to deploy our solution (order of parameters should be the same as on the image):
The deployment could take about 25-40 minutes. After it will be finished, we can open newly created virtual machine, copy it DNS Name and access SonarQube thru HTTPS:
SonarQube ships with a default administrator username and password - admin/admin:
Such password is not secure, so we’ll want to update it:
Another important security breach is that the SonarQube instance is wide-open to the world, and anyone could view analysis results and of a source code. This setting is highly insecure, so we’ll configure SonarQube to only allow logged-in users access to the dashboard:
In this tutorial, we’ve set up a SonarQube instance and secure it. Now you’re ready to install an analyzer and begin creating projects.