Skip to content

rahuljayaramjee-hub/azure-cloud-devops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

61 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“˜ azure cloud devops

project: deploy linux vm and host a website using azure

  • create resourse group
  • create ubuntu virtual machine
  • connect using ssh
  • install nginx
  • open port 80 in nsg
  • access the website using PUBLIC IP

πŸ’» commnad i run

  • ssh azureuser@PUBLIC_IP
  • sudo apt update
  • sudo apt install nginx -y
  • sudo systemctl status nginx
  • curl localhost :check_mark:

Screenshots


Azure Virtual Machine Overview

Azure VM

Network Security Rule (Port 80)

NSG Rule

:check_mark:


πŸ“˜ azure cloud devops

-today i have praactised manging azure resources using cli instead of azure portal the goal was to understand to deploy

☁️ topics i have covered

  • azure cli installation

  • azure cli login

  • creating resource groups

  • connecting a virtual machine

  • opening port 80 for web traffic

  • installing nginx

  • installing docker

    πŸ’» step 1 installing of azure cli

    i used command curl -sL https://aka.ms/InstallAzureCLIeb | sudo bash

    Azure CLI Install

    login to azure cli as login --use-device-code

    Azure Login

    created resource group az group create --name devops-rg --location centralindia

    Resource Group

    az vm create
    --resource-group devops-rg
    --name devops-vm
    --image Ubuntu2204
    --size Standard_B2as_v2
    --admin-username azureuser
    --generate-ssh-keys
    --location centralindia

    VM Overview

    open port 80

    az vm open-port
    --resource-group devops-rg
    --name devops-vm
    --port 80

Port 80

install of nginx

sudo apt update sudo apt install nginx -y sudo systemctl start nginx

NGINX Running

with the help of ip address we can browse and it willl show nginx is installed

:check_mark:


πŸ–₯️ docker basic level


Docker Basics for practsing


πŸ’» Commands learned:

  • docker run -d -p 8000:80 nginx
  • docker ps
  • docker ps -a
  • docker stop
  • docker start
  • docker rm
  • docker container prune
  • learn docker volume and networking

☁️ Concept learned and did hands on practise :

  • Docker container
  • Port mapping
  • Running Nginx in container

Example:

Host Port β†’ Container Port

8000:80

Access in browser:

http://localhost:8000

Docker Container Stop

Docker Stop

Docker Volume Example

Docker Volume

:check_mark:


πŸ“˜ same day i learn git and github baics


πŸ’» Commands learned:

git init git status git add git commit git log git remote add origin git branch -M main git push

Concept learned:

  • Local repository
  • Remote repository
  • Git commit history
  • Uploading project to GitHub

Git Push to GitHub

Git Push

Git Repository Setup

Git Repo :check_mark:


πŸ“˜ – Dockerfile and Custom Image


Objective

Learn how to build a custom Docker image using a Dockerfile and run a container.


Steps Performed

  1. Created a project directory
  2. Added a simple HTML webpage
  3. Wrote a Dockerfile using nginx base image
  4. Built a Docker image
  5. Ran a container using the image
  6. Accessed the application through the browser

πŸ’» Commands Used

docker build -t rahul-nginx . docker run -d -p 8080:80 rahul-nginx docker ps curl localhost:8080 :check_mark:


Curl Localhost Test

Result

Successfully created a custom nginx container serving a personal HTML page.


πŸ“˜ – learing python to automation and scripting

instaled python3 in the ubuntu terminal in virtual environment python3 -m venv myenv

python varaibles

what i learnt in the python variable

Variables

Variables store values.

name = "Rahul"
age = 40

print(f"My name is {name} and my age is {age}")

πŸ’» For Loop (for item in list)

Used to repeat an action for each item in a list.

servers = ["web1", "web2", "db1"]

for server in servers:
    print(f"Checking server {server}")

πŸ’» For Loop (for item in list) Used to repeat an action for each item in a list.

servers = ["web1", "web2", "db1"]

