This template allows you to host an instance of Jenkins on a DS1_v2 size Linux Ubuntu 14.04 LTS VM in Azure. For more information regarding this template and how it secures Jenkins on Azure, refer to http://aka.ms/secure-jenkins.
A. Deploy Azure Jenkins VM
- Click "Deploy to Azure" button. If you haven't got an Azure subscription, it will guide you on how to signup for a free trial.
- Enter a valid name for the VM, as well as a user name and ssh public key that you will use to login remotely to the VM via SSH.
- Remember these. You will need this to access the VM next.
B. Setup SSH port forwarding
By default the Jenkins instance is using the http protocol and listens on port 8080. Users shouldn't authenticate over unsecured protocols!
You need to setup port forwarding to view the Jenkins UI on your local machine.
If you are using Windows:
Install Putty or use any bash shell for Windows (if using a bash shell, follow the instructions for Linux or Mac).
Run this command:
putty.exe -ssh -i <path to private key file> -L 8080:localhost:8080 <User name>@<Public DNS name of instance you just created>
Or follow these manual steps:
- Launch Putty and navigate to 'Connection > SSH > Tunnels'
- In the Options controlling SSH port forwarding window, enter 8080 for Source port. Then enter 127.0.0.1:8080 for the Destination. Click Add.
- Navigate to 'Connection > SSH > Auth' and enter your private key file for authentication. For more information on using ssh keys with Putty, see here.
- Click Open to establish the connection.
If you are using Linux or Mac:
Run this command:
ssh -i <path to private key file> -L 8080:localhost:8080 <User name>@<Public DNS name of instance you just created>
C. Connect to Jenkins
- After you have started your tunnel, navigate to http://localhost:8080/ on your local machine.
- Unlock the Jenkins dashboard for the first time with the initial admin password. To get this token, SSH into the VM and run
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
- Your Jenkins instance is now ready to use! You can access a read-only view by going to http://< Public DNS name of instance you just created >.
- Go to http://aka.ms/azjenkinsagents if you want to build/CI from this Jenkins master using Azure VM agents.