- Putty
- Azure subscription
Azure provides a lot of VM templates which enables you to quickly create and configure a machine matching with your needs.
In this tuto, you are going to setup a VM with a Jenkins services hosted in a Docker container.
Time : 20 minutes
Prerequisites :
1. Connect to Azure management Portal (https://portal.azure.com)
2. Select Jenkins docker template and click on "Create" button
3. Fill in the configuration form. You can generate a SSH key with PuttyGen or any other tool or you can just type a password.
4. Select the machine type
5. You can configure advanced features if required, else, click OK
6. You're almost done, click ok. It will take a few minutes to Azure to provision the VM
7. Once the VM is created, you can retrieve its public IP. By default, a Jenkins server is configured to be accessed through ports 8080 and 22
8. Open a web browser and type the Jenkins url like http://12.123.12.123:8080
9. You should get this page
10. Now we should get the Administrator password. It is not the one you entered when creating the VM. It is another hosted in the VM file system.
11. Open Putty and initiate a connection to this machine
12. You will be prompted for your credentials. Enter the credentials configured when creating the machine.
13. You are now connected !
14. Let's find the admin password now ! Since you are on a Docker VM, you need to get root access to find the file.
15. Run this command and set a root password
sudo passwd root
16. Connect as root
su -
17. Now your prompt should look like that :
18. find / -name 'initialAdminPassword'
19. You should get the path of the initial admin password file
20. Open it with nano
21. You're done ! Go back to the Jenkins page on your Web browser and enter this code.
22. At this step, you should feel like a hacker! Install the suggested plugins
23. At the end of Jenkins config, create the admin user
24. Well done! Your Jenkins is ready!