for server in servers: print(f"Checking server {server}")

python Example

πŸ’» Python Practice (Dictionaries & Loops)

Today I practiced Python dictionaries and loops, which are useful for handling server data in DevOps.

1. Dictionary Example

server = {"name": "web1", "ip": "10.0.0.1", "status": "running"}

print(server["name"])
print(server["ip"])

2. Loop Example

servers = ["web1", "web2", "db1"]

for s in servers:
    print("Checking server:", s)

3. Dictionary + Loop Together

servers = [
    {"name": "web1", "ip": "10.0.0.1"},
    {"name": "web2", "ip": "10.0.0.2"}
]

for server in servers:
    print(server["name"], server["ip"])

πŸ’» Python File Handling (for DevOps / Azure)

Why File Handling?

In DevOps we often read files like:

  • server lists
  • deployment logs

Python helps automate these tasks.

Example 1 – Writing to a File

file = open("servers.txt", "w")

file.write("web1\n")
file.write("web2\n")
file.write("db1\n")

file.close()

Explanation:

  • "w" β†’ write mode (creates file or overwrites)
  • \n β†’ new line
  • This creates a file called servers.txt

Output file:

web1
web2
db1

3. Appending to a File

Used to add new content without deleting existing data.

Example:

file = open("example.txt", "a")
file.write("\nNew line added")
file.close()

Mode: "a" β†’ append (adds content to the end)


Summary

r β†’ read file
w β†’ write file (overwrite)
a β†’ append to file


πŸ“˜ Git = track code changes

  • git init β†’ start repo
  • git clone β†’ copy repo
  • git status β†’ check changes
  • git add . β†’ stage files
  • git commit -m "msg" β†’ save
  • git push β†’ upload
  • git pull β†’ get latest

πŸ’» Practice

mkdir demo cd demo git init

echo "hello" > file.txt git add . git commit -m "first commit"

made an repo in my github and clering in the end of the day

Connect GitHub repo and run: git push

Flow: Code β†’ Add β†’ Commit β†’ Push


πŸ’» practising and breaking things down and fixing it

Mistakes I Faced

  • Forgot git add before commit

  • Wrong commit message

  • Tried running git without initializing repo

    its really important to use command before commit


    πŸ“‘ practising again the python codes for perfectiion

    VARIABLES

env_name = "prod"
cpu_readings = [55, 23, 87, 12, 67]

print("Environment:", env_name)

# SORTING
cpu_readings.sort()

print("Sorted CPU readings:", cpu_readings)

# LOOP
for value in cpu_readings:
    if value > 70:
        print("High:", value)
    else:
        print("OK:", value)

πŸ’» out-put of the python code

Environment: prod
Sorted CPU readings: [12, 23, 55, 67, 87]
OK: 12
OK: 23
OK: 55
OK: 67
High: 87

βœ”οΈ

practsing docker for perfection

Docker Day 1

Docker runs applications in containers with all dependencies. Images are blueprints, containers are running instances. Pulled nginx image and ran it using docker run. Used docker ps to check and docker stop to stop containers. Learned basic Docker workflow.

nano docker-notes.md

waht is docker ?

  • docker is an islolated container where we can build or run apps

  • docker is like a seprate room and isolated without your main computer

    Basic Commands

  • docker pull <image> - Download an image from Docker Hub

  • docker run -it ubuntu bash - Run and enter a container

  • docker ps -a - List all containers

  • docker rm $(docker ps -aq) - Delete all containers

  • docker rmi $(docker images -q) - Delete all images

    Building & Running Your Own App

  • docker build -t my-flask-app . - Build image from Dockerfile

  • docker run -p 5000:5000 my-flask-app - Run app on port 5000

  • with the help of chatgpt i pasted python code for learing purpose

  • what is a gpg keys its an software to verify wheather the application is legit or not

About

Azure Cloud and DevOps learning repository with hands-on practice in Linux, Python, Docker, and automation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors