Menu
  • Home
  • About Me
  • Blog
  • Github
  • LinkedIn

Install GitLab and Create a Project on Microsoft Azure

January 20, 2022June 30, 2022

VM Creation

DNS Name setting

Click the virtual machine that you just created earlier, select the Not Configured link next to the DNS name label.

GitLab CE Installation

Connect your VM and write the command:

sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates tzdata perl

sudo apt-get install -y postfix

# Select Internet Site and press enter. Use your server's external DNS for 'mail name' and press enter

# Add the GitLab package repository
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

sudo EXTERNAL_URL="https://gitlab-seanlim.westus3.cloudapp.azure.com" apt-get install gitlab-ce

Single Sign-on

  1. navigate to Azure Active Directory > App registrations > New Registration
  • Select New Registration o Name: GitLabCE
  • Supported Account Types: Accounts in this organizational directory only (the default)
  • Redirect URI Web – https:///users/auth/azure_oauth2/callback

2. Select Certificates & secrets on the left side menu and Add a New client secret

You need the following from the details of your new registration:

  1. Application (client) ID
  2. Directory (tenant) ID
  3. Client_secret

3. SSH into your GitLabCE VM and Open /etc/gitlab/gitlab.rb as root. follow like this:

# OAuth Config
gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['azure_oauth2']
gitlab_rails['omniauth_sync_email_from_provider'] = 'azure_oauth2'
gitlab_rails['omniauth_sync_profile_from_provider'] = ['azure_oauth2']
gitlab_rails['omniauth_sync_profile_attributes'] = ['name','email']
gitlab_rails['omniauth_block_auto_created_users'] = false
gitlab_rails['omniauth_auto_link_ldap_user'] = true
gitlab_rails['omniauth_external_providers'] = ['azure_oauth2']
gitlab_rails['omniauth_providers'] = [
 {
 "name" => "azure_oauth2",
 "args" => {
     "client_id" => "Client_ID",
     "client_secret" => "Client_Secret",
     "tenant_id" => "Tenant_ID",
     }
 }
]

Run the following command as root on the Gitlab server:

gitlab-ctl reconfigure

When you go to your GitLab application, it should now allow you to login with Oauth.

Login as root, you can see your password using this command:

sudo cat /etc/gitlab/initial_root_password

Create a group called Prototypes and set the visibility Internal. Then, click the setting button

Add users to group (Give owner privilege)

Sign Out and login to GitLab using Oauth. Then go to your group and select New project.

Create blank project -> Give a project name -> select Internal visibility -> Create project

Done!!

1 thought on “Install GitLab and Create a Project on Microsoft Azure”

  1. Djst org says:
    April 5, 2022 at 1:23 pm

    Wow that was odd. I just wrote an incredibly long comment but after I clicked submit my comment didn’t appear. Grrrr… well I’m not writing all that over again. Regardless, just wanted to say fantastic blog!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts
  • ChinguTalkBot v0.1.0: Setting up AWS Cognito with CDK for User Authentication
  • Phoenix & Elixir: Fix PostgreSQL connection refused
  • Demo: Git Log with Shell script to create a release notes
  • Metasploit
  • CyberSecurity Lab – Online Password Attack

Archives
  • March 2024
  • May 2023
  • April 2023
  • February 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
Categories
  • Amazon Interview (3)
  • Ansible (3)
  • AWS (9)
  • Azure (9)
  • Certification (2)
  • ChinguTalkBot Project (1)
  • cybersecurity (3)
  • Data analytics (6)
  • Demo Videos (6)
  • Docker (5)
  • Git (1)
  • GitLab (1)
  • Golang (3)
  • JavaScript (2)
  • Jenkins (4)
  • PowerShell (1)
  • Python (10)
  • Terraform (11)
  • Uncategorized (9)

©2025 | Powered by WordPress and Superb Themes!