├── .gitignore ├── Assignments ├── 01.WeeklyPracticeProblem#1-PreRequisites.md ├── 02.WeeklyPracticeProblem#2-Linux.md ├── 03.WeeklyPracticeProblem#3-Linux.md ├── 04.WeeklyPracticeProblem#4-Linux.md ├── 05.WeeklyPracticeProblem#5-Linux.md ├── 06.WeeklyPracticeProblem#6-az-cli.md ├── 07.WeeklyPracticeProblem-terraform1.md ├── 08.WeeklyPracticeProblem-terraform-remote-backend.md ├── 09.WeeklyPracticeProblem-terraformvariables.md ├── 10.WeeklyPracticeProblem-terraform-map-foreach.md ├── 11.WeeklyPracticeProblem-terraform-vm.md └── 12.WeeklyPracticeProblem-AzureClassicPipelines.md ├── ClassNotes ├── 01.Prerequisites-Class-21-01-2024 │ ├── diagrams.pdf │ └── notes.md ├── 02.Basic-3-Tier-Application-27-01-2024 │ ├── diagrams.pdf │ └── notes.md ├── 03.Linux-Basics-28-01-2024 │ ├── diagrams.pdf │ └── notes.md ├── 04.Linux-Basics-03-02-2024 │ ├── diagram.pdf │ └── notes.md ├── 05.Linux-Basics-04-02-2024 │ ├── diagram.pdf │ └── notes.md ├── 06.Linux-Basics-10-02-2024 │ ├── diagram.pdf │ └── notes.md ├── 07.Linux-Basics-11-02-2024 │ ├── diagram.pdf │ └── notes.md ├── 08.Linux-Basics-17-02-2024 │ ├── diagram.pdf │ └── notes.md ├── 09.Cloud-Basics-EntraId-Hierarchy-24-02-2024 │ ├── diagram.pdf │ └── notes.md ├── 10.AzureAD-25-02-2024 │ ├── diagram.pdf │ └── notes.md ├── 11.ImperativeVsDeclarative02-03-2024 │ ├── diagram.pdf │ └── notes.md ├── 12.AzureCLI-03-03-2024 │ ├── diagram.pdf │ └── notes.md ├── 13.TerraformwithVsCode-09-03-2024 │ ├── diagram.pdf │ └── notes.md ├── 14.Terraform-Basics-10-03-2024 │ ├── diagram.pdf │ ├── mera_pyara_rg.tf │ └── notes.md ├── 15.Terraform-State-16-03-2024 │ ├── diagram.pdf │ └── notes.md ├── 16.StorageAccountAndRemoteState-17-03-2024 │ ├── diagram.pdf │ └── notes.md ├── 17.TerraformDependency-23-03-2024 │ ├── diagram.pdf │ ├── explicit_dependency.tf │ ├── implicit_dependency.tf │ └── notes.md ├── 18.TerraformVariables-DeclareAssignUse-24-03-2024 │ ├── diagram.pdf │ └── notes.md ├── 19.TerraformList-ForEach-30-03-2024 │ ├── diagram.pdf │ └── notes.md ├── 20.TerraformMapForEach-31-03-2024 │ ├── diagram.pdf │ └── notes.md ├── 21.AzureFundamentals-06-04-2024 │ ├── diagram.pdf │ └── notes.md ├── 22.VM-07-04-2024 │ ├── diagram.pdf │ └── notes.md ├── 23.VM-ForEach+Map-13-04-2024 │ ├── data_sources.tf │ ├── diagram.pdf │ ├── main.tf │ ├── notes.md │ ├── outputs.tf │ ├── provider.tf │ ├── terraform.tfvars │ └── variables.tf ├── 24.ForEachDetailed-Database-Bastion-14-04-2024 │ ├── diagram.pdf │ └── notes.md ├── 25.Bastion-20-04-2024 │ └── diagram.pdf ├── 26.Modules-21-04-2024 │ └── diagram.pdf ├── 27.AzureLB-27-04-2024 │ ├── diagram.pdf │ └── notes.md ├── 28.AzureApplicationGateway28-04-2024 │ ├── diagram.pdf │ └── notes.md ├── 29.AzureFrontDoor04-05-2024 │ ├── diagram.pdf │ └── notes.md ├── 30.AzureS2SP2SPeering05-05-2024 │ ├── diagram.pdf │ └── notes.md ├── 31.TerraformDynamicBlocks11-05-2024 │ ├── notes.md │ └── sample_code.tf ├── 32.TerraformFunctionsAndDynamicBlocks12-05-2024 │ ├── notes.md │ ├── storage_account.tf │ └── terraform.tfvars ├── 33.GitBasics#1-18-05-2024 │ ├── diagram.pdf │ └── notes.md ├── 34.GitBasics#2-19-05-2024 │ ├── diagram.pdf │ └── notes.md ├── 35.GitBranchAndMerge-25-05-2024 │ ├── diagram.pdf │ └── notes.md ├── 36.GitOnServer-26-05-2024 │ ├── diagram.pdf │ └── notes.md ├── 37.ProdTFRepoStructure-01-06-2024 │ ├── diagram.pdf │ ├── environments │ │ ├── dev │ │ │ ├── main.tf │ │ │ ├── provider.tf │ │ │ └── terraform.tfvars │ │ ├── prod │ │ │ ├── main.tf │ │ │ ├── provider.tf │ │ │ └── terraform.tfvars │ │ └── qa │ │ │ ├── main.tf │ │ │ ├── provider.tf │ │ │ └── terraform.tfvars │ ├── modules │ │ ├── azurerm_rg │ │ │ └── main.tf │ │ ├── azurerm_vm │ │ │ └── .gitkeep │ │ └── azurerm_vnet │ │ │ └── main.tf │ └── notes.md ├── 38.AzureDevOpsBasics-02-06-2024 │ ├── diagram.pdf │ └── notes.md ├── 39.SelfHostedAgent-08-06-2024 │ ├── diagram.pdf │ └── notes.md ├── 40. AzurePipelines-15-06-2024 │ ├── diagram.pdf │ └── notes.md ├── 41.AzurePipelines-16-06-2024 │ ├── diagram.pdf │ ├── notes.md │ └── pipeline_snap.png ├── 42.AzurePipelines-22-06-2024 │ ├── diagram.pdf │ ├── notes.md │ └── pipeline_snap.png ├── 43.AzureClassicPipelines-23-06-2024 │ ├── diagram.pdf │ ├── image.png │ └── notes.md ├── 44.PipelineTriggers-29-06-2024 │ ├── diagram.pdf │ ├── image.png │ └── notes.md ├── 45.ManualApproval-tfsec-terrascan-30-06-2024 │ ├── diagram.pdf │ ├── image.png │ └── notes.md ├── 46.YAML-06-07-2024 │ ├── diagram.pdf │ └── notes.md ├── 47.YAMLPipelines-07-07-2024 │ ├── diagram.pdf │ └── notes.md ├── 48.PipelineWithJobs-13-07-2024 │ ├── azure-pipeline.yml │ ├── diagram.pdf │ ├── image.png │ └── notes.md ├── 49.CompleteRecap&PipelineWithStages-14-07-2024 │ ├── azure-pipeline.yml │ ├── diagram.pdf │ ├── image.png │ └── notes.md ├── 50.AzurePipelinesBestPracticies20-07-2024 │ ├── diagram.pdf │ ├── main.yaml │ └── pr.yml ├── 51.PracticeClass-21-07-2024 │ └── notes.md ├── 52.AzurePipelines-27-07-2024 │ └── diagram.pdf ├── 52.AzurePipelines-28-07-2024 │ └── diagram.pdf ├── 53.AzurePipelines-3-08-2024 │ └── diagram.pdf ├── 54.AzurePipelines-04-08-2024 │ └── diagram.pdf ├── 55.AzurePipelines-10-08-2024 │ └── diagram.pdf ├── 56.AzurePipelines-11-08-2024 │ ├── azure-pipeline.yml │ └── diagram.pdf ├── 57.SonarQube-31-08-2024 │ ├── diagram.pdf │ └── notes.md ├── 58.JavaApplication-01-09-2024 │ ├── diagram.pdf │ └── notes.md ├── 59.DockerTheory-07-09-2024 │ ├── diagram.pdf │ └── notes.md ├── 60.BasicsOfDocker-08-09-2024 │ ├── diagram.pdf │ └── notes.md ├── 61.DockerPortMapping-14-09-2024 │ ├── diagram.pdf │ └── notes.md ├── 62.DockerExec-15-09-2024 │ ├── diagram.pdf │ └── notes.md ├── 63.CustomImages&DockerFileBasics-21-09-2024 │ ├── diagram.pdf │ └── notes.md ├── 64.DockerFileWorking-22-09-2024 │ ├── diagram.pdf │ └── notes.md ├── 65.TodoAppOnDockerandMySQL&MultiStageDockerFile-28-09-2024 │ ├── Dockerfile-Python │ ├── Dockerfile-React │ ├── diagram.pdf │ └── notes.md ├── 66.TodoContinued-29-09-2024 │ ├── diagram.pdf │ └── notes.md ├── 67.DockerNetworkandVolume-05-10-2024 │ ├── diagram.pdf │ └── notes.md ├── 68.KubernetesIntro&Architecture-06-10-2024 │ ├── diagram.pdf │ └── notes.md ├── 69.AzureKubernetesCluster-12-10-2024 │ ├── diagram.pdf │ └── notes.md ├── 70.K8sPod-13-10-2024 │ ├── diagram.pdf │ └── notes.md ├── 71.Container2ContainerCommunicationK8sPod-19-10-2024 │ ├── diagram.pdf │ └── notes.md ├── 72.Pod2PodCommunication-NetworkPolicy-20-10-2024 │ ├── diagram.pdf │ └── notes.md ├── 73.K8SNetworking-26-10-2024 │ ├── diagram.pdf │ └── notes.md ├── 74.PersistentVolumesAndClaims-27-10-2024 │ ├── diagram.pdf │ └── notes.md ├── 75.StorageClasses-02-11-2024 │ ├── diagram.pdf │ └── notes.md ├── 76.RequestLimits-Affinity-NodeSelector-03-11-2024 │ ├── diagram.pdf │ └── notes.md ├── 77.ReplicaSets-09-11-2024 │ └── diagram.pdf ├── 78.Deployments-10-11-2024 │ └── diagram.pdf ├── 79.Services-16-11-2024 │ └── diagram.pdf ├── 80.Nginx-AppRouting-Ingress-Controllers-17-11-2024 │ └── diagram.pdf ├── 81.ApplicationGatewayIngressController-23-11-2024 │ └── diagram.pdf ├── 82.Ollama-OpenWebUI-DoubtClass │ └── diagram.pdf ├── 83.MajorProject-24-11-2024 │ └── diagram.pdf ├── 84.MajorProject#2-08-01-2025 │ └── diagram.pdf ├── 85.MajorProject#3-15-01-2025 │ └── diagram.pdf ├── 86.SonarQubeConfig-22-01-2025 │ └── diagram.pdf ├── 87.Helm#1-29-01-2025 │ └── diagram.pdf └── 88.ArgoCD-05-02-2025 │ └── diagram.pdf ├── CodeSamples ├── Docker │ ├── Class1 │ │ ├── Dockerfile │ │ └── index.html │ ├── Class2 │ │ └── Photos │ │ │ ├── Dockerfile │ │ │ ├── pexels-danielpool-27913669.jpg │ │ │ └── pexels-huy-nguy-n-1640325753-27958425.jpg │ └── Class4 │ │ ├── index.html │ │ └── script.sh ├── Kubernetes │ ├── AzureContainerRegistry │ │ ├── Dockerfile │ │ └── index.html │ ├── Ingress │ │ ├── ing.txt │ │ ├── netflix-deployment.yaml │ │ ├── netflix-ingress.yaml │ │ ├── netflix-service.yaml │ │ ├── nginx-deployment.yaml │ │ ├── nginx-ingress.yaml │ │ ├── nginx-service.yaml │ │ ├── pod.yaml │ │ ├── todoui-deployment.yaml │ │ ├── todoui-ingress.yaml │ │ └── todoui-service.yaml │ ├── PersonalChatGPT │ │ ├── backend-deploy.yaml │ │ ├── backend-service.yaml │ │ ├── deploy.txt │ │ ├── ui-deploy.yaml │ │ └── ui-service.yaml │ ├── class1 │ │ ├── dpod-multi-container.yaml │ │ └── pod_document.txt │ ├── networkpolicy │ │ ├── anurag-nginx-pod.yaml │ │ ├── firefox-pod.yaml │ │ ├── firefoxpod1.yaml │ │ ├── namespace.yaml │ │ ├── networkpolicy.yaml │ │ ├── nginx-pod.yaml │ │ ├── np.txt │ │ ├── ns.txt │ │ └── pod.txt │ ├── persistantVolume │ │ ├── pod.txt │ │ ├── pod.yaml │ │ ├── pv.txt │ │ ├── pv.yaml │ │ ├── pvc.txt │ │ ├── pvc.yml │ │ └── secretcommand.txt │ ├── replicasetsAndDeployments │ │ ├── deploy.txt │ │ ├── deployment.yaml │ │ ├── pod.yaml │ │ ├── replica_set.yaml │ │ └── rs.txt │ ├── requestLimits │ │ ├── pod.txt │ │ └── pod.yaml │ ├── services │ │ ├── pod.yaml │ │ ├── s.txt │ │ └── service.yaml │ ├── storageClasses │ │ ├── pvc.yaml │ │ ├── pvc1.yml │ │ ├── sachinClass.yml │ │ ├── sachinPvc.yml │ │ ├── sc.txt │ │ └── storageClass.yaml │ └── volumes │ │ └── nginx-pod.yaml ├── Project │ ├── helm │ │ ├── deployment.yaml │ │ ├── dev-input.yaml │ │ ├── infra.ps1 │ │ └── qa-input.yaml │ └── terraform │ │ ├── dev.terraform.tfvars │ │ ├── main.tf │ │ └── qa-terraform.tfvars ├── Terraform │ ├── VnetSubnetDynamicBlock │ │ ├── main.tf │ │ ├── provider.tf │ │ ├── terraform.tfvars │ │ └── variable.tf │ ├── key_vault │ │ ├── .terraform.lock.hcl │ │ ├── main.tf │ │ ├── provider.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── list_resource_group │ │ ├── main.tf │ │ ├── provider.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── map_resource_group │ │ ├── complex_map.tf │ │ ├── provider.tf │ │ ├── simple_map.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── resource_group_assignment2803 │ │ ├── main.tf │ │ ├── provider.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── storage_account │ │ ├── provider.tf │ │ └── storage.tf │ ├── subnet │ │ ├── main.tf │ │ ├── provider.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── virtual_machine │ │ ├── data_sources.tf │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── provider.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ ├── virtual_network │ │ ├── main.tf │ │ ├── provider.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ └── vm │ │ └── main.tf ├── index.html ├── moreComingSoon.md └── moreComingSoon1.md ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Local .terraform directories 2 | **/.terraform/* 3 | 4 | # .tfstate files 5 | *.tfstate 6 | *.tfstate.* 7 | 8 | # Crash log files 9 | crash.log 10 | crash.*.log 11 | 12 | # Exclude all .tfvars files, which are likely to contain sensitive data, such as 13 | # password, private keys, and other secrets. These should not be part of version 14 | # control as they are data points which are potentially sensitive and subject 15 | # to change depending on the environment. 16 | # *.tfvars 17 | *.tfvars.json 18 | 19 | # Ignore override files as they are usually used to override resources locally and so 20 | # are not checked in 21 | override.tf 22 | override.tf.json 23 | *_override.tf 24 | *_override.tf.json 25 | 26 | # Include override files you do wish to add to version control using negated pattern 27 | # !example_override.tf 28 | 29 | # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan 30 | # example: *tfplan* 31 | 32 | # Ignore CLI configuration files 33 | .terraformrc 34 | terraform.rc 35 | -------------------------------------------------------------------------------- /Assignments/01.WeeklyPracticeProblem#1-PreRequisites.md: -------------------------------------------------------------------------------- 1 | # Assignment: Draw.io and Visual Studio Code 2 | 3 | ## Objective 4 | 5 | The objective of this assignment is to set up Draw.io, a powerful diagramming tool, and Visual Studio Code (VS Code), a versatile source code editor. Additionally, you will practice creating a simple flowchart in Draw.io and verify the successful installation of Visual Studio Code. 6 | 7 | ## Tasks 8 | 9 | ### Task 1: Open Draw.io in Google Chrome 🌐 10 | 11 | 1. **Google Chrome Installation (if not installed):** 12 | - Download and install Google Chrome from the official [Google Chrome website](https://www.google.com/chrome/). 13 | 14 | 2. **Open Draw.io in Google Chrome:** 15 | - Launch Google Chrome. 16 | - Visit the [Draw.io website](https://www.draw.io/). 17 | - Confirm that Draw.io opens correctly in Google Chrome. 18 | 19 | ### Task 2: Visual Studio Code Installation 💻 20 | 21 | 1. **Visual Studio Code Installation:** 22 | - Visit the official [Visual Studio Code website](https://code.visualstudio.com/). 23 | - Locate the download button and choose the installer for your operating system (Windows, macOS, Linux). 24 | - Run the downloaded installer. 25 | - Follow the on-screen instructions to complete the installation process. 26 | - During installation, consider selecting the option to add VS Code to the system PATH for easier command-line access. 27 | 28 | 2. **Verify Visual Studio Code Installation:** 29 | - Open Visual Studio Code. 30 | - Create a new file or open an existing one to ensure that the editor is working as expected. -------------------------------------------------------------------------------- /Assignments/02.WeeklyPracticeProblem#2-Linux.md: -------------------------------------------------------------------------------- 1 | # Assignment 1: Three-Tier Diagram 2 | 3 | ## Objective: 4 | Create a three-tier diagram representing the architecture discussed in class using [draw.io](https://app.diagrams.net/). 5 | 6 | ## Instructions: 7 | 1. Access [draw.io](https://app.diagrams.net/) and create a new diagram. 8 | 2. Design a three-tier architecture diagram based on the concepts discussed in class. 9 | 3. Clearly label each tier (presentation, application, and data layers) and include relevant components. 10 | 4. Save the diagram in an image format (PNG, JPEG, or any other common image format). 11 | 12 | --- 13 | 14 | # Assignment 2: Linux Commands Practice 15 | 16 | ## Objective: 17 | Practice essential Linux commands on the [JSLinux](https://bellard.org/jslinux/) platform, specifically using Fedora 33 in the Console. 18 | 19 | ## Instructions: 20 | 1. Access the [JSLinux](https://bellard.org/jslinux/) website and select the Fedora 33 (Linux) Console option. 21 | 2. Execute the following commands and carefully observe their output: 22 | - `whoami`: Display the current username. 23 | - `pwd`: Print the current working directory. 24 | - `cd`: Change the directory (try navigating to different directories). 25 | - `ls`: List the files and directories in the current location. 26 | 3. Make detailed notes regarding the purpose and output of each command. 27 | 4. Write a short summary explaining the functionality of each command and any observations or challenges faced during the practice. 28 | 5. Save your notes and submit them along with your summary during the next class. 29 | 30 | --- 31 | 32 | **Note:** Ensure that you follow the instructions carefully, and if you encounter any difficulties, feel free to seek assistance during the next doubt class or through the designated communication channels. -------------------------------------------------------------------------------- /Assignments/03.WeeklyPracticeProblem#3-Linux.md: -------------------------------------------------------------------------------- 1 | 2 | ## Linux Assignment 1 3 | 4 | 1. Go to this link for Linux terminal: [JS Linux](https://bellard.org/jslinux/) 5 | 2. Use the `whoami` command to display the current user. 6 | 3. Use the `pwd` command to display the present working directory. 7 | 4. Use the `date` command to display the current date and time. 8 | 5. Go to the /home directory and use the `pwd` command to verify the current directory. 9 | 6. Create a new directory called "linux_gyan" in your home directory (/home). 10 | 7. Go to the "linux_gyan" directory. 11 | 8. Create two new directories, "gyan1" and "gyan2," in the "linux_gyan" directory, like /home/linux_gyan/gyan1 and /home/linux_gyan/gyan2. 12 | 9. Use the `ls` command to list the contents of the "linux_gyan" directory. 13 | 10. Create a new file called "file1.txt" in the "linux_gyan" directory. 14 | 11. Edit "file1.txt" using the `nano` command and add the string "Hello World!". 15 | 12. Use the `cp` command to create copies of "file1.txt" named "file2.txt" and "file3.txt". 16 | 13. Use the `cat` command to view the contents of "file1.txt", "file2.txt", and "file3.txt". 17 | 14. Move "file2.txt" to the "gyan1" directory. 18 | 15. Move "file3.txt" to the "gyan2" directory. 19 | 16. List the contents of "gyan1" and "gyan2" using the `ls` command. 20 | 17. Remove "file1.txt", "gyan1", and "gyan2" using appropriate commands. 21 | 22 | ## Linux Assignment 2 23 | 24 | 1. Check the number of CPUs. 25 | 2. Check the RAM in the system. 26 | 3. Check the disk size. 27 | 4. Check Operating System details. 28 | 5. Check the IP address of the system. 29 | 6. Check the uptime of the system. 30 | 7. Check which processes are currently running. 31 | 8. Terminate any one process. 32 | 9. Check the size of the /var directory. 33 | 10. Check the date and time of the system. 34 | -------------------------------------------------------------------------------- /Assignments/04.WeeklyPracticeProblem#4-Linux.md: -------------------------------------------------------------------------------- 1 | ## Assignment1 2 | 3 | **Instructions:** 4 | 1. Access the terminal emulator by visiting the following link: [JS Linux Terminal Emulator](https://bellard.org/jslinux/). 5 | 2. Create two folders in the `/home` directory: `John` and `Emma`. 6 | 3. In the `John` folder, create a file called `invitation.txt` and write "You are invited by John." 7 | 4. In the `Emma` folder, create a file called `invitation.txt` and write "You are invited by Emma." 8 | 5. Create two folders in the `/tmp` directory: `David` and `Ella`. 9 | 6. Go to the `David` folder: 10 | - Display the content of the `invitation.txt` file you have created in the `Emma` folder using an absolute path. 11 | - Display the content of the `invitation.txt` file you have created in the `Emma` folder using a relative path. 12 | 7. Go to the `Ella` folder: 13 | - Display the content of the `invitation.txt` file you have created in the `John` folder using an absolute path. 14 | - Display the content of the `invitation.txt` file you have created in the `John` folder using a relative path. 15 | 8. Delete the `invitation.txt` files created in both the `John` and `Emma` folders. 16 | 17 | ## Assignment2 18 | 19 | **Instructions:** 20 | 1. Create a file called `file.txt`. 21 | 2. Add the text "Hello World" to the `file.txt` using the `echo` command. 22 | 3. Set permissions on `file.txt` to `rwxrwxrwx` using the `chmod` command. 23 | 4. Add a new user named `john` using the `useradd` command. 24 | 5. Switch user to `john` using the `su - john` command. 25 | 6. Attempt to view the contents of the `file.txt` using the `cat` command and try to add the text "I am user john" using the `echo` command. 26 | 7. Exit from the `john` user. 27 | 8. Change permissions on `file.txt` to `rwxrwxr--`. 28 | 9. Switch back to the `john` user. 29 | 10. Try to view the contents of `file.txt` using the `cat` command and then try to add the text "Hello". 30 | 11. If permission denied, consider the assignment completed. 31 | 32 | -------------------------------------------------------------------------------- /Assignments/05.WeeklyPracticeProblem#5-Linux.md: -------------------------------------------------------------------------------- 1 | # Assignment: Setting Up Nginx and Deploying Netflix Clone 2 | 3 | ## Introduction 4 | In this assignment, you will set up Nginx on an Ubuntu environment using the Killer Code Playground. You will then deploy a Netflix clone application and verify its functionality. 5 | 6 | ## Steps 7 | 8 | 1. **Access Killer Code Playground** 9 | - Go to [Killer Code Playground](https://killercoda.com/playgrounds). 10 | - Select Ubuntu as the operating system. 11 | 12 | 2. **Check Ubuntu OS Version** 13 | 14 | 15 | 3. **Update Package Lists and Install Nginx** 16 | 17 | 4. **Manage Nginx Service using systemctl** 18 | - Stop Nginx service: 19 | - Start Nginx service: 20 | - Check status of Nginx service: 21 | 22 | 5. **Configure Traffic Port on Killer Code Playground** 23 | - Click on the menu in the upper-left corner. 24 | - Select "Traffic Port." 25 | - Choose port 80. 26 | 27 | 6. **Verify Nginx Installation** 28 | - Check if the Nginx welcome page is displayed. 29 | 30 | 7. **Clean /var/www/html Directory** 31 | - Delete any existing files in the directory: 32 | 33 | 8. **Clone Netflix Clone Repository** 34 | - Navigate to the home directory: 35 | ```bash 36 | cd /home/ubuntu 37 | ``` 38 | - Clone the repository: 39 | ```bash 40 | git clone -b build https://github.com/Anshuman2121/netflix-clone.git 41 | ``` 42 | 43 | 9. **Deploy Netflix Clone** 44 | - Navigate to the Netflix Clone directory: 45 | ```bash 46 | cd netflix-clone 47 | ``` 48 | - Copy all files to `/var/www/html`: 49 | ```bash 50 | cp -r * /var/www/html/ 51 | ``` 52 | 53 | 10. **Verify Netflix Clone Deployment** 54 | - Verify if the Netflix Clone application is running successfully. 55 | 56 | 57 | 11. **Verify Nginx Logs /var/log/nginx/** 58 | - View the beginning of the log file: 59 | - View the end of the log file: 60 | - View the log file with less command: 61 | 62 | 12. **Verify Live Nginx Logs** 63 | - View live logs using tail -f: 64 | 65 | -------------------------------------------------------------------------------- /Assignments/06.WeeklyPracticeProblem#6-az-cli.md: -------------------------------------------------------------------------------- 1 | # Assignment: Hands-On Exercise with Azure Resource Management 2 | 3 | ## Objective: 4 | 🎯 The objective of this assignment is to familiarize students with managing Azure resources using both manual methods and Azure Command-Line Interface (CLI). By completing this assignment, students will gain practical experience in creating, listing, and deleting resource groups and storage accounts in Azure. 5 | 6 | ## Instructions: 7 | 8 | 1. **Create a Resource Group (RG) using Manual Method and Azure CLI:** 9 | - Manually create a resource group named "ManualRG" through the Azure Portal. 10 | - Use Azure CLI to create another resource group named "CLIResourceGroup" with the location of your choice. 11 | 12 | 2. **List all Resource Groups using Manual Method and Azure CLI:** 13 | - Navigate through the Azure Portal to locate and list all available resource groups. 14 | - Use Azure CLI to list all existing resource groups. 15 | 16 | 3. **Delete the Created Resource Group using Manual Method and Azure CLI:** 17 | - Delete the "ManualRG" resource group manually through the Azure Portal. 18 | - Use Azure CLI to delete the "CLIResourceGroup" created earlier. 19 | 20 | 4. **Create a New Resource Group and Storage Account in that RG using Manual Method and Azure CLI:** 21 | - Manually create a new resource group named "StorageRG" through the Azure Portal. 22 | - Inside "StorageRG", manually create a new storage account named "ManualStorageAccount". 23 | - Use Azure CLI to create a new resource group named "CLIStorageRG" and within it, create a storage account named "CLIStorageAccount". 24 | 25 | 5. **Delete the Storage Account using Manual Method and Azure CLI:** 26 | - Delete the "ManualStorageAccount" manually through the Azure Portal. 27 | - Use Azure CLI to delete the "CLIStorageAccount" created earlier. 28 | 29 | ## Submission Guidelines: 30 | - Document all the steps performed along with screenshots where necessary. 31 | - Clearly label each step and provide explanations as needed. 32 | - Submit the assignment document in a format specified by the instructor. 33 | 34 | ## Note: 35 | - Ensure to follow Azure's naming conventions and guidelines while creating resources. 36 | - Double-check before deleting any resources to avoid unintended data loss. 37 | - If encountering any issues or errors, refer to Azure documentation or seek assistance from the instructor. 38 | -------------------------------------------------------------------------------- /Assignments/07.WeeklyPracticeProblem-terraform1.md: -------------------------------------------------------------------------------- 1 | ### 🚀 Terraform and Azure Adventure Assignment 🌍 2 | 3 | #### Part 1: 🎨 Manually Create a Resource Group (RG) in Azure Portal 4 | 5 | 1. Sign in to the Azure portal. 6 | 2. In the left-hand navigation pane, select "Resource groups." 7 | 3. Click on the "➕ Add" button to create a new resource group. 8 | 4. Enter a name for the resource group and select a region. 9 | 5. Click on the "Review + create" button, review the details, and click on "Create" to create the resource group. 10 | 6. Take note of the arguments required for creating the resource group, such as name and location. 11 | 12 | #### Part 2: 🛠️ Create a Resource Group Using Terraform 13 | 14 | 1. Open a terminal or command prompt. 15 | 2. Create a new folder and open it in VSCode or any other editor. 16 | 3. Create a new `.tf` file with any name. 17 | 4. Search for "terraform azure resource group" on Google to find the Terraform Registry link for `azurerm_resource_group`. Open that link. 18 | 5. Copy the provider code from the page and paste it into the `.tf` file. 19 | 6. Copy the example code for the resource group from the Terraform Registry page and paste it into the `.tf` file. 20 | 7. Run the following Terraform commands and observe the output for each command: 21 | - `terraform init`: Initialize the Terraform configuration. 22 | - `terraform validate`: Validate the Terraform configuration. 23 | - `terraform fmt`: Format the Terraform configuration. 24 | - `terraform plan`: Generate and show an execution plan. 25 | - `terraform apply`: Apply the Terraform configuration to create the resource group in Azure. 26 | 8. Add two more resource group blocks in the `.tf` file, each with a different name and location. 27 | 9. Run `terraform plan` and `terraform apply` again to see how Terraform creates the two new resource groups. 28 | 10. Remove one resource group block from the `.tf` file. 29 | 11. Run `terraform plan` and `terraform apply` again to see how Terraform removes that resource group from Azure after applying the changes. -------------------------------------------------------------------------------- /Assignments/09.WeeklyPracticeProblem-terraformvariables.md: -------------------------------------------------------------------------------- 1 | # Terraform Variables Assignment 2 | 3 | ## Objective: 4 | The objective of this assignment is to understand the concept of variables in Terraform, their declaration, assignment, and usage, as well as various methods of passing variable values. 5 | 6 | ## Instructions: 7 | 1. Define a Terraform configuration for creating an Azure resource group with the following specifications: 8 | - Use variables to define the resource group name and location. 9 | - Use a variable for the resource group name with a default value. 10 | - Use a variable for the location with a default value of "West Europe". 11 | 12 | 2. Create the resource group using the variables defined in step 1. 13 | 14 | 3. Use the following methods to pass variable values: 15 | - Pass variable values directly through the CLI using the `-var` flag. 16 | - Use `.tfvars` files to pass variable values. 17 | - Utilize the `terraform.tfvars` file to automatically load variable values. 18 | 19 | 4. Verify the resource group creation by running `terraform plan` and `terraform apply`. 20 | 21 | ## Submission: 22 | Submit the Terraform configuration files (`main.tf`, `variables.tf`, `terraform.tfvars`, and any `.tfvars` files used) along with a screenshot of the output after running `terraform apply`. 23 | 24 | ## Note: 25 | Ensure that your Terraform configuration is organized and follows best practices for readability and maintainability. -------------------------------------------------------------------------------- /Assignments/11.WeeklyPracticeProblem-terraform-vm.md: -------------------------------------------------------------------------------- 1 | # Assignment 3: Creating Azure Linux Virtual Machines using Portal and using Terraform 2 | 3 | ## Objective: 4 | - Create a Linux VM first using Azure portal 5 | - Create a Terraform configuration that defines an Azure Linux Virtual Machine with specific configurations. 6 | 7 | ## Instructions: 8 | 1. Define a Terraform configuration that creates an Azure Linux Virtual Machine. 9 | 2. Specify the following configurations for the virtual machine: 10 | - **Name**: frontend-machine 11 | - **Resource Group**: babitajee-rg 12 | - **Location**: Central India 13 | - **Size**: Standard_DS2_v2 14 | - **Operating System**: Ubuntu Server 20.04 LTS 15 | - **Disk Type**: Standard HDD 16 | - **RAM**: 4 GB 17 | - **Admin Username**: Your choice 18 | - **Admin Password**: Your choice (Note: Avoid using sensitive passwords for educational purposes) 19 | 3. Ensure that the virtual machine is provisioned with the appropriate network interface, public IP address, and OS disk. 20 | 4. Provide a modular and readable Terraform configuration following best practices. 21 | 22 | ## Example Code: 23 | main.tf 24 | ```hcl 25 | resource "azurerm_public_ip" "pip" { 26 | name = "frontend-pip" 27 | resource_group_name = "babitajee-rg" 28 | location = "Central India" 29 | allocation_method = "Static" 30 | sku = "Standard" 31 | } 32 | 33 | resource "azurerm_network_interface" "nic" { 34 | name = "frontend-nic" 35 | location = "Central India" 36 | resource_group_name = "babitajee-rg" 37 | 38 | ip_configuration { 39 | name = "internal" 40 | subnet_id = "/subscriptions/dfc51e53-38c1-4d27-813f-b0ee11f6a7c4/resourceGroups/babitajee-rg/providers/Microsoft.Network/virtualNetworks/billorani/subnets/frontend" 41 | private_ip_address_allocation = "Dynamic" 42 | public_ip_address_id = azurerm_public_ip.pip.id 43 | } 44 | } 45 | 46 | resource "azurerm_linux_virtual_machine" "frontendvm" { 47 | name = "frontend-machine" 48 | resource_group_name = "babitajee-rg" 49 | location = "Central India" 50 | size = "Standard_DS2_v2" 51 | admin_username = "devopsinsiders" 52 | admin_password = "3@O!-LAc2j:6" # Avoid using sensitive passwords for production 53 | disable_password_authentication = false 54 | 55 | network_interface_ids = [ 56 | azurerm_network_interface.nic.id, 57 | ] 58 | 59 | os_disk { 60 | caching = "ReadWrite" 61 | storage_account_type = "Standard_LRS" 62 | disk_size_gb = "30" 63 | name = "frontend-disk" 64 | } 65 | 66 | source_image_reference { 67 | publisher = "Canonical" 68 | offer = "UbuntuServer" 69 | sku = "20.04-LTS" 70 | version = "latest" 71 | } 72 | } 73 | ``` 74 | 75 | ## Submission: 76 | - Students should submit the Terraform configuration files (`main.tf`, `variables.tf`, if applicable, and any other necessary files) along with a brief explanation of how each resource was configured to create the Azure Linux Virtual Machine. 77 | 78 | ## Note: 79 | - Students are encouraged to explore additional configurations for the virtual machine, such as networking settings, custom scripts, extensions, and monitoring options, to enhance their learning experience. -------------------------------------------------------------------------------- /ClassNotes/01.Prerequisites-Class-21-01-2024/diagrams.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/01.Prerequisites-Class-21-01-2024/diagrams.pdf -------------------------------------------------------------------------------- /ClassNotes/01.Prerequisites-Class-21-01-2024/notes.md: -------------------------------------------------------------------------------- 1 | # Class Summary: Prerequisite Installation 🛠️ 2 | 3 | ## Overview 4 | 5 | This session focuses on setting up the essential tools required for the upcoming course. We installed two key applications: Draw.io, a powerful diagramming tool, and Visual Studio Code (VS Code), a versatile source code editor. 6 | 7 | ## Installation of Draw.io 8 | 9 | ### 1. Download the Installer 10 | 11 | - Visit the official [Draw.io website](https://www.draw.io/). 12 | - Navigate to the "Download" section. 13 | - Choose the appropriate installer for your operating system (Windows, macOS, Linux). 14 | 15 | ### 2. Install Draw.io 16 | 17 | - Run the downloaded installer. 18 | - Follow the on-screen instructions to complete the installation process. 19 | - Launch Draw.io once the installation is complete to ensure a successful setup. 20 | 21 | ### 3. Verify Installation 22 | 23 | - Create a new diagram or open a sample file to confirm that Draw.io is functioning correctly. 24 | 25 | ## Installation of Visual Studio Code (VS Code) 26 | 27 | ### 1. Download VS Code 28 | 29 | - Visit the official [Visual Studio Code website](https://code.visualstudio.com/). 30 | - Locate the download button and choose the installer for your operating system (Windows, macOS, Linux). 31 | 32 | ### 2. Install VS Code 33 | 34 | - Run the installer and proceed with the installation by following the prompts. 35 | - During the installation, you may have the option to add VS Code to the system PATH—consider selecting this option for easier command-line access. 36 | 37 | ### 3. Extensions for Development (Optional) 38 | 39 | - Explore the Extensions Marketplace within VS Code. 40 | - Install extensions relevant to your development needs, such as language support, code snippets, and version control integrations. 41 | 42 | ### 4. Verify Installation 43 | 44 | - Open Visual Studio Code. 45 | - Create a new file or open an existing one to ensure that the editor is working as expected. 46 | 47 | ## Conclusion 48 | 49 | By completing these installation steps, you've ensured that Draw.io and Visual Studio Code are properly set up on your system. These tools will play a crucial role in our upcoming sessions, providing a seamless environment for both diagram creation and coding tasks. 50 | 51 | Feel free to reach out if you encounter any issues or have questions related to the installation process. We look forward to diving into the core content of the course in the next session! 🚀 -------------------------------------------------------------------------------- /ClassNotes/02.Basic-3-Tier-Application-27-01-2024/diagrams.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/02.Basic-3-Tier-Application-27-01-2024/diagrams.pdf -------------------------------------------------------------------------------- /ClassNotes/02.Basic-3-Tier-Application-27-01-2024/notes.md: -------------------------------------------------------------------------------- 1 | # 📚 Class Summary: Unraveling Modern Applications 2 | 3 | ## 🚀 Introduction 4 | Our journey commenced with an in-depth exploration of modern applications, using LinkedIn as a case study. We dissected the intricate roles of frontend developers, backend developers, and database administrators in crafting these applications. 5 | 6 | ## 🖥️ Deployment and Servers 7 | Venturing further, we delved into the deployment of frontend, backend, and database components onto servers—essentially the backbone of application hosting. We discovered the pivotal role of operating systems (OS) in this process, focusing on Windows, Linux, and macOS as the primary environments for these servers. 8 | 9 | ## 📂 File Operations in Windows 10 | Recently, we navigated through the landscape of file operations within the Windows OS. This included an exploration of file management commands and techniques tailored to the Windows environment. 11 | 12 | ## 🐧 Upcoming: File Operations in Linux 13 | Our next milestone will be an immersive dive into file operations within the Linux OS. We'll uncover the power of Linux command-line interfaces, mastering the art of manipulating files and directories. 14 | 15 | ## 📚 Looking Ahead 16 | The journey has just begun! As we continue, we'll uncover more layers of application development, server management, and OS intricacies. Stay tuned for an exciting exploration of Linux file operations in our next class! 🌟 17 | -------------------------------------------------------------------------------- /ClassNotes/03.Linux-Basics-28-01-2024/diagrams.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/03.Linux-Basics-28-01-2024/diagrams.pdf -------------------------------------------------------------------------------- /ClassNotes/03.Linux-Basics-28-01-2024/notes.md: -------------------------------------------------------------------------------- 1 | **Notes on Operating System (OS) and Kernel:** 2 | 3 | 1. **Operating System (OS):** 4 | - *Definition:* The operating system (OS) is a software that manages computer hardware and provides services for computer programs. 5 | - *Function:* It acts as an intermediary between users and the computer hardware, ensuring smooth communication and coordination. 6 | 7 | 2. **Kernel in OS:** 8 | - *Definition:* The kernel is the core component of an operating system. It manages system resources, such as memory and CPU, and facilitates communication between hardware and software. 9 | - *Function:* It plays a crucial role in maintaining the integrity and stability of the operating system. 10 | 11 | 3. **Common Commands in Terminal with Examples:** 12 | - **whoami:** 13 | - *Purpose:* Displays the username associated with the current user. 14 | - *Example:* `whoami` 15 | - *Output:* `john_doe` 16 | 17 | - **pwd:** 18 | - *Purpose:* Shows the present working directory (current location in the file system). 19 | - *Example:* `pwd` 20 | - *Output:* `/home/john_doe/documents` 21 | 22 | - **cd:** 23 | - *Purpose:* Changes the current directory. 24 | - *Example:* `cd documents` 25 | - *Output:* (No output if successful) 26 | 27 | - **ls:** 28 | - *Purpose:* Lists files and directories in the current directory. 29 | - *Example:* `ls` 30 | - *Output:* 31 | ``` 32 | file1.txt 33 | folder1 34 | file2.txt 35 | ``` 36 | 37 | - **mkdir:** 38 | - *Purpose:* Creates a new directory. 39 | - *Example:* `mkdir new_folder` 40 | - *Output:* (No output if successful) -------------------------------------------------------------------------------- /ClassNotes/04.Linux-Basics-03-02-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/04.Linux-Basics-03-02-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/04.Linux-Basics-03-02-2024/notes.md: -------------------------------------------------------------------------------- 1 | **Additional Notes on Terminal Commands:** 2 | 3 | 4. **touch:** 4 | - *Purpose:* Creates an empty file. 5 | - *Example:* `touch new_file.txt` 6 | - *Output:* (No output if successful) 7 | 8 | 5. **nano:** 9 | - *Purpose:* Opens a text editor for creating or editing files. 10 | - *Example:* `nano textfile.txt` 11 | - *Output:* (Opens the nano text editor for file editing) 12 | 13 | 6. **cat:** 14 | - *Purpose:* Concatenates and displays the content of files. 15 | - *Example:* `cat file1.txt` 16 | - *Output:* (Displays the content of file1.txt) 17 | 18 | 7. **cp:** 19 | - *Purpose:* Copies files or directories from one location to another. 20 | - *Example:* `cp file1.txt /backup` 21 | - *Output:* (No output if successful) 22 | 23 | 8. **mv:** 24 | - *Purpose:* Moves or renames files or directories. 25 | - *Example:* `mv old_file.txt new_location/` 26 | - *Output:* (No output if successful) 27 | 28 | 9. **rm:** 29 | - *Purpose:* Removes (deletes) files. 30 | - *Example:* `rm unwanted_file.txt` 31 | - *Output:* (No output if successful) 32 | 33 | 10. **rm -r:** 34 | - *Purpose:* Removes directories and their contents recursively. 35 | - *Example:* `rm -r old_directory/` 36 | - *Output:* (No output if successful) 37 | 38 | 11. **grep:** 39 | - *Purpose:* Searches for a pattern in a file. 40 | - *Example:* `grep "keyword" file.txt` 41 | - *Output:* (Displays lines containing the specified keyword) 42 | 43 | 12. **grep -i:** 44 | - *Purpose:* Case-insensitive search using grep. 45 | - *Example:* `grep -i "pattern" file.txt` 46 | - *Output:* (Displays lines containing the specified pattern, regardless of case) 47 | 48 | -------------------------------------------------------------------------------- /ClassNotes/05.Linux-Basics-04-02-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/05.Linux-Basics-04-02-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/05.Linux-Basics-04-02-2024/notes.md: -------------------------------------------------------------------------------- 1 | **Additional Notes on Terminal Commands:** 2 | 3 | 13. **lscpu:** 4 | - *Purpose:* Displays information about the CPU architecture and processing units. 5 | - *Example:* `lscpu` 6 | - *Output:* (Displays CPU-related information) 7 | 8 | 14. **free -h:** 9 | - *Purpose:* Shows the amount of free and used system memory in a human-readable format. 10 | - *Example:* `free -h` 11 | - *Output:* (Displays memory usage information) 12 | 13 | 15. **df -h:** 14 | - *Purpose:* Reports the amount of disk space used and available on file systems. 15 | - *Example:* `df -h` 16 | - *Output:* (Shows disk space usage information) 17 | 18 | 16. **cat /etc/os-release:** 19 | - *Purpose:* Displays information about the operating system. 20 | - *Example:* `cat /etc/os-release` 21 | - *Output:* (Shows details about the OS release) 22 | 23 | 17. **hostname -I:** 24 | - *Purpose:* Shows the IP addresses assigned to the host. 25 | - *Example:* `hostname -I` 26 | - *Output:* (Displays IP addresses) 27 | 28 | 18. **uptime:** 29 | - *Purpose:* Shows how long the system has been running. 30 | - *Example:* `uptime` 31 | - *Output:* (Displays system uptime) 32 | 33 | 19. **top:** 34 | - *Purpose:* Provides a dynamic, real-time overview of a running system's performance. 35 | - *Example:* `top` 36 | - *Output:* (Displays system resource usage) 37 | 38 | 20. **kill -9:** 39 | - *Purpose:* Forces the termination of a process. 40 | - *Example:* `kill -9 process_id` 41 | - *Output:* (No output if successful) 42 | 43 | 21. **du -sh:** 44 | - *Purpose:* Shows the disk usage of a directory in a human-readable format. 45 | - *Example:* `du -sh directory_name` 46 | - *Output:* (Displays directory disk usage) 47 | 48 | 22. **date:** 49 | - *Purpose:* Prints or sets the system date and time. 50 | - *Example:* `date` 51 | - *Output:* (Displays the current date and time) 52 | 53 | --- 54 | 55 | **File Structure Summary:** 56 | 57 | 1. **/etc:** 58 | - *Purpose:* Configuration files and settings for the system and applications. 59 | 60 | 2. **/home:** 61 | - *Purpose:* Home directories for user accounts. 62 | 63 | 3. **/lib:** 64 | - *Purpose:* Essential libraries for binaries in /bin and /sbin. 65 | 66 | 4. **/opt:** 67 | - *Purpose:* Optional software packages. 68 | 69 | 5. **/bin:** 70 | - *Purpose:* Essential user command binaries. 71 | 72 | 6. **/sbin:** 73 | - *Purpose:* Essential system command binaries. 74 | 75 | 7. **/tmp:** 76 | - *Purpose:* Temporary files. 77 | 78 | 8. **/usr:** 79 | - *Purpose:* Secondary hierarchy for user data, programs, and documentation. 80 | 81 | 9. **/var:** 82 | - *Purpose:* Variable files – data that changes frequently. 83 | 84 | 10. **/proc:** 85 | - *Purpose:* Virtual file system providing information about processes and system status. 86 | 87 | 11. **/root:** 88 | - *Purpose:* Home directory for the root user. -------------------------------------------------------------------------------- /ClassNotes/06.Linux-Basics-10-02-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/06.Linux-Basics-10-02-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/06.Linux-Basics-10-02-2024/notes.md: -------------------------------------------------------------------------------- 1 | ## Understanding Paths and File Redirection: 2 | 3 | **Absolute Path:** 4 | An absolute path refers to the full path of a file or directory from the root directory (/). It starts from the root directory and includes all directories leading to the target directory or file. For example: `/home/user/documents/file.txt` 5 | 6 | **Relative Path:** 7 | A relative path refers to the path of a file or directory relative to the current working directory. It does not start from the root directory but instead navigates from the current location. For example, if the current directory is `/home/user`, and the file you want to reference is in the documents directory, you can use a relative path like `documents/file.txt`. 8 | 9 | **echo:** 10 | - **Purpose:** Prints text or variables to the terminal. 11 | - **Example:** `echo "Hello, World!"` 12 | - **Output:** Displays the text "Hello, World!" on the terminal. 13 | 14 | **>:** 15 | - **Purpose:** Redirects standard output to a file, creating the file if it doesn't exist and overwriting its contents if it does. 16 | - **Example:** `echo "Hello" > output.txt` 17 | - **Output:** Writes "Hello" to the file named `output.txt`, overwriting its previous content. 18 | 19 | **>>:** 20 | - **Purpose:** Appends standard output to a file, creating the file if it doesn't exist and appending to its contents if it does. 21 | - **Example:** `echo "World!" >> output.txt` 22 | - **Output:** Appends "World!" to the file named `output.txt`, preserving its existing content and adding the new text at the end. 23 | 24 | --- 25 | 26 | ## Additional Notes on File System Paths: 27 | 28 | 1. **.:** 29 | - **Purpose:** Represents the current directory. 30 | - **Example:** `./script.sh` 31 | - **Usage:** Used to execute a script or refer to a file in the current directory. 32 | 33 | 2. **..:** 34 | - **Purpose:** Represents the parent directory. 35 | - **Example:** `cd ..` 36 | - **Usage:** Used to navigate up one level in the directory structure. 37 | -------------------------------------------------------------------------------- /ClassNotes/07.Linux-Basics-11-02-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/07.Linux-Basics-11-02-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/07.Linux-Basics-11-02-2024/notes.md: -------------------------------------------------------------------------------- 1 | ### Understanding Hidden Files 2 | 3 | **Hidden File:** 4 | A hidden file is a file that is preceded by a dot (.) in its name. These files are typically configuration files or files that the system does not intend for users to modify directly. They are hidden from typical directory listings to reduce clutter and prevent accidental modification by users who might not be familiar with their purpose. 5 | 6 | **Example:** 7 | If a file is named `.file`, it would be considered a hidden file. 8 | 9 | ### Explaining `ls -larth` 10 | 11 | When you execute `ls -larth` in a Unix-like system: 12 | 13 | - **l**: Lists files in long format, providing detailed information about each file. 14 | - **a**: Displays all files, including hidden files (those starting with a dot). 15 | - **r**: Lists files in reverse order. 16 | - **t**: Sorts files by modification time, with the newest files first. 17 | - **h**: Prints file sizes in a human-readable format (e.g., 1K, 2M). 18 | 19 | Each field in the output represents: 20 | 21 | 1. **File Permissions**: Indicates the file's permissions for the owner, group, and others. 22 | 2. **Number of Links**: Shows the number of hard links to the file. 23 | 3. **Owner**: Displays the username of the file's owner. 24 | 4. **Group**: Indicates the group associated with the file. 25 | 5. **File Size**: Specifies the size of the file in bytes. 26 | 6. **Modification Time**: Shows the date and time when the file was last modified. 27 | 7. **File Name**: Displays the name of the file. 28 | 29 | ### Understanding File Permissions: Read, Write, and Execute 30 | 31 | In Unix-like systems, file permissions determine who can read, write, or execute a file. These permissions are represented by three sets of characters: owner permissions, group permissions, and others permissions. 32 | 33 | - **Read (r)**: Allows reading the contents of the file. 34 | - **Write (w)**: Allows modifying or deleting the file. 35 | - **Execute (x)**: Allows executing the file if it is a script or a binary executable. 36 | 37 | ### Using `chmod` on Files and Folders 38 | 39 | `chmod` is a command in Unix-like operating systems used to change the permissions of files and directories. It can be used to add or remove read, write, and execute permissions for the owner, group, and others. 40 | 41 | **Example:** 42 | ```bash 43 | chmod u+x script.sh 44 | ``` 45 | This command adds execute permission for the owner (`u`) to the file `script.sh`. 46 | 47 | ### Managing Users and Groups 48 | 49 | **useradd**: 50 | `useradd` is a command used to create new user accounts in Unix-like systems. 51 | 52 | **su -**: 53 | `su -` is a command used to switch user accounts. When followed by a hyphen (-), it simulates a full login, including setting up the environment as if the user had logged in directly. 54 | 55 | **`cat /etc/passwd`**: 56 | This command prints the contents of the `/etc/passwd` file, which contains information about user accounts on the system. 57 | 58 | **`cat /etc/group`**: 59 | This command prints the contents of the `/etc/group` file, which contains information about groups on the system. -------------------------------------------------------------------------------- /ClassNotes/08.Linux-Basics-17-02-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/08.Linux-Basics-17-02-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/09.Cloud-Basics-EntraId-Hierarchy-24-02-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/09.Cloud-Basics-EntraId-Hierarchy-24-02-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/09.Cloud-Basics-EntraId-Hierarchy-24-02-2024/notes.md: -------------------------------------------------------------------------------- 1 | # Class Notes: Introduction to Cloud Computing 🌐☁️ 2 | 3 | ## 1. Middleware in Computing 🖥️: 4 | Middleware serves as a critical software layer that facilitates communication between different components of a system, such as the operating system, databases, and applications. It plays a crucial role in enabling seamless interaction and data exchange in networked environments. 5 | 6 | ## 2. Procuring Computing Platforms 💻: 7 | Computing platforms are the foundation for running applications and services. They can be acquired from various sources, including on-premises infrastructure and cloud providers. Each option offers different levels of scalability, flexibility, and management capabilities. 8 | 9 | ## 3. Cloud Service Models ☁️: 10 | Cloud computing provides three main service models, each offering a different level of abstraction and management for computing resources: 11 | - **Infrastructure as a Service (IaaS)**: Offers virtualized computing resources over the internet, such as virtual machines, storage, and networking. 12 | - **Platform as a Service (PaaS)**: Provides a platform and environment for developers to build, test, and deploy applications without the complexity of managing the underlying infrastructure. 13 | - **Software as a Service (SaaS)**: Delivers software applications over the internet on a subscription basis, eliminating the need for users to install and maintain the software. 14 | 15 | ## 4. Introduction to Azure Cloud 🚀: 16 | Microsoft Azure is a leading cloud computing platform that offers a wide range of services and solutions for businesses. Key components of Azure include: 17 | - **Azure Active Directory (Azure AD)**: Microsoft's cloud-based identity and access management service, providing secure access to Azure resources and applications. 18 | - **Token-based Authentication**: A method of authentication where users are issued access tokens that are used to verify their identity and access permissions. 19 | 20 | ## 5. Managing Azure Resources 🔧: 21 | Effectively managing resources in Azure is crucial for optimizing costs and ensuring efficient operations. Key aspects of managing Azure resources include: 22 | - **Management Groups**: Organizational units that help manage access, policies, and compliance across multiple Azure subscriptions. 23 | - **Subscriptions**: Containers that provide billing and access control for Azure resources, allowing organizations to manage costs and resources efficiently. 24 | - **Resource Groups**: Containers that group related resources for an Azure solution, enabling easier management, monitoring, and deployment of resources. 25 | 26 | This class provided a detailed overview of cloud computing, focusing on Microsoft Azure, and highlighted the importance of effective resource management in cloud environments. Understanding these concepts is essential for anyone looking to leverage cloud technologies for their applications and services. -------------------------------------------------------------------------------- /ClassNotes/10.AzureAD-25-02-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/10.AzureAD-25-02-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/11.ImperativeVsDeclarative02-03-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/11.ImperativeVsDeclarative02-03-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/11.ImperativeVsDeclarative02-03-2024/notes.md: -------------------------------------------------------------------------------- 1 | ## Class Notes: Imperative VS Declarative 2 | 3 | ### Approach to Learning 📚 4 | 5 | - **Research Skills**: Discussed the importance of effective online research skills for developers. 6 | - **Problem-Solving**: Emphasized the value of using online resources to find solutions to coding challenges. 7 | 8 | ### Creating a Resource Group (RG) 🛠️ 9 | 10 | - **Manual Creation**: Walked through the process of manually creating an Azure Resource Group (RG) using the Azure portal. 11 | - **Benefits and Limitations**: Discussed the benefits of manual creation for understanding the basic steps, but also acknowledged its limitations in terms of efficiency and scalability. 12 | 13 | ### Automation 🤖 14 | 15 | - **Need for Automation**: Recognized the need for automation to streamline the RG creation process and improve efficiency. 16 | - **Tools for Automation**: Introduced various tools for automating RG creation, including Azure CLI, Azure PowerShell, Azure Bicep, and Terraform. 17 | - **Comparison of Tools**: Compared and contrasted the different tools based on their coding styles and capabilities. 18 | 19 | ### Imperative vs. Declarative Coding 🧭 20 | 21 | - **Imperative Coding**: Defined imperative coding as specifying the exact steps to achieve a desired outcome, often used in Azure CLI and Azure PowerShell scripts. 22 | - **Declarative Coding**: Defined declarative coding as specifying the desired outcome without specifying the exact steps, often used in Azure Bicep and Terraform. 23 | 24 | ### Challenges and Solutions ⚙️ 25 | 26 | - **Error Resolution**: Encountered an error during the Azure CLI automation process due to the absence of the Azure CLI on the system. 27 | - **Problem-Solving Approach**: Demonstrated a problem-solving approach by researching the error and resolving it through the installation of the Azure CLI. 28 | 29 | ### Next Steps 🚀 30 | 31 | - **Continuation of Automation**: Planned to continue the automation journey, focusing on creating Azure Resource Groups efficiently and effectively using command-line tools. 32 | - **Exploration of Other Tools**: Considered exploring other tools such as Azure Bicep and Terraform for RG creation automation. 33 | -------------------------------------------------------------------------------- /ClassNotes/12.AzureCLI-03-03-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/12.AzureCLI-03-03-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/12.AzureCLI-03-03-2024/notes.md: -------------------------------------------------------------------------------- 1 | **Class Notes: March 3, 2024** 📝 2 | 3 | ## Topic 1: Azure CLI Commands 💻 4 | 5 | ### 1.1 Understanding Azure CLI Command Structure: 6 | 7 | - Azure CLI (Command-Line Interface) is a command-line tool provided by Microsoft for managing Azure resources. 8 | - Commands follow a structured format: `az [group] [subgroup] [action] [parameters]`. 9 | 10 | ### 1.2 Decoding `az group create` Command: 11 | 12 | - We discussed the `az group create` command which is used to create a resource group in Azure. 13 | - `--name` flag specifies the name of the resource group (`demoResourceGroup` in our example). 14 | - `--location` flag specifies the Azure region where the resource group will be located (`westus` in our example). 15 | 16 | ### 1.3 Creating Azure CLI Commands using `--help`: 17 | 18 | - The `--help` option provides detailed information about the command, its subcommands, and available parameters. 19 | - It's a valuable resource for understanding command syntax, usage, and available options. 20 | 21 | ## Topic 2: Syllabus of Terraform 🌍 22 | 23 | ### 2.1 Introduction to Terraform: 24 | 25 | - Terraform is an open-source infrastructure as code (IaC) tool created by HashiCorp. 26 | - It allows users to define and provision infrastructure using declarative configuration files. 27 | - Terraform supports multiple cloud providers, including Azure, AWS, Google Cloud, and others. 28 | 29 | ### 2.2 Syllabus Overview: 30 | 31 | - We provided an overview of the syllabus for our Terraform course. 32 | - The syllabus typically covers: 33 | - Terraform Basics: Installation, Configuration, Providers 34 | - Terraform Configuration Language: HCL (HashiCorp Configuration Language) 35 | - Resource Management: Defining and Managing Resources 36 | - State Management: Understanding Terraform State 37 | - Modules: Organizing Configuration with Modules 38 | - Provisioners and Lifecycle: Managing Provisioning and Lifecycle Events 39 | - Advanced Topics: Workspaces, Remote State, Collaboration, Best Practices 40 | 41 | ## Next Steps: 🚀 42 | 43 | - For our next class, we will delve deeper into Terraform basics, focusing on installation, configuration, and understanding HCL syntax. 44 | 45 | This concludes the notes for today's class. If there are any questions or clarifications needed, feel free to ask! -------------------------------------------------------------------------------- /ClassNotes/13.TerraformwithVsCode-09-03-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/13.TerraformwithVsCode-09-03-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/13.TerraformwithVsCode-09-03-2024/notes.md: -------------------------------------------------------------------------------- 1 | # Class Notes: Introduction to Terraform 2 | 3 | ## 🌱 Started Learning Terraform 4 | 5 | - Terraform is an open-source infrastructure as code software tool created by HashiCorp. 6 | - It allows users to define and provision data center infrastructure using a high-level configuration language known as HashiCorp Configuration Language (HCL), or optionally JSON. 7 | 8 | ## 📚 Terraform Registry 9 | 10 | - Terraform Registry is a central repository for finding and sharing Terraform modules. 11 | - It contains a collection of pre-built configurations for various infrastructure components that can be easily reused. 12 | 13 | ## 🧐 How to Do Google Search 14 | 15 | - Using Google search effectively can help in finding solutions to Terraform-related problems. 16 | - It's important to use specific keywords related to the issue to get relevant results. 17 | 18 | ## 🛠️ Creating a Resource Group 19 | 20 | - Demonstrated how to create a resource group using different tools: 21 | 1. Notepad: Manually writing Terraform configuration files. 22 | 2. File Explorer: Running Terraform commands from the command line. 23 | 3. Command Line: Using the Terraform CLI to create a resource group. 24 | - Observed that using multiple windows for these tasks can be cumbersome. 25 | 26 | ## 🚀 Exploring Visual Studio Code (VSCode) 27 | 28 | - Explored VSCode as an integrated development environment (IDE) for Terraform. 29 | - Created a resource group using Terraform in VSCode, which provides a more streamlined and efficient workflow compared to using multiple windows. 30 | -------------------------------------------------------------------------------- /ClassNotes/14.Terraform-Basics-10-03-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/14.Terraform-Basics-10-03-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/14.Terraform-Basics-10-03-2024/mera_pyara_rg.tf: -------------------------------------------------------------------------------- 1 | # Declare the required provider and its version 2 | terraform { 3 | required_providers { 4 | azurerm = { 5 | source = "hashicorp/azurerm" 6 | version = "3.95.0" 7 | } 8 | } 9 | } 10 | 11 | # Configure the Azure provider 12 | provider "azurerm" { 13 | features {} 14 | } 15 | 16 | # Define an Azure resource group named "rg-bhondhulal" in the West Europe region 17 | resource "azurerm_resource_group" "rg-block-name" { 18 | name = "rg-bhondhulal" 19 | location = "West Europe" 20 | } 21 | 22 | # Define another Azure resource group named "rg-dhondhulal" in the West Europe region 23 | resource "azurerm_resource_group" "rg-block-name2" { 24 | name = "rg-dhondhulal" 25 | location = "West Europe" 26 | } 27 | 28 | # Define a third Azure resource group named "dhondhu-rg" in the West Europe region 29 | resource "azurerm_resource_group" "rg-block-name3" { 30 | name = "dhondhu-rg" 31 | location = "West Europe" 32 | } 33 | -------------------------------------------------------------------------------- /ClassNotes/14.Terraform-Basics-10-03-2024/notes.md: -------------------------------------------------------------------------------- 1 | ### 🚀 Terraform Class Notes 2 | 3 | 1. **Coding Blocks in Terraform**: 4 | - Terraform code is organized into blocks. 5 | - Each block has a specific purpose and syntax. 6 | - Examples include the `terraform` block, `provider` block, and `resource` block. 7 | 8 | 2. **Searching for Resources**: 9 | - To find resources in Terraform, use Google with the format "Terraform ". For example, "Terraform Azure resource group". 10 | - Open the registry link in the search results to find example code and arguments for the resource. 11 | 12 | 3. **Types of Blocks**: 13 | - **Terraform Block**: Defines the Terraform configuration file format and required provider versions. 14 | - **Required Providers Block**: Specifies the providers required by the configuration. 15 | - **Resource Block**: Declares a resource that exists within the infrastructure. 16 | 17 | 4. **Common Terraform Commands**: 18 | - `terraform init`: Initializes a Terraform working directory containing Terraform configuration files. 19 | - `terraform validate`: Validates the configuration files in a directory, referring to the resource configurations and verifying syntax. 20 | - `terraform fmt`: Rewrites Terraform configuration files to a canonical format and style. 21 | - `terraform plan`: Generates and shows an execution plan for the changes Terraform will make. 22 | - `terraform apply`: Applies the changes required to reach the desired state of the configuration. 23 | 24 | 5. **Scenarios**: 25 | - **Adding a New Resource Group in Code**: 26 | - Modify the Terraform configuration to include a new resource group definition. 27 | - Run `terraform plan` to preview the changes. 28 | - Run `terraform apply` to create the resource group. 29 | 30 | - **Deleting a Resource Group from Code**: 31 | - Remove the resource group definition from the Terraform configuration. 32 | - Run `terraform plan` to preview the deletion. 33 | - Run `terraform apply` to delete the resource group. 34 | 35 | - **Deleting a Resource Group from Azure Portal**: 36 | - Manually delete the resource group from the Azure portal. 37 | - Run `terraform plan` to identify the changes required in the Terraform configuration. 38 | - Run `terraform apply` to apply the changes and reconcile the state. 39 | 40 | These are the basic concepts and commands to get started with Terraform. Experiment with different scenarios and explore the rich ecosystem of Terraform providers and resources. -------------------------------------------------------------------------------- /ClassNotes/15.Terraform-State-16-03-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/15.Terraform-State-16-03-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/15.Terraform-State-16-03-2024/notes.md: -------------------------------------------------------------------------------- 1 | # 📝 Class Notes: Understanding Terraform State Files and Azure Resource Groups 2 | 3 | ## Terraform State Files 4 | - Terraform uses state files to keep track of managed resources. 5 | - State files are in JSON format and store resource information, attributes, and dependencies. 6 | 7 | ## Scenarios with Azure Resource Groups 8 | 1. **Creating a Resource Group:** 9 | - Use the `azurerm_resource_group` resource in Terraform. 10 | - Define the resource group's name, location, and any additional tags. 11 | 12 | 2. **Updating a Resource Group:** 13 | - Modify the attributes of the `azurerm_resource_group` resource in your Terraform configuration. 14 | - Terraform detects the changes and plans an update to the existing resource group. 15 | 16 | 3. **Deleting a Resource Group:** 17 | - To delete a resource group, remove the `azurerm_resource_group` resource from your `main.tf` file. 18 | - Terraform will recognize the removal and plan to delete the resource group. 19 | 20 | 4. **State File Management:** 21 | - Store the state file remotely in a secure location, such as Azure Storage or Terraform Cloud. 22 | - Avoid storing the state file locally or in source control to prevent accidental exposure of sensitive information. 23 | 24 | 5. **Concurrency and Locking:** 25 | - Terraform uses locking mechanisms to prevent concurrent access to the state file. 26 | - This ensures that only one Terraform operation can modify the state file at a time, preventing conflicts. 27 | 28 | 6. **State File Inspection:** 29 | - Use the `terraform state` command to inspect the contents of the state file. 30 | - This can help troubleshoot issues and understand the current state of managed resources. 31 | 32 | ## Note 33 | - Nadi kinare saanp hai terraform destroy chalana paap hai (Translation: There's a snake by the riverbank, running `terraform destroy` is a sin.) 34 | -------------------------------------------------------------------------------- /ClassNotes/16.StorageAccountAndRemoteState-17-03-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/16.StorageAccountAndRemoteState-17-03-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/16.StorageAccountAndRemoteState-17-03-2024/notes.md: -------------------------------------------------------------------------------- 1 | # Class Notes: Azure Storage Account, Region and Zones, Redundancy, Terraform State File, Remote Backend Configuration, State Locking 2 | 3 | ## 1. Azure Storage Account 4 | 5 | - Azure Storage Account is a cloud storage solution provided by Microsoft Azure. 6 | - It offers several types of storage services: 7 | - Blob storage: Used for storing large amounts of unstructured data, such as text or binary data. 8 | - File share: Provides shared access to files with the SMB protocol. 9 | - Table storage: NoSQL data store for storing structured datasets. 10 | - Queue storage: Messaging store for reliable messaging between application components. 11 | - Each type serves different purposes and is suitable for different scenarios. 12 | 13 | ## 2. Region and Zones 14 | 15 | - Azure is divided into geographical regions, each containing one or more datacenters. 16 | - Regions are important for ensuring data residency, compliance, and high availability. 17 | - Within each region, Azure datacenters are further divided into availability zones. 18 | - Availability zones are physically separate locations within an Azure region, each with independent power, cooling, and networking. 19 | - Deploying resources across availability zones increases resilience against datacenter failures. 20 | 21 | ## 3. Redundancy - LRS, ZRS, GRS 22 | 23 | - Redundancy options in Azure Storage Account ensure data durability and availability. 24 | - Locally Redundant Storage (LRS): Data is replicated within a single datacenter. 25 | - Zone-Redundant Storage (ZRS): Data is replicated across multiple availability zones in the same region. 26 | - Geo-Redundant Storage (GRS): Data is replicated to a secondary region, providing data redundancy across regions for disaster recovery. 27 | 28 | ## 4. Terraform State File 29 | 30 | - Terraform state file is a JSON-formatted file that keeps track of the resources managed by Terraform. 31 | - It stores metadata about the resources, their dependencies, and their properties. 32 | - The state file is crucial for Terraform to understand the current state of the infrastructure and to plan and apply changes accurately. 33 | 34 | ## 5. Setting Remote Backend in Azure Storage Account 35 | 36 | ```hcl 37 | backend "azurerm" { 38 | resource_group_name = "rg-titumama-1" 39 | storage_account_name = "sadevopsinsiders123" 40 | container_name = "terraform-state" 41 | key = "dhondhu.terraform.tfstate" 42 | } 43 | ``` 44 | 45 | - This configuration sets up Azure Storage Account as the remote backend for Terraform. 46 | - It specifies the Azure resource group, storage account, container, and key (filename) for storing the state file remotely. 47 | 48 | ## 6. How State Locking Works? 49 | 50 | - State locking prevents concurrent operations on the same Terraform state file to avoid conflicts. 51 | - When Terraform performs an operation, it acquires a lock on the state file. 52 | - Locking mechanisms include file locking (local state file) and remote locking (using a backend like Azure Storage Account). 53 | - Concurrent operations from different users or automation systems will wait until the lock is released. 54 | - Locks are automatically released after successful completion or timeout to prevent deadlocks. 55 | -------------------------------------------------------------------------------- /ClassNotes/17.TerraformDependency-23-03-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/17.TerraformDependency-23-03-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/17.TerraformDependency-23-03-2024/explicit_dependency.tf: -------------------------------------------------------------------------------- 1 | 2 | resource "azurerm_resource_group" "rg5" { 3 | name = "rinkiya-ka-beta" 4 | location = "West Europe" 5 | } 6 | 7 | resource "azurerm_storage_account" "st5" { 8 | depends_on = [azurerm_resource_group.rg5] 9 | name = "devopsinsiders1424" 10 | resource_group_name = "rinkiya-ka-beta" 11 | location = "West Europe" 12 | account_tier = "Standard" 13 | account_replication_type = "GRS" 14 | 15 | tags = { 16 | environment = "staging" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ClassNotes/17.TerraformDependency-23-03-2024/implicit_dependency.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.96.0" 6 | } 7 | } 8 | } 9 | 10 | provider "azurerm" { 11 | features {} 12 | } 13 | 14 | resource "azurerm_resource_group" "rg1" { 15 | name = "rinkiya-ke-new-papa" 16 | location = "West Europe" 17 | } 18 | 19 | resource "azurerm_storage_account" "st1" { 20 | name = "devopsinsiders123" 21 | resource_group_name = azurerm_resource_group.rg1.name 22 | location = azurerm_resource_group.rg1.location 23 | account_tier = "Standard" 24 | account_replication_type = "GRS" 25 | 26 | tags = { 27 | environment = "staging" 28 | } 29 | } -------------------------------------------------------------------------------- /ClassNotes/17.TerraformDependency-23-03-2024/notes.md: -------------------------------------------------------------------------------- 1 | # 1. Implicit and Explicit Dependency in Terraform 2 | 3 | In Terraform, dependencies refer to the relationships between resources, where one resource depends on another. These dependencies can be implicit or explicit. 4 | 5 | - **Implicit Dependency:** Terraform infers the dependency based on the resource attributes referenced in the configuration. For example, if a virtual machine depends on a virtual network, Terraform will automatically ensure that the virtual network is created before the virtual machine. 6 | 7 | - **Explicit Dependency:** You can explicitly define dependencies using the `depends_on` attribute. This attribute takes a list of resources that must be created before the current resource. This is useful when Terraform cannot automatically determine the correct order of resource creation. 8 | 9 | ## Code Sample - Implicit Dependency Azure Resource Group and Storage Account 10 | 11 | ```hcl 12 | provider "azurerm" { 13 | features {} 14 | } 15 | 16 | resource "azurerm_resource_group" "example" { 17 | name = "example-resources" 18 | location = "East US" 19 | } 20 | 21 | resource "azurerm_storage_account" "example" { 22 | name = "examplestorageaccount" 23 | resource_group_name = azurerm_resource_group.example.name 24 | location = azurerm_resource_group.example.location 25 | account_tier = "Standard" 26 | account_replication_type = "LRS" 27 | } 28 | ``` 29 | 30 | In this example, the `azurerm_storage_account` resource depends on the `azurerm_resource_group` resource. Terraform will ensure that the resource group is created before the storage account. 31 | 32 | ## Code Sample - Explicit Dependency Azure Resource Group and Storage Account 33 | 34 | ```hcl 35 | resource "azurerm_resource_group" "rg5" { 36 | name = "rinkiya-ka-beta" 37 | location = "West Europe" 38 | } 39 | 40 | resource "azurerm_storage_account" "st5" { 41 | depends_on = [azurerm_resource_group.rg5] 42 | name = "devopsinsiders1424" 43 | resource_group_name = "rinkiya-ka-beta" 44 | location = "West Europe" 45 | account_tier = "Standard" 46 | account_replication_type = "GRS" 47 | 48 | tags = { 49 | environment = "staging" 50 | } 51 | } 52 | ``` 53 | 54 | # 2. Terraform Folder Structure 55 | 56 | Organizing your Terraform configurations into folders can help manage complex projects more effectively. A common structure is to create a separate folder for each type of resource, along with a `provider.tf` file and a `main.tf` file in each folder. 57 | 58 | ## Example Folder Structure 59 | 60 | ``` 61 | . 62 | ├───resource_group 63 | │──────main.tf 64 | │──────provider.tf 65 | └───storage_account 66 | │──────main.tf 67 | │──────provider.tf 68 | ``` 69 | 70 | - **`resource_group/main.tf`:** Contains the Terraform configuration for creating Azure Resource Groups. 71 | - **`resource_group/provider.tf`:** Contains the provider configuration for Azure. 72 | - **`storage_account/main.tf`:** Contains the Terraform configuration for creating Azure Storage Accounts. 73 | - **`storage_account/provider.tf`:** Contains the provider configuration for Azure. 74 | 75 | This structure helps in organizing your Terraform code into logical units, making it easier to manage and maintain. Each folder can contain additional Terraform configuration files as needed for the specific resource type. -------------------------------------------------------------------------------- /ClassNotes/18.TerraformVariables-DeclareAssignUse-24-03-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/18.TerraformVariables-DeclareAssignUse-24-03-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/18.TerraformVariables-DeclareAssignUse-24-03-2024/notes.md: -------------------------------------------------------------------------------- 1 | # Class Notes - Variables in Terraform 2 | 3 | ## 1. Variables 4 | - Variables in Terraform allow for dynamic values and reusability in your configurations. 5 | - They help in making configurations more flexible and maintainable. 6 | 7 | ## 2. Variable Lifecycle 8 | - **Variable Declaration**: Define variables in your Terraform configuration. 9 | - **Variable Assignment**: Assign values to variables. 10 | - **Variable Value Usage**: Use variables in your resources and modules. 11 | 12 | ## 3. Declaring Variables 13 | - Variables are declared in the `variables` block in your Terraform configuration. 14 | - Example: 15 | ```hcl 16 | variable "resource_group_name" { 17 | type = string 18 | default = "myResourceGroup" 19 | } 20 | ``` 21 | 22 | ## 4. Using Variable Values 23 | - To use the value of a variable, reference it using `${var.variable_name}` syntax. 24 | - Example: 25 | ```hcl 26 | resource "azurerm_resource_group" "example" { 27 | name = var.resource_group_name 28 | location = "West Europe" 29 | } 30 | ``` 31 | 32 | ## 5. Methods of Passing Variable Values 33 | 1. **Using CLI**: Pass variable values directly through the CLI using `-var` flag. 34 | Example: `terraform plan -var="resource_group_name=myResourceGroup"` 35 | 36 | 2. **Using CLI with -var**: Use `-var` in `terraform plan` and `terraform apply` commands. 37 | Example: `terraform plan -var="resource_group_name=myResourceGroup"` 38 | 39 | 3. **Using Default in Variable Block**: Set default values for variables in the variable block. 40 | Example: 41 | ```hcl 42 | variable "resource_group_name" { 43 | type = string 44 | default = "myResourceGroup" 45 | } 46 | ``` 47 | 48 | 4. **Using .tfvars Files**: Create `.tfvars` files and pass them using `-var-file` in `terraform plan` and `terraform apply` commands. 49 | Example: `terraform plan -var-file="myvars.tfvars"` 50 | 51 | 5. **Using terraform.tfvars File**: Terraform automatically loads variables from a `terraform.tfvars` file if present. 52 | Example: 53 | ```hcl 54 | resource_group_name = "myResourceGroup" 55 | ``` 56 | 57 | These methods provide flexibility in managing and passing variable values in Terraform configurations. 58 | 59 | References: https://developer.hashicorp.com/terraform/language/values/variables#declaring-an-input-variable -------------------------------------------------------------------------------- /ClassNotes/19.TerraformList-ForEach-30-03-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/19.TerraformList-ForEach-30-03-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/19.TerraformList-ForEach-30-03-2024/notes.md: -------------------------------------------------------------------------------- 1 | # Terraform List and For_each 2 | 3 | ## Introduction 4 | - Terraform allows dynamic resource creation using lists and the `for_each` meta-argument. 5 | - `for_each` can iterate over a map, set, or list to create multiple instances of a resource based on the elements. 6 | 7 | ## Example Usage 8 | ```hcl 9 | variable "rg_list" { 10 | default = ["rg1", "rg2"] 11 | } 12 | 13 | resource "azurerm_resource_group" "rg" { 14 | for_each = toset(var.rg_list) 15 | name = each.key 16 | location = "East US" 17 | } 18 | ``` 19 | 20 | ## Explanation 21 | - The `rg_list` variable contains a list of maps with the resource group name as key and location as value. 22 | - `toset()` function converts the list to a set, ensuring uniqueness. 23 | - The `for_each` argument iterates over the set, creating a resource group for each element. 24 | - `each.key` ` refer to the current key-value pair in the iteration. 25 | 26 | ## Conclusion 27 | - Using `for_each` with lists allows dynamic creation of resources based on the elements. 28 | - This approach is useful for scenarios where resources need to be created based on a predefined list of values. -------------------------------------------------------------------------------- /ClassNotes/20.TerraformMapForEach-31-03-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/20.TerraformMapForEach-31-03-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/21.AzureFundamentals-06-04-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/21.AzureFundamentals-06-04-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/22.VM-07-04-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/22.VM-07-04-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/22.VM-07-04-2024/notes.md: -------------------------------------------------------------------------------- 1 | This Terraform code defines infrastructure resources on Microsoft Azure using the Azure provider. Let's break down the code section by section: 2 | 3 | 1. **Azure Public IP Address**: 4 | - This resource is defined using `azurerm_public_ip` block. 5 | - It creates a static public IP address named "acceptanceTestPublicIp1" in the resource group "babitajee-rg" located in the "Central India" region. 6 | - `allocation_method` is set to "Static", indicating the IP address is allocated statically. 7 | - `sku` is set to "Standard", indicating the SKU (Stock Keeping Unit) of the IP address. 8 | 9 | 2. **Azure Network Interface**: 10 | - Defined using `azurerm_network_interface` block. 11 | - It creates a network interface named "frontend-nic" in the resource group "babitajee-rg", also located in the "Central India" region. 12 | - An IP configuration named "internal" is defined within the network interface. 13 | - The subnet for the network interface is specified using its ID. 14 | - `private_ip_address_allocation` is set to "Dynamic", meaning the private IP address is dynamically allocated. 15 | - `public_ip_address_id` is set to the ID of the public IP address created earlier. 16 | 17 | 3. **Azure Virtual Machine**: 18 | - Defined using `azurerm_linux_virtual_machine` block. 19 | - It creates a Linux virtual machine named "frontend-machine" in the same resource group and location. 20 | - The size of the virtual machine is set to "Standard_DS1_v2". 21 | - `admin_username` and `admin_password` define the login credentials for the virtual machine. In this case, the username is "devopsinsiders", and the password is "3@O!-LAc2j:6". 22 | - `disable_password_authentication` is set to false, allowing password authentication. 23 | - `network_interface_ids` specifies the network interfaces attached to the virtual machine. Here, it attaches the previously defined network interface. 24 | - Configuration for the OS disk is provided including caching, storage type, size, and name. 25 | - The source image for the virtual machine is specified using its publisher, offer, SKU, and version. In this case, it's an Ubuntu Server 22.04 LTS image provided by Canonical. 26 | 27 | Overall, this Terraform code sets up a basic infrastructure consisting of a virtual machine with a public IP address, a network interface, and an OS disk in Microsoft Azure. -------------------------------------------------------------------------------- /ClassNotes/23.VM-ForEach+Map-13-04-2024/data_sources.tf: -------------------------------------------------------------------------------- 1 | data "azurerm_subnet" "gogo_subnet" { 2 | name = "frontend-subnet" 3 | virtual_network_name = "devops-vnet2" 4 | resource_group_name = "rg_crime_master_gogo" 5 | } 6 | -------------------------------------------------------------------------------- /ClassNotes/23.VM-ForEach+Map-13-04-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/23.VM-ForEach+Map-13-04-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/23.VM-ForEach+Map-13-04-2024/main.tf: -------------------------------------------------------------------------------- 1 | resource "azurerm_public_ip" "public_ip" { 2 | for_each = var.linux_vms 3 | name = each.value.pip_name 4 | resource_group_name = each.value.resource_group_name 5 | location = each.value.location 6 | allocation_method = "Static" 7 | } 8 | 9 | resource "azurerm_network_interface" "network_interface" { 10 | for_each = var.linux_vms 11 | name = each.value.nic_name 12 | location = each.value.location 13 | resource_group_name = each.value.resource_group_name 14 | ip_configuration { 15 | name = "internal" 16 | subnet_id = data.azurerm_subnet.gogo_subnet.id 17 | private_ip_address_allocation = "Dynamic" 18 | public_ip_address_id = azurerm_public_ip.public_ip[each.key].id 19 | } 20 | } 21 | 22 | resource "azurerm_linux_virtual_machine" "virtual_machine" { 23 | for_each = var.linux_vms 24 | name = each.value.vm_name 25 | resource_group_name = each.value.resource_group_name 26 | location = each.value.location 27 | size = each.value.vm_size 28 | disable_password_authentication = false 29 | admin_username = each.value.vm_username 30 | admin_password = each.value.vm_password 31 | network_interface_ids = [ 32 | azurerm_network_interface.network_interface[each.key].id, 33 | ] 34 | 35 | os_disk { 36 | caching = "ReadWrite" 37 | storage_account_type = "Standard_LRS" 38 | } 39 | 40 | source_image_reference { 41 | publisher = "canonical" 42 | offer = "0001-com-ubuntu-server-jammy" 43 | sku = "22_04-lts" 44 | version = "latest" 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /ClassNotes/23.VM-ForEach+Map-13-04-2024/notes.md: -------------------------------------------------------------------------------- 1 | ### Class Notes: Terraform Data Block, Output Block, and VM Configuration with Foreach and Map 2 | 3 | #### Terraform Data Block: 4 | - Used to query existing resources in the infrastructure. 5 | - Syntax: 6 | ```hcl 7 | data "azurerm_subnet" "example" { 8 | name = "subnet1" 9 | virtual_network_name = azurerm_virtual_network.example.name 10 | resource_group_name = azurerm_resource_group.example.name 11 | } 12 | ``` 13 | 14 | #### Terraform Output Block: 15 | - Used to display information about resources. 16 | - Syntax: 17 | ```hcl 18 | output "subnet_id" { 19 | value = data.azurerm_subnet.example.id 20 | } 21 | ``` 22 | 23 | #### Virtual Machine Configuration with Foreach and Map: 24 | - Utilizes the `for_each` expression to create multiple instances based on a map of values. 25 | - Example Code: 26 | 27 | ```hcl 28 | resource "azurerm_public_ip" "public_ip" { 29 | for_each = var.linux_vms 30 | name = each.value.pip_name 31 | resource_group_name = each.value.resource_group_name 32 | location = each.value.location 33 | allocation_method = "Static" 34 | } 35 | 36 | resource "azurerm_network_interface" "network_interface" { 37 | for_each = var.linux_vms 38 | name = each.value.nic_name 39 | location = each.value.location 40 | resource_group_name = each.value.resource_group_name 41 | ip_configuration { 42 | name = "internal" 43 | subnet_id = data.azurerm_subnet.gogo_subnet.id 44 | private_ip_address_allocation = "Dynamic" 45 | public_ip_address_id = azurerm_public_ip.public_ip[each.key].id 46 | } 47 | } 48 | 49 | resource "azurerm_linux_virtual_machine" "virtual_machine" { 50 | for_each = var.linux_vms 51 | name = each.value.vm_name 52 | resource_group_name = each.value.resource_group_name 53 | location = each.value.location 54 | size = each.value.vm_size 55 | disable_password_authentication = false 56 | admin_username = each.value.vm_username 57 | admin_password = each.value.vm_password 58 | network_interface_ids = [ 59 | azurerm_network_interface.network_interface[each.key].id, 60 | ] 61 | 62 | os_disk { 63 | caching = "ReadWrite" 64 | storage_account_type = "Standard_LRS" 65 | } 66 | 67 | source_image_reference { 68 | publisher = "canonical" 69 | offer = "0001-com-ubuntu-server-jammy" 70 | sku = "22_04-lts" 71 | version = "latest" 72 | } 73 | } 74 | ``` 75 | 76 | - In this example, the `var.linux_vms` variable is a map containing values for each virtual machine instance, including names, resource group names, locations, sizes, usernames, and passwords. 77 | - The `for_each` expression iterates over the `var.linux_vms` map to create multiple instances of `azurerm_public_ip`, `azurerm_network_interface`, and `azurerm_linux_virtual_machine` resources. 78 | 79 | Remember to replace `var.linux_vms` with your actual variable name and update the values inside the map (`each.value`) according to your requirements. -------------------------------------------------------------------------------- /ClassNotes/23.VM-ForEach+Map-13-04-2024/outputs.tf: -------------------------------------------------------------------------------- 1 | # output "vm_public_ip" { 2 | # value = azurerm_linux_virtual_machine.virtual_machine.public_ip_address 3 | # } 4 | -------------------------------------------------------------------------------- /ClassNotes/23.VM-ForEach+Map-13-04-2024/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.98.0" 6 | } 7 | } 8 | 9 | # backend "azurerm" { 10 | # resource_group_name = "devopsinsders" # Can be passed via `-backend-config=`"resource_group_name="` in the `init` command. 11 | # storage_account_name = "devopsinsiders765" # Can be passed via `-backend-config=`"storage_account_name="` in the `init` command. 12 | # container_name = "tfstate" # Can be passed via `-backend-config=`"container_name="` in the `init` command. 13 | # key = "virtualmachine.tfstate" # Can be passed via `-backend-config=`"key="` in the `init` command. 14 | # } 15 | 16 | } 17 | 18 | 19 | provider "azurerm" { 20 | features {} 21 | } 22 | -------------------------------------------------------------------------------- /ClassNotes/23.VM-ForEach+Map-13-04-2024/terraform.tfvars: -------------------------------------------------------------------------------- 1 | linux_vms = { 2 | vm1 = { 3 | pip_name = "gogo1-ip" 4 | nic_name = "gogo1-nic" 5 | vm_name = "gogo1-vm" 6 | resource_group_name = "rg_crime_master_gogo" 7 | location = "westus" 8 | vm_size = "Standard_F2" 9 | vm_username = "adminuser" 10 | vm_password = "6ZyT40,Vo+c<" 11 | } 12 | vm2 = { 13 | pip_name = "chachi420-ip" 14 | nic_name = "chachi420-nic" 15 | vm_name = "chachi420-vm" 16 | resource_group_name = "rg_crime_master_gogo" 17 | location = "westus" 18 | vm_size = "Standard_F2" 19 | vm_username = "adminuser" 20 | vm_password = "6ZyT40,Vo+c<" 21 | } 22 | vm3 = { 23 | pip_name = "dhondhu-ip" 24 | nic_name = "dhondhu-nic" 25 | vm_name = "dhondhu-vm" 26 | resource_group_name = "rg_crime_master_gogo" 27 | location = "westus" 28 | vm_size = "Standard_F2" 29 | vm_username = "adminuser" 30 | vm_password = "6ZyT40,Vo+c<" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ClassNotes/23.VM-ForEach+Map-13-04-2024/variables.tf: -------------------------------------------------------------------------------- 1 | variable "linux_vms" {} 2 | -------------------------------------------------------------------------------- /ClassNotes/24.ForEachDetailed-Database-Bastion-14-04-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/24.ForEachDetailed-Database-Bastion-14-04-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/25.Bastion-20-04-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/25.Bastion-20-04-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/26.Modules-21-04-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/26.Modules-21-04-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/27.AzureLB-27-04-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/27.AzureLB-27-04-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/28.AzureApplicationGateway28-04-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/28.AzureApplicationGateway28-04-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/28.AzureApplicationGateway28-04-2024/notes.md: -------------------------------------------------------------------------------- 1 | # Azure Application Gateway 🚀 2 | 3 | Azure Application Gateway is a Layer-7 (Application Layer) load balancing service that is specifically designed for handling HTTP/HTTPS traffic. It offers advanced routing, SSL termination, web application firewall (WAF) capabilities, and more, making it suitable for web applications with complex traffic management requirements. 4 | 5 | 🌐 **HTTP Load Balancing**: It intelligently routes traffic based on URL path, host headers, and other HTTP attributes. 6 | 7 | 🔐 **SSL Offloading**: Application Gateway can handle SSL/TLS encryption and decryption, reducing the workload on backend servers. 8 | 9 | 🛡️ **Web Application Firewall (WAF)**: Provides protection against common web application vulnerabilities and attacks. 10 | 11 | 🍪 **Cookie-Based Affinity**: Supports session affinity based on HTTP cookies. 12 | 13 | 🔄 **Rewrite and Redirection**: You can perform URL rewrite and redirection for incoming requests. 14 | 15 | 🚀 **Auto-Scaling**: Application Gateway can automatically scale based on demand to handle traffic spikes. -------------------------------------------------------------------------------- /ClassNotes/29.AzureFrontDoor04-05-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/29.AzureFrontDoor04-05-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/30.AzureS2SP2SPeering05-05-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/30.AzureS2SP2SPeering05-05-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/31.TerraformDynamicBlocks11-05-2024/notes.md: -------------------------------------------------------------------------------- 1 | Sure, here's an updated example using Azure Network Security Group (NSG) and rules: 2 | ## Terraform Dynamic Blocks with Azure Network Security Group (NSG) 3 | 4 | ### Introduction 5 | - Azure Network Security Group (NSG) is a virtual firewall that controls inbound and outbound traffic to an Azure resource. 6 | - Terraform dynamic blocks can be used to define variable numbers of NSG rules based on input data. 7 | 8 | ### Example 9 | ```hcl 10 | variable "ports" { 11 | type = list(number) 12 | default = [80, 443] 13 | } 14 | 15 | resource "azurerm_network_security_group" "example" { 16 | name = "example-nsg" 17 | location = "East US" 18 | resource_group_name = azurerm_resource_group.example.name 19 | 20 | dynamic "security_rule" { 21 | for_each = var.ports 22 | content { 23 | name = "AllowPort${security_rule.key}" 24 | priority = security_rule.key 25 | direction = "Inbound" 26 | access = "Allow" 27 | protocol = "Tcp" 28 | source_port_range = "*" 29 | destination_port_range = security_rule.value 30 | source_address_prefix = "*" 31 | destination_address_prefix = "*" 32 | } 33 | } 34 | } 35 | ``` 36 | - In this example, the number of security rules in the NSG is dynamically determined based on the `var.ports` list. 37 | 38 | ### Key Points 39 | - Dynamic blocks in Terraform allow you to create multiple instances of nested blocks based on input data. 40 | - Use the `for_each` argument to iterate over a collection and generate blocks dynamically. 41 | - Each element in the collection results in the creation of a new block instance. 42 | 43 | ### Conclusion 44 | - Terraform dynamic blocks provide a flexible way to manage Azure NSG configurations with variable rule counts. 45 | - They enable you to create reusable and adaptable configurations that meet changing security requirements. 46 | -------------------------------------------------------------------------------- /ClassNotes/31.TerraformDynamicBlocks11-05-2024/sample_code.tf: -------------------------------------------------------------------------------- 1 | variable "vnets" {} 2 | 3 | resource "azurerm_resource_group" "dhondhurg" { 4 | for_each = { 5 | rg1 = { 6 | name = "dhondhu-rg" 7 | location = "westeurope" 8 | } 9 | } 10 | name = each.value.name 11 | location = each.value.location 12 | } 13 | 14 | # Nested Loops 15 | resource "azurerm_virtual_network" "dhondhuvnet" { 16 | for_each = var.vnets 17 | name = each.value.vnetName 18 | location = each.value.location 19 | resource_group_name = each.value.rg_name 20 | address_space = each.value.address_space 21 | 22 | dynamic "subnet" { 23 | for_each = each.value.subnets 24 | content { 25 | name = subnet.value.name 26 | address_prefix = subnet.value.address_prefix 27 | } 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /ClassNotes/32.TerraformFunctionsAndDynamicBlocks12-05-2024/notes.md: -------------------------------------------------------------------------------- 1 | Here are notes for the given Terraform code: 2 | 3 | - The code defines a Terraform variable named `storage_account_map` which is expected to be a map. This variable is not explicitly defined in the provided code snippet, so its structure and content are assumed to be provided elsewhere in the Terraform configuration. 4 | 5 | - The code also defines an Azure Storage Account resource named `example` using the `azurerm_storage_account` resource type. 6 | 7 | - The `for_each` argument is used to iterate over the elements of `var.storage_account_map`, creating an instance of the `azurerm_storage_account` resource for each element. 8 | 9 | - Inside the resource block, several attributes of the storage account are configured using the `each.value` syntax to access the values of the current element being iterated over. 10 | 11 | - The attributes being configured include the `name`, `resource_group_name`, `location`, `account_tier`, and `account_replication_type`. 12 | 13 | - Additionally, the resource includes a dynamic block named `network_rules`, which allows for the configuration of network rules for the storage account. The `for_each` argument of the dynamic block iterates over the `network_rules` attribute of each element in `var.storage_account_map`. 14 | 15 | - Inside the `network_rules` block, the `default_action` attribute is configured using the `lookup` function to access the value of `default_action` from the `network_rules` attribute of the current element being iterated over. If `default_action` is not present in the `network_rules` attribute, it defaults to `null`. 16 | 17 | This code snippet demonstrates how to use the `for_each` meta-argument to create multiple instances of a resource based on the contents of a map variable, and how to use dynamic blocks to handle variable sub-blocks within a resource. -------------------------------------------------------------------------------- /ClassNotes/32.TerraformFunctionsAndDynamicBlocks12-05-2024/storage_account.tf: -------------------------------------------------------------------------------- 1 | variable "storage_account_map" {} 2 | 3 | resource "azurerm_storage_account" "example" { 4 | for_each = var.storage_account_map 5 | name = each.value.storage_account_name 6 | resource_group_name = each.value.resource_group_name 7 | location = each.value.location 8 | account_tier = each.value.account_tier 9 | account_replication_type = each.value.account_replication_type 10 | 11 | dynamic "network_rules" { 12 | for_each = lookup(each.value, "network_rules", {}) 13 | content { 14 | default_action = lookup(network_rules.value, "default_action", null) 15 | } 16 | } 17 | 18 | } 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ClassNotes/32.TerraformFunctionsAndDynamicBlocks12-05-2024/terraform.tfvars: -------------------------------------------------------------------------------- 1 | storage_account_map = { 2 | st1 = { 3 | storage_account_name = "dhondhusa" 4 | resource_group_name = "rg_devopsinsders" 5 | location = "westeurope" 6 | account_tier = "Standard" 7 | account_replication_type = "GRS" 8 | } 9 | st2 = { 10 | storage_account_name = "dhondhusa1" 11 | resource_group_name = "rg_devopsinsders" 12 | location = "westeurope" 13 | account_tier = "Standard" 14 | account_replication_type = "GRS" 15 | network_rules = { 16 | default_action = "Deny" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ClassNotes/33.GitBasics#1-18-05-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/33.GitBasics#1-18-05-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/34.GitBasics#2-19-05-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/34.GitBasics#2-19-05-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/34.GitBasics#2-19-05-2024/notes.md: -------------------------------------------------------------------------------- 1 | Here are detailed notes on `git add`, `git commit`, `git restore`, `git restore --staged`, and `git checkout` for reverting a commit: 2 | 3 | ## `git add` 4 | 5 | ### Purpose: 6 | - Stages changes (files or directories) for the next commit. 7 | 8 | ### Usage: 9 | - `git add `: Stages a specific file. 10 | - `git add `: Stages all changes in a directory. 11 | - `git add .`: Stages all changes in the current directory and subdirectories. 12 | - `git add -p`: Interactively stages changes, allowing you to review and stage specific hunks of changes. 13 | 14 | ### Example: 15 | ```sh 16 | git add file1.txt 17 | git add src/ 18 | git add . 19 | git add -p 20 | ``` 21 | 22 | ## `git commit` 23 | 24 | ### Purpose: 25 | - Records the staged changes in the local repository with a message describing the changes. 26 | 27 | ### Usage: 28 | - `git commit -m "commit message"`: Commits staged changes with a message. 29 | - `git commit`: Opens the default text editor to type a commit message. 30 | - `git commit --amend`: Edits the last commit, adding any new staged changes and allowing modification of the commit message. 31 | 32 | ### Example: 33 | ```sh 34 | git commit -m "Add new feature" 35 | git commit 36 | git commit --amend -m "Fix typo in new feature" 37 | ``` 38 | 39 | ## `git restore` 40 | 41 | ### Purpose: 42 | - Discards changes in the working directory or in the staging area. 43 | 44 | ### Usage: 45 | - `git restore `: Restores the specified file to the state of the last commit, discarding any changes. 46 | - `git restore --staged `: Unstages the specified file, keeping the changes in the working directory. 47 | 48 | ### Example: 49 | ```sh 50 | git restore file1.txt 51 | git restore --staged file1.txt 52 | ``` 53 | 54 | ### Use Cases: 55 | - Use `git restore` when you want to discard local changes in your working directory. 56 | - Use `git restore --staged` when you want to unstage changes without discarding them. 57 | 58 | ## `git restore --staged` 59 | 60 | ### Purpose: 61 | - Unstages changes that have been added to the staging area, but keeps the changes in the working directory. 62 | 63 | ### Usage: 64 | - `git restore --staged `: Unstages a specific file. 65 | - `git restore --staged .`: Unstages all files. 66 | 67 | ### Example: 68 | ```sh 69 | git restore --staged file1.txt 70 | git restore --staged . 71 | ``` 72 | 73 | ### Use Case: 74 | - Use this when you mistakenly stage changes and want to move them back to the working directory without losing the modifications. 75 | 76 | By understanding and using these Git commands appropriately, you can efficiently manage your codebase, stage changes, commit them, and revert to previous states when necessary. -------------------------------------------------------------------------------- /ClassNotes/35.GitBranchAndMerge-25-05-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/35.GitBranchAndMerge-25-05-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/36.GitOnServer-26-05-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/36.GitOnServer-26-05-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/37.ProdTFRepoStructure-01-06-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/environments/dev/main.tf: -------------------------------------------------------------------------------- 1 | variable "rg_input" {} 2 | 3 | module "rgs" { 4 | source = "../../modules/azurerm_rg" 5 | rgs = var.rg_input 6 | } 7 | 8 | module "vnet" { 9 | source = "../../modules/azurerm_vnet" 10 | vnet_name = "vnet1" 11 | resource_group_name = "rg1" 12 | location = "westeurope" 13 | } 14 | -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/environments/dev/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.106.1" 6 | } 7 | } 8 | backend "azurerm" { 9 | resource_group_name = "rg-storage-account" 10 | storage_account_name = "rajnibackend" 11 | container_name = "dev" 12 | key = "dev.terraform.tfstate" 13 | } 14 | } 15 | 16 | provider "azurerm" { 17 | features {} 18 | } 19 | -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/environments/dev/terraform.tfvars: -------------------------------------------------------------------------------- 1 | rg_input = { 2 | rg1 = { 3 | name = "rg-dev-todo-devopsinsiders" 4 | location = "westeurope" 5 | } 6 | rg2 = { 7 | name = "rg-dev-dhondhu-devopsinsiders" 8 | location = "westeurope" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/environments/prod/main.tf: -------------------------------------------------------------------------------- 1 | variable "rg_input" {} 2 | 3 | module "rgs" { 4 | source = "../../modules/azurerm_rg" 5 | rgs = var.rg_input 6 | } -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/environments/prod/provider.tf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/37.ProdTFRepoStructure-01-06-2024/environments/prod/provider.tf -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/environments/prod/terraform.tfvars: -------------------------------------------------------------------------------- 1 | rg_input = { 2 | rg1 = { 3 | name = "rg-prod-todo-devopsinsiders" 4 | location = "westeurope" 5 | } 6 | rg2 = { 7 | name = "rg-prod-dhondhu-devopsinsiders" 8 | location = "westeurope" 9 | } 10 | rg3 = { 11 | name = "rg-prod-prahladchacha-devopsinsiders" 12 | location = "westeurope" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/environments/qa/main.tf: -------------------------------------------------------------------------------- 1 | variable "rg_input" {} 2 | 3 | module "rgs" { 4 | source = "../../modules/azurerm_rg" 5 | rgs = var.rg_input 6 | } -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/environments/qa/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.106.1" 6 | } 7 | } 8 | backend "azurerm" { 9 | resource_group_name = "rg-storage-account" 10 | storage_account_name = "rajnibackend" 11 | container_name = "qabackend" 12 | key = "qa.terraform.tfstate" 13 | } 14 | } 15 | 16 | provider "azurerm" { 17 | features {} 18 | } 19 | -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/environments/qa/terraform.tfvars: -------------------------------------------------------------------------------- 1 | rg_input = { 2 | rg1 = { 3 | name = "rg-devopsinsiders-qa" 4 | location = "westeurope" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/modules/azurerm_rg/main.tf: -------------------------------------------------------------------------------- 1 | variable "rgs" { 2 | type = map(any) 3 | } 4 | 5 | resource "azurerm_resource_group" "example" { 6 | for_each = var.rgs 7 | name = each.value.name 8 | location = each.value.location 9 | } 10 | -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/modules/azurerm_vm/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/37.ProdTFRepoStructure-01-06-2024/modules/azurerm_vm/.gitkeep -------------------------------------------------------------------------------- /ClassNotes/37.ProdTFRepoStructure-01-06-2024/modules/azurerm_vnet/main.tf: -------------------------------------------------------------------------------- 1 | variable "vnet_name" {} 2 | variable "location" {} 3 | variable "resource_group_name" {} 4 | 5 | resource "azurerm_virtual_network" "example" { 6 | name = var.vnet_name 7 | location = var.location 8 | resource_group_name = var.resource_group_name 9 | address_space = ["10.0.0.0/16"] 10 | } -------------------------------------------------------------------------------- /ClassNotes/38.AzureDevOpsBasics-02-06-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/38.AzureDevOpsBasics-02-06-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/39.SelfHostedAgent-08-06-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/39.SelfHostedAgent-08-06-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/40. AzurePipelines-15-06-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/40. AzurePipelines-15-06-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/41.AzurePipelines-16-06-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/41.AzurePipelines-16-06-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/41.AzurePipelines-16-06-2024/notes.md: -------------------------------------------------------------------------------- 1 | ### Class Notes: Creating a Classic Build Pipeline in Azure DevOps 2 | 3 | #### Overview 4 | In today's class, we walked through the process of creating a classic build pipeline in Azure DevOps. We focused on adding an agent job and configuring it to run a series of PowerShell tasks. The tasks included logging into Azure using a service principal and executing Terraform commands to manage infrastructure. 5 | 6 | #### Steps to Create a Classic Build Pipeline 7 | 8 | 1. **Create a New Build Pipeline** 9 | - Navigate to your Azure DevOps project. 10 | - Go to Pipelines > Builds. 11 | - Click on "New pipeline." 12 | - Choose "Use the classic editor" for the step-by-step creation process. 13 | - Select your repository and click "Continue." 14 | 15 | 2. **Add an Agent Job** 16 | - In the pipeline designer, you will see a default agent job (Agent job 1). 17 | - Ensure the agent pool is selected appropriately (e.g., Azure Pipelines). 18 | 19 | 3. **Add PowerShell Tasks** 20 | - Click on the "+" sign within Agent job 1 to add a new task. 21 | - Search for "PowerShell" and add a PowerShell task. 22 | - Repeat this process to add multiple PowerShell tasks for the different commands we need to run. 23 | 24 | 4. **Configure PowerShell Tasks** 25 | - **Task 1: Change Directory** 26 | - Display name: `Change Directory to s` 27 | - Type: Inline Script 28 | - Script: `cd s` 29 | 30 | - **Task 2: Azure Login** 31 | - Display name: `Azure Login` 32 | - Type: Inline Script 33 | - Script: 34 | ```powershell 35 | az login --service-principal -u -p --tenant 36 | ``` 37 | - Replace ``, ``, and `` with your service principal details. 38 | 39 | - **Task 3: Terraform Init** 40 | - Display name: `Terraform Init` 41 | - Type: Inline Script 42 | - Script: `terraform init` 43 | 44 | - **Task 4: Terraform Plan** 45 | - Display name: `Terraform Plan` 46 | - Type: Inline Script 47 | - Script: `terraform plan` 48 | 49 | - **Task 5: Terraform Apply** 50 | - Display name: `Terraform Apply` 51 | - Type: Inline Script 52 | - Script: `terraform apply -auto-approve` 53 | 54 | 5. **Save and Queue the Pipeline** 55 | - Once all tasks are added and configured, click "Save & queue" to save your pipeline. 56 | - Provide a commit message and select the branch to commit to. 57 | - Click "Save and run" to start the pipeline execution. 58 | 59 | 6. **Monitor the Pipeline** 60 | - Navigate to Pipelines > Builds. 61 | - Click on the running pipeline to monitor the status and view logs for each task. 62 | 63 | #### Summary 64 | In this session, we created a classic build pipeline in Azure DevOps, added an agent job, and configured PowerShell tasks to perform essential steps for managing infrastructure using Terraform. We also demonstrated how to log in to Azure using a service principal within the pipeline. 65 | 66 | Feel free to reach out if you have any questions or need further assistance with the pipeline configuration. -------------------------------------------------------------------------------- /ClassNotes/41.AzurePipelines-16-06-2024/pipeline_snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/41.AzurePipelines-16-06-2024/pipeline_snap.png -------------------------------------------------------------------------------- /ClassNotes/42.AzurePipelines-22-06-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/42.AzurePipelines-22-06-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/42.AzurePipelines-22-06-2024/notes.md: -------------------------------------------------------------------------------- 1 | ### Class Notes: Creating a Classic Build Pipeline in Azure DevOps 2 | 3 | #### Overview 4 | In today's session, we covered the steps to create a classic build pipeline in Azure DevOps. We explored the options available in the Azure DevOps UI and discussed the types of jobs: agent job and agentless job. Finally, we created an agent job and set up a Terraform pipeline using the Terraform extension with an Azure service connection. 5 | 6 | #### Steps to Create a Classic Build Pipeline 7 | 8 | 1. **Navigate to Azure DevOps:** 9 | - Open your Azure DevOps organization. 10 | - Select your project. 11 | 12 | 2. **Create a New Pipeline:** 13 | - Click on "Pipelines" from the left-hand menu. 14 | - Select "Builds". 15 | - Click on "New pipeline" and then choose "Use the classic editor". 16 | 17 | 3. **Select a Source:** 18 | - Choose the repository where your code is stored. 19 | - Select the correct branch and repository type (e.g., Azure Repos Git, GitHub, etc.). 20 | 21 | 4. **Configure the Pipeline:** 22 | - **Pipeline Name:** Give your pipeline a meaningful name. 23 | - **Agent Pool:** Select the appropriate agent pool for your build jobs. 24 | - **Options:** Explore additional options like pipeline triggers, retention, and settings. 25 | 26 | 5. **Add Jobs to the Pipeline:** 27 | - **Agent Job:** This job runs on an agent. It's used to execute tasks that require a build agent. 28 | - Click on "Add" and select "Agent Job". 29 | - Configure the agent job with necessary settings like agent specification (e.g., Ubuntu, Windows). 30 | - **Agentless Job:** This job doesn't require a build agent and runs without any agent allocation. 31 | - Click on "Add" and select "Agentless Job" if needed (optional for this exercise). 32 | 33 | 6. **Add Tasks to the Agent Job:** 34 | - Click on the "plus" (+) icon within the agent job to add tasks. 35 | - Search for "Terraform" and add the Terraform task to the job. 36 | 37 | 7. **Configure the Terraform Task:** 38 | - **Display Name:** Provide a name for the task (e.g., "Run Terraform"). 39 | - **Terraform Version:** Select the appropriate Terraform version. 40 | - **Command:** Choose the Terraform command you want to run (e.g., init, plan, apply). 41 | - **Configuration Directory:** Specify the directory where your Terraform configuration files are located. 42 | 43 | 8. **Azure Service Connection:** 44 | - Ensure you have an Azure service connection set up to authenticate and authorize the pipeline to interact with your Azure resources. 45 | - Go to "Project Settings" > "Service connections" > "New service connection". 46 | - Select "Azure Resource Manager" and follow the prompts to create and configure the service connection. 47 | 48 | 9. **Save and Queue the Pipeline:** 49 | - Click on "Save & queue" to save your pipeline configuration and start the build process. 50 | - Monitor the build process and review logs for any issues or errors. 51 | 52 | #### Summary 53 | In this session, we successfully created a classic build pipeline in Azure DevOps. We explored the UI options available, discussed the differences between agent and agentless jobs, and created an agent job. Finally, we set up a Terraform pipeline using the Terraform extension with an Azure service connection. 54 | 55 | Feel free to experiment with different tasks and configurations to gain a deeper understanding of the Azure DevOps build pipelines. -------------------------------------------------------------------------------- /ClassNotes/42.AzurePipelines-22-06-2024/pipeline_snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/42.AzurePipelines-22-06-2024/pipeline_snap.png -------------------------------------------------------------------------------- /ClassNotes/43.AzureClassicPipelines-23-06-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/43.AzureClassicPipelines-23-06-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/43.AzureClassicPipelines-23-06-2024/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/43.AzureClassicPipelines-23-06-2024/image.png -------------------------------------------------------------------------------- /ClassNotes/44.PipelineTriggers-29-06-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/44.PipelineTriggers-29-06-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/44.PipelineTriggers-29-06-2024/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/44.PipelineTriggers-29-06-2024/image.png -------------------------------------------------------------------------------- /ClassNotes/44.PipelineTriggers-29-06-2024/notes.md: -------------------------------------------------------------------------------- 1 | ### Class Notes: Triggers in Azure Classic Pipelines 2 | 3 | ![alt text](image.png) 4 | 5 | #### Overview 6 | In Azure DevOps, a trigger is an event that causes a pipeline to run. Triggers can be configured to start builds automatically when changes are made to the codebase, ensuring continuous integration and deployment. In the context of Azure Classic Pipelines, triggers play a crucial role in automating the build and release process. 7 | 8 | #### Types of Triggers 9 | 10 | 1. **CI (Continuous Integration) Triggers**: 11 | - Automatically trigger a build when code changes are pushed to a repository. 12 | - Ensure that the code is always in a deployable state by frequently integrating changes. 13 | 14 | 2. **Scheduled Triggers**: 15 | - Trigger builds at specified times, such as nightly builds. 16 | - Useful for running tests and other tasks at regular intervals. 17 | 18 | 3. **Pull Request (PR) Triggers**: 19 | - Trigger builds when a pull request is created or updated. 20 | - Ensure that code changes in pull requests meet the necessary quality and integration standards before merging. 21 | 22 | #### Configuring CI Triggers in Classic Pipelines 23 | 24 | ##### From a Specific Branch 25 | To configure a CI trigger for a specific branch, you need to define which branch should trigger the build. This can be done using the Azure DevOps classic pipeline editor. 26 | 27 | 1. **Open the Pipeline Editor**: 28 | - Navigate to the Azure DevOps project. 29 | - Go to Pipelines > Builds. 30 | - Select the pipeline you want to configure. 31 | - Click on "Edit" to open the pipeline editor. 32 | 33 | 2. **Configure the Trigger**: 34 | - In the pipeline editor, click on the "Triggers" tab. 35 | - Enable the "Continuous integration" trigger. 36 | - Specify the branch name that should trigger the build. For example, `refs/heads/main` to trigger builds on changes to the main branch. 37 | - Save the changes. 38 | 39 | ##### From a Specific Path 40 | To configure a CI trigger for changes in a specific path, you need to set up path filters. This ensures that only changes to certain parts of the repository will trigger a build. 41 | 42 | 1. **Open the Pipeline Editor**: 43 | - Follow the same steps as above to navigate to the pipeline editor. 44 | 45 | 2. **Configure the Path Filter**: 46 | - In the "Triggers" tab, enable the "Continuous integration" trigger if not already enabled. 47 | - Click on "Path filters". 48 | - Add the paths that should trigger the build. For example, to trigger builds for changes in the `src` directory, add `src/*`. 49 | - Save the changes. 50 | 51 | #### Benefits of CI Triggers 52 | - **Automation**: Reduces manual intervention by automatically triggering builds. 53 | - **Early Detection**: Catches integration issues early by frequently building and testing code changes. 54 | - **Consistency**: Ensures that the codebase is always in a deployable state. 55 | 56 | #### Best Practices 57 | - **Branch Policies**: Implement branch policies to enforce quality standards and integrate CI triggers with pull requests. 58 | - **Path Filters**: Use path filters to optimize build times by only triggering builds for relevant changes. 59 | - **Build Notifications**: Set up notifications to stay informed about build status and failures. 60 | 61 | By understanding and configuring triggers in Azure Classic Pipelines, you can enhance your DevOps processes and ensure a smooth and efficient CI/CD pipeline. -------------------------------------------------------------------------------- /ClassNotes/45.ManualApproval-tfsec-terrascan-30-06-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/45.ManualApproval-tfsec-terrascan-30-06-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/45.ManualApproval-tfsec-terrascan-30-06-2024/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/45.ManualApproval-tfsec-terrascan-30-06-2024/image.png -------------------------------------------------------------------------------- /ClassNotes/45.ManualApproval-tfsec-terrascan-30-06-2024/notes.md: -------------------------------------------------------------------------------- 1 | # Agent Job 2 | 3 | ![alt text](image.png) 4 | 5 | An **Agent Job** in Azure DevOps is a collection of tasks that run sequentially on an agent. Agents are installed on machines and are responsible for executing the jobs defined in your pipeline. Here are some key points about agent jobs: 6 | 7 | - **Agent Pool**: Agent jobs run on agents that are part of an agent pool. Agent pools can contain self-hosted or Microsoft-hosted agents. 8 | - **Tasks**: Tasks within an agent job can include anything from building code, running tests, deploying applications, and more. 9 | - **Dependencies**: Tasks within an agent job can have dependencies, meaning one task can wait for another to complete before starting. 10 | - **Environment**: Agent jobs run in an environment specified by the agent, which can include specific OS, installed software, and network configurations. 11 | 12 | # Agentless Job 13 | An **Agentless Job** runs tasks that do not require a build agent. These jobs are useful for tasks that are purely server-side operations, such as approvals or manual interventions. Key points include: 14 | 15 | - **Server-Side Tasks**: Agentless jobs run tasks on the Azure DevOps server instead of a build agent. 16 | - **Manual Interventions**: Commonly used for manual approval steps, where human intervention is required to proceed with the pipeline. 17 | - **No Resource Consumption**: Since these jobs do not use build agents, they do not consume agent resources. 18 | 19 | # Manual Approval Task 20 | A **Manual Approval Task** is a way to include human intervention in your pipeline. This task pauses the pipeline execution until a designated user approves or rejects the continuation of the pipeline. Important aspects are: 21 | 22 | - **Approval Request**: Sends a notification to the approvers defined in the task configuration. 23 | - **Approvers**: A list of users or groups who can approve or reject the task. 24 | - **Timeout**: Specifies how long the task waits for an approval before timing out and failing the pipeline. 25 | - **Comments**: Approvers can leave comments when they approve or reject the task, providing context for their decision. 26 | 27 | # Adding TFSec in Azure Classic Pipeline 28 | TFSec is a static analysis security scanner for Terraform code. To integrate TFSec in an Azure DevOps classic pipeline, follow these steps: 29 | 30 | 1. **Install TFSec**: Ensure that TFSec is installed on the agent. You can use a script task to install TFSec if it's not already available. 31 | 32 | 2. **Create a Task to Run TFSec**: 33 | - **Add a Command Line Task**: Use this task to execute TFSec commands. 34 | - **Script Path**: Specify the path to the TFSec executable. 35 | - **Arguments**: Include the necessary arguments for running TFSec, such as the directory of your Terraform code. 36 | 37 | 3. **Analyze the Output**: 38 | - **Success Criteria**: Define what constitutes a successful run of TFSec (e.g., no high-severity issues found). 39 | - **Error Handling**: Decide how to handle any security issues detected by TFSec. You can fail the pipeline if issues are found or log the issues for further review. 40 | 41 | By incorporating TFSec in your pipeline, you can ensure that your Terraform code is analyzed for security vulnerabilities before deployment, enhancing the security posture of your infrastructure as code. 42 | 43 | These notes cover the essentials of agent jobs, agentless jobs, manual approval tasks, and the integration of TFSec in Azure DevOps classic pipelines without delving into YAML code specifics. -------------------------------------------------------------------------------- /ClassNotes/46.YAML-06-07-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/46.YAML-06-07-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/47.YAMLPipelines-07-07-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/47.YAMLPipelines-07-07-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/48.PipelineWithJobs-13-07-2024/azure-pipeline.yml: -------------------------------------------------------------------------------- 1 | name: MeriPyariPipeline 2 | pool: Default 3 | 4 | trigger: 5 | - master 6 | - develop 7 | 8 | jobs: 9 | - job: Job1 10 | displayName: "TerraformInitPlan" 11 | steps: 12 | - task: TerraformInstaller@1 13 | inputs: 14 | terraformVersion: 'latest' 15 | - task: TerraformTaskV4@4 16 | inputs: 17 | provider: 'azurerm' 18 | command: 'init' 19 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 20 | backendServiceArm: 'Ratan-SC' 21 | backendAzureRmResourceGroupName: 'pkrg' 22 | backendAzureRmStorageAccountName: 'mystorage12345126' 23 | backendAzureRmContainerName: 'pkcontainer' 24 | backendAzureRmKey: 'dhondhu007.tfstate' 25 | - task: TerraformTaskV4@4 26 | inputs: 27 | provider: 'azurerm' 28 | command: 'plan' 29 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 30 | environmentServiceNameAzureRM: 'Ratan-SC' 31 | 32 | 33 | - job: ManualApprovalJob 34 | dependsOn: Job1 35 | pool: server 36 | steps: 37 | - task: ManualValidation@1 38 | inputs: 39 | notifyUsers: 'abc@abc.com' 40 | instructions: 'bhai terraform plan dekh le... nahi to infra fatt jaega..' 41 | 42 | - job: Job2 43 | dependsOn: ManualApprovalJob 44 | displayName: "TerraformApply" 45 | pool: Default 46 | steps: 47 | - task: TerraformTaskV4@4 48 | inputs: 49 | provider: 'azurerm' 50 | command: 'init' 51 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 52 | backendServiceArm: 'Ratan-SC' 53 | backendAzureRmResourceGroupName: 'pkrg' 54 | backendAzureRmStorageAccountName: 'mystorage12345126' 55 | backendAzureRmContainerName: 'pkcontainer' 56 | backendAzureRmKey: 'dhondhu007.tfstate' 57 | - task: TerraformTaskV4@4 58 | inputs: 59 | provider: 'azurerm' 60 | command: 'apply' 61 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 62 | environmentServiceNameAzureRM: 'Ratan-SC' -------------------------------------------------------------------------------- /ClassNotes/48.PipelineWithJobs-13-07-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/48.PipelineWithJobs-13-07-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/48.PipelineWithJobs-13-07-2024/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/48.PipelineWithJobs-13-07-2024/image.png -------------------------------------------------------------------------------- /ClassNotes/49.CompleteRecap&PipelineWithStages-14-07-2024/azure-pipeline.yml: -------------------------------------------------------------------------------- 1 | pool: Default 2 | 3 | trigger: none 4 | 5 | stages: 6 | - stage: terraforminitandplan 7 | displayName: Terraform Init And Plan 8 | pool: Default 9 | jobs: 10 | - job: terraforminitplan 11 | steps: 12 | - task: TerraformTaskV4@4 13 | inputs: 14 | provider: 'azurerm' 15 | command: 'init' 16 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 17 | backendServiceArm: 'Ratan-SC' 18 | backendAzureRmResourceGroupName: 'pkrg' 19 | backendAzureRmStorageAccountName: 'mystorage12345126' 20 | backendAzureRmContainerName: 'pkcontainer' 21 | backendAzureRmKey: 'bhondhu.tfstate' 22 | - task: TerraformTaskV4@4 23 | inputs: 24 | provider: 'azurerm' 25 | command: 'plan' 26 | workingDirectory: '$(System.DefaultWorkingDirectory)/environment/dev' 27 | environmentServiceNameAzureRM: 'Ratan-SC' 28 | 29 | - stage: terraformapply 30 | dependsOn: terraforminitandplan 31 | displayName: Terraform Apply 32 | jobs: 33 | - job: ManualApproval 34 | displayName: Manual Approval 35 | pool: server 36 | steps: 37 | - task: ManualValidation@1 38 | inputs: 39 | notifyUsers: 'abc@abc.com' 40 | instructions: 'Bhai pichli stage me plan check karle.' 41 | - job: TerraformApply 42 | dependsOn: ManualApproval 43 | displayName: Terraform Apply 44 | steps: 45 | - task: TerraformTaskV4@4 46 | inputs: 47 | provider: 'azurerm' 48 | command: 'init' 49 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 50 | backendServiceArm: 'Ratan-SC' 51 | backendAzureRmResourceGroupName: 'pkrg' 52 | backendAzureRmStorageAccountName: 'mystorage12345126' 53 | backendAzureRmContainerName: 'pkcontainer' 54 | backendAzureRmKey: 'bhondhu.tfstate' 55 | 56 | - task: TerraformTaskV4@4 57 | inputs: 58 | provider: 'azurerm' 59 | command: 'apply' 60 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 61 | environmentServiceNameAzureRM: 'Ratan-SC' -------------------------------------------------------------------------------- /ClassNotes/49.CompleteRecap&PipelineWithStages-14-07-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/49.CompleteRecap&PipelineWithStages-14-07-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/49.CompleteRecap&PipelineWithStages-14-07-2024/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/49.CompleteRecap&PipelineWithStages-14-07-2024/image.png -------------------------------------------------------------------------------- /ClassNotes/50.AzurePipelinesBestPracticies20-07-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/50.AzurePipelinesBestPracticies20-07-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/50.AzurePipelinesBestPracticies20-07-2024/main.yaml: -------------------------------------------------------------------------------- 1 | trigger: 2 | branches: 3 | include: 4 | - main 5 | paths: 6 | include: 7 | - /environments/dev 8 | 9 | pool: Default 10 | 11 | stages: 12 | - stage: TerraformInitAndPlan 13 | displayName: Terraform Init and Plan 14 | jobs: 15 | - job: InitAndPlanJob 16 | displayName: Init and Plan Job 17 | steps: 18 | - task: TerraformTaskV4@4 19 | displayName: "Terraform Init" 20 | inputs: 21 | provider: 'azurerm' 22 | command: 'init' 23 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 24 | backendServiceArm: 'Ratan-SC' 25 | backendAzureRmResourceGroupName: 'pkrg' 26 | backendAzureRmStorageAccountName: 'merapehlastorage' 27 | backendAzureRmContainerName: 'newcant' 28 | backendAzureRmKey: 'jamesbond.terraform.tfstate' 29 | - task: TerraformTaskV4@4 30 | displayName: "Terraform Plan" 31 | inputs: 32 | provider: 'azurerm' 33 | command: 'plan' 34 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 35 | environmentServiceNameAzureRM: 'Ratan-SC' 36 | - stage: TerraformApply 37 | displayName: Terraform Apply 38 | jobs: 39 | - job: ManualApprovalJob 40 | displayName: Manual Approval Job 41 | pool: server 42 | steps: 43 | - task: ManualValidation@1 44 | inputs: 45 | notifyUsers: 'abc@abc.com' 46 | instructions: 'Please validate the plan and continue' 47 | - job: TerraformApply 48 | dependsOn: ManualApprovalJob 49 | displayName: Terraform Apply 50 | steps: 51 | - task: TerraformTaskV4@4 52 | inputs: 53 | provider: 'azurerm' 54 | command: 'init' 55 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 56 | backendServiceArm: 'Ratan-SC' 57 | backendAzureRmResourceGroupName: 'pkrg' 58 | backendAzureRmStorageAccountName: 'merapehlastorage' 59 | backendAzureRmContainerName: 'newcant' 60 | backendAzureRmKey: 'jamesbond.terraform.tfstate' 61 | - task: TerraformTaskV4@4 62 | inputs: 63 | provider: 'azurerm' 64 | command: 'apply' 65 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 66 | environmentServiceNameAzureRM: 'Ratan-SC' 67 | -------------------------------------------------------------------------------- /ClassNotes/50.AzurePipelinesBestPracticies20-07-2024/pr.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | 3 | pool: Default 4 | 5 | stages: 6 | - stage: DEVTerraformInitAndPlan 7 | displayName: DEV Terraform Init and Plan 8 | jobs: 9 | - job: InitAndPlanJob 10 | displayName: Init and Plan Job 11 | steps: 12 | - task: TerraformTaskV4@4 13 | displayName: "Terraform Init" 14 | inputs: 15 | provider: 'azurerm' 16 | command: 'init' 17 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 18 | backendServiceArm: 'Ratan-SC' 19 | backendAzureRmResourceGroupName: 'pkrg' 20 | backendAzureRmStorageAccountName: 'merapehlastorage' 21 | backendAzureRmContainerName: 'newcant' 22 | backendAzureRmKey: 'jamesbond.terraform.tfstate' 23 | - task: TerraformTaskV4@4 24 | displayName: "Terraform Plan" 25 | inputs: 26 | provider: 'azurerm' 27 | command: 'plan' 28 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/dev' 29 | environmentServiceNameAzureRM: 'Ratan-SC' 30 | 31 | - stage: QATerraformInitAndPlan 32 | displayName: QA Terraform Init and Plan 33 | jobs: 34 | - job: InitAndPlanJob 35 | displayName: Init and Plan Job 36 | steps: 37 | - task: TerraformTaskV4@4 38 | displayName: "Terraform Init" 39 | inputs: 40 | provider: 'azurerm' 41 | command: 'init' 42 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/qa' 43 | backendServiceArm: 'Ratan-SC' 44 | backendAzureRmResourceGroupName: 'pkrg' 45 | backendAzureRmStorageAccountName: 'merapehlastorage' 46 | backendAzureRmContainerName: 'newcant' 47 | backendAzureRmKey: 'qajamesbond.terraform.tfstate' 48 | - task: TerraformTaskV4@4 49 | displayName: "Terraform Plan" 50 | inputs: 51 | provider: 'azurerm' 52 | command: 'plan' 53 | workingDirectory: '$(System.DefaultWorkingDirectory)/environments/qa' 54 | environmentServiceNameAzureRM: 'Ratan-SC' -------------------------------------------------------------------------------- /ClassNotes/51.PracticeClass-21-07-2024/notes.md: -------------------------------------------------------------------------------- 1 | Practice Class -------------------------------------------------------------------------------- /ClassNotes/52.AzurePipelines-27-07-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/52.AzurePipelines-27-07-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/52.AzurePipelines-28-07-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/52.AzurePipelines-28-07-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/53.AzurePipelines-3-08-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/53.AzurePipelines-3-08-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/54.AzurePipelines-04-08-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/54.AzurePipelines-04-08-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/55.AzurePipelines-10-08-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/55.AzurePipelines-10-08-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/56.AzurePipelines-11-08-2024/azure-pipeline.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | 3 | pool: Default 4 | 5 | variables: 6 | work_dir: $(System.DefaultWorkingDirectory) 7 | 8 | stages: 9 | - stage: BuildStage 10 | displayName: Build Stage 11 | jobs: 12 | - job: BuildJob 13 | steps: 14 | - task: NodeTool@0 15 | displayName: Node Install hoja 16 | inputs: 17 | versionSource: 'spec' 18 | versionSpec: '16.x' 19 | 20 | - task: Npm@1 21 | displayName: npm install hoja 22 | inputs: 23 | command: 'install' 24 | workingDir: '$(work_dir)' 25 | 26 | - task: Npm@1 27 | displayName: npm build hoja 28 | inputs: 29 | command: 'custom' 30 | workingDir: '$(work_dir)' 31 | customCommand: 'run build' 32 | 33 | - task: PowerShell@2 34 | inputs: 35 | targetType: 'inline' 36 | script: 'ls' 37 | 38 | - task: AzureCLI@2 39 | inputs: 40 | azureSubscription: 'Vikram-Subcription' 41 | scriptType: 'ps' 42 | scriptLocation: 'inlineScript' 43 | inlineScript: 'az storage blob directory upload -c dhondhu --account-name stgvikram -s "$(System.DefaultWorkingDirectory)/build" -d directory --recursive' 44 | 45 | - stage: ReleaseStage 46 | displayName: Release Stage 47 | jobs: 48 | - job: DeployJob 49 | displayName: Deploy karne wala job 50 | steps: 51 | - task: AzureCLI@2 52 | inputs: 53 | azureSubscription: 'Vikram-Subcription' 54 | scriptType: 'ps' 55 | scriptLocation: 'inlineScript' 56 | inlineScript: 'az storage blob directory download -c dhondhu --account-name stgvikram -s "directory/build" -d "$(System.DefaultWorkingDirectory)/release" --recursive' 57 | -------------------------------------------------------------------------------- /ClassNotes/56.AzurePipelines-11-08-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/56.AzurePipelines-11-08-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/57.SonarQube-31-08-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/57.SonarQube-31-08-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/58.JavaApplication-01-09-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/58.JavaApplication-01-09-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/59.DockerTheory-07-09-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/59.DockerTheory-07-09-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/60.BasicsOfDocker-08-09-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/60.BasicsOfDocker-08-09-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/61.DockerPortMapping-14-09-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/61.DockerPortMapping-14-09-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/62.DockerExec-15-09-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/62.DockerExec-15-09-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/63.CustomImages&DockerFileBasics-21-09-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/63.CustomImages&DockerFileBasics-21-09-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/64.DockerFileWorking-22-09-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/64.DockerFileWorking-22-09-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/65.TodoAppOnDockerandMySQL&MultiStageDockerFile-28-09-2024/Dockerfile-Python: -------------------------------------------------------------------------------- 1 | FROM python:3.9.20 2 | WORKDIR /backendapp 3 | COPY . /backendapp/ 4 | RUN pip install -r requirements.txt 5 | CMD uvicorn app:app --host 0.0.0.0 --port 8000 -------------------------------------------------------------------------------- /ClassNotes/65.TodoAppOnDockerandMySQL&MultiStageDockerFile-28-09-2024/Dockerfile-React: -------------------------------------------------------------------------------- 1 | # Maksad - Custom Docker Image bnana hai todo ui ki 2 | FROM node:16.20.2 AS tondumal 3 | WORKDIR /dhondhu 4 | COPY . . 5 | RUN npm install 6 | RUN npm run build 7 | 8 | FROM nginx:alpine 9 | COPY --from=tondumal /dhondhu/build/ /usr/share/nginx/html/ -------------------------------------------------------------------------------- /ClassNotes/65.TodoAppOnDockerandMySQL&MultiStageDockerFile-28-09-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/65.TodoAppOnDockerandMySQL&MultiStageDockerFile-28-09-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/65.TodoAppOnDockerandMySQL&MultiStageDockerFile-28-09-2024/notes.md: -------------------------------------------------------------------------------- 1 | Here’s a simplified explanation of creating individual Dockerfiles for the React UI, Python backend, and MySQL database without using Docker Compose: 2 | 3 | ### 1. **React UI Dockerfile** 4 | - **Objective**: Create a custom Docker image for the todo app's React UI. 5 | - **Steps**: 6 | - **Stage 1: Build** – Use the **Node.js** image to install dependencies and build the React app. 7 | - **Stage 2: Serve** – Use **nginx:alpine** to serve the built static files. 8 | 9 | - **Dockerfile**: 10 | ```Dockerfile 11 | # Stage 1: Build React UI 12 | FROM node:16.20.2 AS tondumal 13 | WORKDIR /dhondhu 14 | COPY . . 15 | RUN npm install 16 | RUN npm run build 17 | 18 | # Stage 2: Serve with Nginx 19 | FROM nginx:alpine 20 | COPY --from=tondumal /dhondhu/build/ /usr/share/nginx/html/ 21 | ``` 22 | 23 | - **Build and Run**: 24 | 1. Build the image: 25 | ```bash 26 | docker build -t todo-ui:latest . 27 | ``` 28 | 2. Run the container: 29 | ```bash 30 | docker run -d -p 3000:80 todo-ui:latest 31 | ``` 32 | The UI will be accessible at `http://localhost:3000`. 33 | 34 | ### 2. **Python Backend Dockerfile** 35 | - **Objective**: Create a Docker image for the Python backend. 36 | - **Steps**: 37 | - Use **Python 3.9** base image. 38 | - Install required Python packages and run the app using **uvicorn**. 39 | 40 | - **Dockerfile**: 41 | ```Dockerfile 42 | FROM python:3.9.20 43 | WORKDIR /backendapp 44 | COPY . /backendapp/ 45 | RUN pip install -r requirements.txt 46 | CMD uvicorn app:app --host 0.0.0.0 --port 8000 47 | ``` 48 | 49 | - **Build and Run**: 50 | 1. Build the image: 51 | ```bash 52 | docker build -t todo-backend:latest . 53 | ``` 54 | 2. Run the container: 55 | ```bash 56 | docker run -d -p 8000:8000 todo-backend:latest 57 | ``` 58 | The backend will be accessible at `http://localhost:8000`. 59 | 60 | ### 3. **MySQL Docker Setup** 61 | - **Objective**: Run MySQL for the todo app's database. 62 | - **Steps**: 63 | - Use the official **MySQL** image and pass environment variables like root password, database, and user credentials. 64 | 65 | - **Run MySQL**: 66 | ```bash 67 | docker run --name mysql-container -e MYSQL_ROOT_PASSWORD=rootpass -e MYSQL_DATABASE=todo_db -e MYSQL_USER=todo_user -e MYSQL_PASSWORD=userpass -p 3306:3306 -d mysql:8.0 68 | ``` 69 | 70 | MySQL will be running on port `3306`. -------------------------------------------------------------------------------- /ClassNotes/66.TodoContinued-29-09-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/66.TodoContinued-29-09-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/67.DockerNetworkandVolume-05-10-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/67.DockerNetworkandVolume-05-10-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/68.KubernetesIntro&Architecture-06-10-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/68.KubernetesIntro&Architecture-06-10-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/69.AzureKubernetesCluster-12-10-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/69.AzureKubernetesCluster-12-10-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/70.K8sPod-13-10-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/70.K8sPod-13-10-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/71.Container2ContainerCommunicationK8sPod-19-10-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/71.Container2ContainerCommunicationK8sPod-19-10-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/72.Pod2PodCommunication-NetworkPolicy-20-10-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/72.Pod2PodCommunication-NetworkPolicy-20-10-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/73.K8SNetworking-26-10-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/73.K8SNetworking-26-10-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/73.K8SNetworking-26-10-2024/notes.md: -------------------------------------------------------------------------------- 1 | # Network Plugins in Kubernetes 2 | 3 | 1. **Definition**: 4 | - Network plugins (CNI - Container Network Interface) enable pod-to-pod communication within a Kubernetes cluster. 5 | 6 | 2. **Purpose**: 7 | - Provide networking capabilities, including IP allocation, routing, and DNS. 8 | - Ensure that pods can communicate with each other and external services. 9 | 10 | 3. **Common Network Plugins**: 11 | - **Calico**: Offers high performance with network security features. 12 | - **Flannel**: Simple overlay network primarily for flat networking. 13 | - **Weave Net**: Focuses on simplicity and ease of use, with built-in encryption. 14 | - **Cilium**: Uses eBPF for networking and security, providing fine-grained control. 15 | - **Kube-router**: A network routing solution that integrates services and network policies. 16 | 17 | 4. **CNI Specifications**: 18 | - Kubernetes uses CNI specifications to manage networking. Each plugin implements its own configuration, which typically includes IP address management, routing, and network policy enforcement. 19 | 20 | 5. **Installation**: 21 | - Network plugins can be deployed via Helm charts, YAML manifests, or as part of Kubernetes installation tools (e.g., kubeadm). 22 | 23 | ### Network Policies in Kubernetes 24 | 25 | 1. **Definition**: 26 | - Network policies define how groups of pods can communicate with each other and with other network endpoints. 27 | 28 | 2. **Purpose**: 29 | - Enhance security by controlling traffic flow at the IP address or port level. 30 | 31 | 3. **Key Concepts**: 32 | - **Pod Selector**: Defines which pods the policy applies to. 33 | - **Ingress**: Rules that specify what traffic is allowed to enter the pods. 34 | - **Egress**: Rules that specify what traffic is allowed to leave the pods. 35 | - **Namespaces**: Network policies can be applied across namespaces, allowing for more granular control. 36 | 37 | 4. **Example Use Cases**: 38 | - Restricting traffic from external sources to specific services. 39 | - Allowing communication only between certain pods within the cluster. 40 | - Isolating workloads for compliance or security purposes. 41 | 42 | 5. **Implementation**: 43 | - Network policies are defined in YAML manifests using `NetworkPolicy` resources. 44 | - Requires a compatible CNI plugin that supports network policies (e.g., Calico, Cilium). 45 | 46 | 6. **Limitations**: 47 | - Network policies are not enforced by default; a compatible CNI must be used. 48 | - Policies are additive; there is no "deny all" by default, unless explicitly defined. 49 | 50 | ### Summary 51 | 52 | - **Network plugins** are essential for establishing a functional network in Kubernetes, enabling communication and IP management among pods. 53 | - **Network policies** enhance security by allowing users to define which pods can communicate, significantly improving the cluster's security posture. 54 | 55 | These components are crucial for managing both the connectivity and security of Kubernetes applications. -------------------------------------------------------------------------------- /ClassNotes/74.PersistentVolumesAndClaims-27-10-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/74.PersistentVolumesAndClaims-27-10-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/74.PersistentVolumesAndClaims-27-10-2024/notes.md: -------------------------------------------------------------------------------- 1 | ### 1. Volumes 2 | - **Definition**: A volume in Kubernetes is a directory that is accessible to containers in a pod. It allows data to persist beyond the life of individual containers. 3 | - **Types**: 4 | - **EmptyDir**: Temporary storage for the pod's lifetime. 5 | - **HostPath**: Mounts a file or directory from the host node's filesystem. 6 | - **ConfigMap/Secret**: Mounts configuration data or secrets as files. 7 | - **NFS**: Network file system for shared access. 8 | - **AWS EBS, GCE PD, Azure Disk**: Cloud provider-specific storage options. 9 | 10 | - **Lifecycle**: Volumes exist as long as the pod exists, not tied to the lifecycle of containers. 11 | 12 | ### 2. Persistent Volumes (PV) 13 | - **Definition**: A Persistent Volume is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using Storage Classes. 14 | - **Characteristics**: 15 | - **Lifecycle**: PVs have a lifecycle independent of the pods that use them. 16 | - **Storage Types**: Can be backed by various storage solutions (NFS, cloud provider storage, etc.). 17 | - **Capacity**: Defined storage capacity, access modes, and reclaim policy (e.g., Retain, Recycle, Delete). 18 | 19 | ### 3. Persistent Volume Claims (PVC) 20 | - **Definition**: A Persistent Volume Claim is a request for storage by a user. It specifies size, access modes, and other attributes. 21 | - **Characteristics**: 22 | - **Binding**: PVCs bind to suitable PVs that match the requested specifications. 23 | - **Dynamic Provisioning**: When a PVC is created, it can trigger the dynamic creation of a PV if configured to do so via a Storage Class. 24 | - **Access Modes**: Claims can request specific access modes, such as ReadWriteOnce, ReadOnlyMany, or ReadWriteMany. 25 | 26 | ### Workflow 27 | 1. **Provisioning**: Admins set up PVs, or they can be dynamically provisioned through PVCs and Storage Classes. 28 | 2. **Claiming**: Users create PVCs to request storage. 29 | 3. **Binding**: Kubernetes binds a PVC to an appropriate PV based on compatibility. 30 | 4. **Usage**: Pods can mount the PVCs to access the underlying storage. 31 | 32 | ### Common Use Cases 33 | - Storing database files. 34 | - Sharing files between multiple pods. 35 | - Backing up application state. 36 | 37 | ### Summary 38 | - **Volumes** are ephemeral and tied to the pod lifecycle. 39 | - **Persistent Volumes** provide durable storage resources that can be reused. 40 | - **Persistent Volume Claims** allow users to request and consume these storage resources efficiently. 41 | 42 | This structure provides flexibility in managing storage in Kubernetes environments, catering to various use cases and requirements. -------------------------------------------------------------------------------- /ClassNotes/75.StorageClasses-02-11-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/75.StorageClasses-02-11-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/76.RequestLimits-Affinity-NodeSelector-03-11-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/76.RequestLimits-Affinity-NodeSelector-03-11-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/77.ReplicaSets-09-11-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/77.ReplicaSets-09-11-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/78.Deployments-10-11-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/78.Deployments-10-11-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/79.Services-16-11-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/79.Services-16-11-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/80.Nginx-AppRouting-Ingress-Controllers-17-11-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/80.Nginx-AppRouting-Ingress-Controllers-17-11-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/81.ApplicationGatewayIngressController-23-11-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/81.ApplicationGatewayIngressController-23-11-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/82.Ollama-OpenWebUI-DoubtClass/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/82.Ollama-OpenWebUI-DoubtClass/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/83.MajorProject-24-11-2024/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/83.MajorProject-24-11-2024/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/84.MajorProject#2-08-01-2025/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/84.MajorProject#2-08-01-2025/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/85.MajorProject#3-15-01-2025/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/85.MajorProject#3-15-01-2025/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/86.SonarQubeConfig-22-01-2025/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/86.SonarQubeConfig-22-01-2025/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/87.Helm#1-29-01-2025/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/87.Helm#1-29-01-2025/diagram.pdf -------------------------------------------------------------------------------- /ClassNotes/88.ArgoCD-05-02-2025/diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/ClassNotes/88.ArgoCD-05-02-2025/diagram.pdf -------------------------------------------------------------------------------- /CodeSamples/Docker/Class1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | # RUN rm /usr/share/nginx/html/index.html 3 | # RUN echo "I am Dhondhu!" > /usr/share/nginx/html/index.html 4 | # COPY index.html /usr/share/nginx/html/ 5 | ADD --chmod=777 https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/main/CodeSamples/index.html /usr/share/nginx/html/ 6 | 7 | RUN rm /usr/share/nginx/html/index.html -------------------------------------------------------------------------------- /CodeSamples/Docker/Class1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | My Beautiful Website Helloi 7 | 63 | 64 | 65 |
66 |

Welcome to My Website Hello

67 |
68 | 74 |
75 |

Your Hero Section

76 |
77 |
78 |
79 |

About Us

80 |

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vitae ligula et orci pretium tincidunt.

81 | 82 |

Our Services

83 |

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vitae ligula et orci pretium tincidunt.

84 | 85 |

Contact Us

86 |

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vitae ligula et orci pretium tincidunt.

87 |
88 |
89 |
90 | © 2024 My Beautiful Website 91 |
92 | 93 | 94 | -------------------------------------------------------------------------------- /CodeSamples/Docker/Class2/Photos/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | # YA YE DO CHALAO 3 | # RUN mkdir /photos 4 | # RUN cd /photos 5 | # OR 6 | # YA NICHE WALA EK CHALAO 7 | WORKDIR /photos 8 | COPY . . -------------------------------------------------------------------------------- /CodeSamples/Docker/Class2/Photos/pexels-danielpool-27913669.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Docker/Class2/Photos/pexels-danielpool-27913669.jpg -------------------------------------------------------------------------------- /CodeSamples/Docker/Class2/Photos/pexels-huy-nguy-n-1640325753-27958425.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Docker/Class2/Photos/pexels-huy-nguy-n-1640325753-27958425.jpg -------------------------------------------------------------------------------- /CodeSamples/Docker/Class4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Love Calculator 7 | 55 | 56 | 57 |
58 |

Love Calculator

59 | 60 | 61 | 62 |
63 |
64 | 65 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /CodeSamples/Docker/Class4/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Loop to create 25 Nginx containers 4 | for i in $(seq 1 30); do 5 | container_name="nginx_$i" 6 | 7 | echo "Creating container: $container_name" 8 | 9 | # Run the Nginx container with a unique name 10 | docker run -d --name $container_name nginx 11 | 12 | # Optionally, you can add some logs or output to indicate success/failure 13 | if [ $? -eq 0 ]; then 14 | echo "Successfully created container: $container_name" 15 | else 16 | echo "Failed to create container: $container_name" 17 | fi 18 | done 19 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/AzureContainerRegistry/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | COPY index.html /usr/share/nginx/html -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/Ingress/ing.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/Ingress/ing.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/Ingress/netflix-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: netflix 5 | spec: 6 | replicas: 5 7 | selector: 8 | matchLabels: 9 | app: netflix 10 | template: 11 | metadata: 12 | labels: 13 | app: netflix 14 | spec: 15 | containers: 16 | - name: netflix 17 | image: devopsinsiders/netflix-clone 18 | ports: 19 | - containerPort: 80 20 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/Ingress/netflix-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: netflix-rule 5 | labels: 6 | name: netflix-rule 7 | spec: 8 | ingressClassName: azure-application-gateway 9 | rules: 10 | - host: netflix.dhondhu.online 11 | http: 12 | paths: 13 | - pathType: Prefix 14 | path: "/" 15 | backend: 16 | service: 17 | name: netflix 18 | port: 19 | number: 80 20 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/Ingress/netflix-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: netflix 5 | spec: 6 | selector: 7 | app: netflix 8 | ports: 9 | - port: 80 10 | targetPort: 80 11 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/Ingress/nginx-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx 5 | spec: 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: nginx 10 | template: 11 | metadata: 12 | labels: 13 | app: nginx 14 | spec: 15 | containers: 16 | - name: nginx 17 | image: nginx 18 | ports: 19 | - containerPort: 80 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/Ingress/nginx-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: nginx-ingress-rule 5 | labels: 6 | name: nginx-ingress-rule 7 | spec: 8 | ingressClassName: nginx 9 | rules: 10 | - host: rahul.dhondhu.online 11 | http: 12 | paths: 13 | - pathType: Prefix 14 | path: "/" 15 | backend: 16 | service: 17 | name: nginx 18 | port: 19 | number: 80 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/Ingress/nginx-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: nginx 5 | spec: 6 | selector: 7 | app: nginx 8 | ports: 9 | - port: 80 10 | targetPort: 80 11 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/Ingress/pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: myapp 5 | labels: 6 | name: myapp 7 | spec: 8 | containers: 9 | - name: myapp 10 | image: nginx 11 | ports: 12 | - containerPort: 80 13 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/Ingress/todoui-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: todoui 5 | spec: 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: todoui 10 | template: 11 | metadata: 12 | labels: 13 | app: todoui 14 | spec: 15 | containers: 16 | - name: todoui 17 | image: devopsinsiders/todoapp-ui-new:v2 18 | ports: 19 | - containerPort: 80 20 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/Ingress/todoui-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: todoui-ingress 5 | labels: 6 | name: todoui-ingress 7 | spec: 8 | ingressClassName: azure-application-gateway 9 | rules: 10 | - host: todoui.dhondhu.online 11 | http: 12 | paths: 13 | - pathType: Prefix 14 | path: "/" 15 | backend: 16 | service: 17 | name: todoui 18 | port: 19 | number: 80 20 | 21 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/Ingress/todoui-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: todoui 5 | spec: 6 | selector: 7 | app: todoui 8 | ports: 9 | - port: 80 10 | targetPort: 80 11 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/PersonalChatGPT/backend-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: ollama-api-deployment 5 | labels: 6 | app: ollama-api 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: ollama-api 12 | template: 13 | tolerations: 14 | - key: gpu 15 | value: true 16 | effect: NoScheule 17 | metadata: 18 | labels: 19 | app: ollama-api 20 | spec: 21 | containers: 22 | - name: ollama-api 23 | image: ollama/ollama 24 | ports: 25 | - containerPort: 11434 26 | lifecycle: 27 | postStart: 28 | exec: 29 | command: 30 | - /bin/sh 31 | - -c 32 | - "ollama run llama3.2:1b" 33 | 34 | --- 35 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/PersonalChatGPT/backend-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: ollama-api-svc 5 | spec: 6 | selector: 7 | app: ollama-api 8 | ports: 9 | - protocol: TCP 10 | port: 80 11 | targetPort: 11434 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/PersonalChatGPT/deploy.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/PersonalChatGPT/deploy.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/PersonalChatGPT/ui-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: webui-deployment 5 | labels: 6 | app: webui 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: webui 12 | template: 13 | metadata: 14 | labels: 15 | app: webui 16 | spec: 17 | containers: 18 | - name: webui 19 | image: ghcr.io/open-webui/open-webui:main 20 | env: 21 | - name: OLLAMA_BASE_URL 22 | value: http://ollama-api-svc.default.svc.cluster.local 23 | ports: 24 | - containerPort: 8080 25 | 26 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/PersonalChatGPT/ui-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: ollama-ui-svc 5 | spec: 6 | type: LoadBalancer 7 | selector: 8 | app: webui 9 | ports: 10 | - protocol: TCP 11 | port: 80 12 | targetPort: 8080 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/class1/dpod-multi-container.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: dpod-multi-container 5 | namespace: default 6 | spec: 7 | containers: 8 | - image: nginx 9 | name: nginx-container 10 | ports: 11 | - containerPort: 80 12 | - image: linuxserver/firefox 13 | name: firefox-container 14 | ports: 15 | - containerPort: 3000 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/class1/pod_document.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/class1/pod_document.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/networkpolicy/anurag-nginx-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: nginx-pod 5 | namespace: anurag-space 6 | spec: 7 | containers: 8 | - image: nginx 9 | name: nginx-container 10 | ports: 11 | - containerPort: 80 12 | 13 | # http://10.244.1.86/ 14 | # 10-244-1-86.default.pod.cluster.local 15 | # 10.244.0.163 16 | #10-244-0-163.anurag-space.pod.cluster.local -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/networkpolicy/firefox-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: firefox-pod 5 | namespace: default 6 | spec: 7 | containers: 8 | - image: linuxserver/firefox 9 | name: fire-container 10 | ports: 11 | - containerPort: 3000 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/networkpolicy/firefoxpod1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: firefox-pod1 5 | namespace: default 6 | spec: 7 | containers: 8 | - image: linuxserver/firefox 9 | name: fire-container 10 | ports: 11 | - containerPort: 3000 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/networkpolicy/namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: anurag-space -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/networkpolicy/networkpolicy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: NetworkPolicy 3 | metadata: 4 | name: nginx-network-policy 5 | namespace: default 6 | spec: 7 | ingress: 8 | - from: 9 | - ipBlock: 10 | cidr: 10.244.0.49/32 11 | ports: 12 | - port: 80 13 | - from: 14 | - ipBlock: 15 | cidr: 10.244.0.201/32 16 | ports: 17 | - port: 80 18 | podSelector: 19 | matchLabels: 20 | papa: dhondhu 21 | 22 | 23 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/networkpolicy/nginx-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: nginx-pod-with-label 5 | namespace: default 6 | labels: 7 | papa: dhondhu 8 | spec: 9 | containers: 10 | - image: nginx 11 | name: nginx-container 12 | ports: 13 | - containerPort: 80 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/networkpolicy/np.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/networkpolicy/np.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/networkpolicy/ns.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/networkpolicy/ns.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/networkpolicy/pod.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/networkpolicy/pod.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/persistantVolume/pod.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/persistantVolume/pod.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/persistantVolume/pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: nginx-pod 5 | namespace: default 6 | spec: 7 | volumes: 8 | - name: dhondhu-vol 9 | persistentVolumeClaim: 10 | claimName: vikram-pvc 11 | containers: 12 | - image: nginx 13 | name: nginx-container 14 | ports: 15 | - containerPort: 80 16 | volumeMounts: 17 | - name: dhondhu-vol 18 | mountPath: /usr/share/nginx/html -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/persistantVolume/pv.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/persistantVolume/pv.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/persistantVolume/pv.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: vikram-pv 5 | namespace: default 6 | labels: 7 | papa: dhondhu 8 | spec: 9 | storageClassName: dhondhu 10 | azureFile: 11 | secretName: azure-secret 12 | shareName: vikram-share 13 | accessModes: 14 | - ReadWriteMany 15 | capacity: 16 | storage: 10Gi 17 | persistentVolumeReclaimPolicy: Retain 18 | 19 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/persistantVolume/pvc.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/persistantVolume/pvc.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/persistantVolume/pvc.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: vikram-pvc 5 | namespace: default 6 | spec: 7 | storageClassName: dhondhu 8 | accessModes: 9 | - ReadWriteMany 10 | resources: 11 | requests: 12 | storage: 10Gi 13 | selector: 14 | matchLabels: 15 | papa: dhondhu -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/persistantVolume/secretcommand.txt: -------------------------------------------------------------------------------- 1 | # kubectl create secret generic azure-secret --from-literal=azurestorageaccountname=abhishek2001mishra9989 --from-literal=azurestorageaccountkey=Qtyk9LsyGfPCz/0k1NXVQwW/eR9jNj7DmZ1Yllee5UZ+twAgo8nhiRK0nnbvJIUBs0uTJXxFT/zk+AStdz7GNQ== -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/replicasetsAndDeployments/deploy.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/replicasetsAndDeployments/deploy.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/replicasetsAndDeployments/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: boss-deployment 5 | namespace: default 6 | spec: 7 | replicas: 5 8 | strategy: 9 | type: RollingUpdate 10 | rollingUpdate: 11 | maxSurge: 25% 12 | maxUnavailable: 25% 13 | selector: 14 | matchLabels: 15 | name: ghanshyam 16 | template: 17 | metadata: 18 | name: nginx-pod 19 | namespace: default 20 | labels: 21 | name: ghanshyam 22 | spec: 23 | containers: 24 | - image: nginx 25 | name: nginx-container 26 | ports: 27 | - containerPort: 80 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/replicasetsAndDeployments/pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: nginx-pod 5 | namespace: default 6 | spec: 7 | containers: 8 | - image: nginx 9 | name: nginx-container 10 | ports: 11 | - containerPort: 80 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/replicasetsAndDeployments/replica_set.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: ReplicaSet 3 | metadata: 4 | name: hunter-replicaset 5 | namespace: default 6 | spec: 7 | replicas: 0 8 | selector: 9 | matchLabels: 10 | ghanshyam: kala 11 | template: 12 | metadata: 13 | name: dhondhu-pod 14 | namespace: default 15 | labels: 16 | ghanshyam: kala 17 | spec: 18 | containers: 19 | - image: nginx:stable-perl 20 | name: nginx-c 21 | ports: 22 | - containerPort: 80 23 | 24 | 25 | -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/replicasetsAndDeployments/rs.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/replicasetsAndDeployments/rs.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/requestLimits/pod.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/requestLimits/pod.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/requestLimits/pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: nginx 5 | namespace: default 6 | spec: 7 | affinity: 8 | nodeAffinity: 9 | preferredDuringSchedulingIgnoredDuringExecution: 10 | nodeSelectorTerms: 11 | - matchExpressions: 12 | - key: papa 13 | operator: NotIn 14 | values: 15 | - dhondhu 16 | 17 | tolerations: 18 | - effect: NoSchedule 19 | key: socks 20 | operator: In 21 | value: Badbu 22 | 23 | containers: 24 | - image: nginx 25 | name: nginx-container 26 | ports: 27 | - containerPort: 80 28 | resources: 29 | requests: 30 | cpu: 500m 31 | memory: 200M 32 | limits: 33 | cpu: 1 34 | memory: 1G -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/services/pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: firefox-pod 5 | namespace: default 6 | spec: 7 | containers: 8 | - image: linuxserver/firefox 9 | name: fire-container 10 | ports: 11 | - containerPort: 3000 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/services/s.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/services/s.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/services/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: dhondhu-service 5 | namespace: default 6 | spec: 7 | selector: 8 | name: ghanshyam 9 | ports: 10 | - port: 6060 11 | targetPort: 80 -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/storageClasses/pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: pappu-pvc 5 | namespace: default 6 | spec: 7 | storageClassName: pappu-class 8 | accessModes: 9 | - ReadWriteMany 10 | resources: 11 | requests: 12 | storage: 10Gi -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/storageClasses/pvc1.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: lattu-pvc 5 | namespace: default 6 | spec: 7 | storageClassName: azurefile 8 | accessModes: 9 | - ReadWriteMany 10 | resources: 11 | requests: 12 | storage: 25Gi -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/storageClasses/sachinClass.yml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: sachin-class 5 | parameters: 6 | storageAccount: sachinstorage9045206639 7 | resourceGroup: Sachin-Rg 8 | reclaimPolicy: Retain 9 | provisioner: file.csi.azure.com -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/storageClasses/sachinPvc.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: sachin-pvc 5 | namespace: default 6 | spec: 7 | storageClassName: sachin-class 8 | accessModes: 9 | - ReadWriteMany 10 | resources: 11 | requests: 12 | storage: 100Gi -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/storageClasses/sc.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Kubernetes/storageClasses/sc.txt -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/storageClasses/storageClass.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: pappu-class 5 | parameters: 6 | storageAccount: abhishek2001mishra9989 7 | resourceGroup: priyansh 8 | reclaimPolicy: Retain 9 | provisioner: file.csi.azure.com -------------------------------------------------------------------------------- /CodeSamples/Kubernetes/volumes/nginx-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: nginx-pod 5 | namespace: default 6 | spec: 7 | volumes: 8 | - name: dhondhu-vol 9 | persistantVolumeClaim: 10 | containers: 11 | - image: nginx 12 | name: nginx-container 13 | ports: 14 | - containerPort: 80 15 | volumeMounts: 16 | - name: dhondhu-vol 17 | mountPath: /usr/share/nginx/html 18 | - image: tomcat 19 | name: ram-container 20 | ports: 21 | - containerPort: 8080 22 | volumeMounts: 23 | - name: dhondhu-vol 24 | mountPath: /var/dhondhu/ -------------------------------------------------------------------------------- /CodeSamples/Project/helm/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: ${{ parameter.name }} 5 | spec: 6 | replicas: 2 7 | selector: 8 | matchLabels: 9 | app: ${{ parameter.app }} 10 | template: 11 | metadata: 12 | labels: 13 | app: $ {{parameter.app }} 14 | spec: 15 | containers: 16 | - name: $ {{ parameter.name }} 17 | image: qatodoacrwestus5.azurecr.io/todoui:106 18 | ports: 19 | - containerPort: 80 -------------------------------------------------------------------------------- /CodeSamples/Project/helm/dev-input.yaml: -------------------------------------------------------------------------------- 1 | name: dev-todoui 2 | app: dev-todoui -------------------------------------------------------------------------------- /CodeSamples/Project/helm/infra.ps1: -------------------------------------------------------------------------------- 1 | # Set variables 2 | $resourceGroupName = "rg-aks" 3 | $aksClusterName = "aks" 4 | $acrName = "dev5687reg" 5 | $location = "centralindia" 6 | $nodeSize = "Standard_B2s" 7 | 8 | # Create a resource group 9 | az group create --name $resourceGroupName --location $location 10 | 11 | # Create the AKS Cluster with a single node 12 | az aks create ` 13 | --resource-group $resourceGroupName ` 14 | --name $aksClusterName ` 15 | --node-count 1 ` 16 | --generate-ssh-keys ` 17 | --node-vm-size $nodeSize ` 18 | --location $location 19 | az acr create ` 20 | --resource-group $resourceGroupName ` 21 | --name $acrName ` 22 | --sku Basic ` 23 | --location $location 24 | 25 | # Attach the ACR to the AKS Cluster (for pulling images) 26 | az aks update ` 27 | --resource-group $resourceGroupName ` 28 | --name $aksClusterName ` 29 | --attach-acr $acrName 30 | 31 | # Get the credentials to manage the cluster 32 | az aks get-credentials --resource-group $resourceGroupName --name $aksClusterName 33 | 34 | # Verify the cluster by checking the nodes 35 | kubectl get nodes 36 | -------------------------------------------------------------------------------- /CodeSamples/Project/helm/qa-input.yaml: -------------------------------------------------------------------------------- 1 | name: qa-todoui 2 | app: qa-todoui -------------------------------------------------------------------------------- /CodeSamples/Project/terraform/dev.terraform.tfvars: -------------------------------------------------------------------------------- 1 | rg_name = "rg-terraform-dev" 2 | location = "eastus" -------------------------------------------------------------------------------- /CodeSamples/Project/terraform/main.tf: -------------------------------------------------------------------------------- 1 | variable "rg_name" { 2 | description = "The name of the resource group" 3 | } 4 | variable "location" { 5 | description = "The location of the resource group" 6 | } 7 | resource "azurerm_resource_group" "rg" { 8 | name = var.rg_name 9 | location = var.location 10 | } -------------------------------------------------------------------------------- /CodeSamples/Project/terraform/qa-terraform.tfvars: -------------------------------------------------------------------------------- 1 | rg_name = "rg-terraform-qa" 2 | location = "eastus" -------------------------------------------------------------------------------- /CodeSamples/Terraform/VnetSubnetDynamicBlock/main.tf: -------------------------------------------------------------------------------- 1 | resource "azurerm_resource_group" "dhondhurg" { 2 | for_each = { 3 | rg1 = { 4 | name = "dhondhu-rg" 5 | location = "westeurope" 6 | } 7 | } 8 | name = each.value.name 9 | location = each.value.location 10 | } 11 | 12 | # Nested Loops 13 | resource "azurerm_virtual_network" "dhondhuvnet" { 14 | for_each = var.vnets 15 | name = each.value.vnetName 16 | location = each.value.location 17 | resource_group_name = each.value.rg_name 18 | address_space = each.value.address_space 19 | 20 | dynamic "subnet" { 21 | for_each = each.value.subnets 22 | content { 23 | name = subnet.value.name 24 | address_prefix = subnet.value.address_prefix 25 | } 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/VnetSubnetDynamicBlock/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.103.1" 6 | } 7 | } 8 | } 9 | 10 | provider "azurerm" { 11 | features {} 12 | } -------------------------------------------------------------------------------- /CodeSamples/Terraform/VnetSubnetDynamicBlock/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vnets = { 2 | vnet1 = { 3 | vnetName = "dhondhuvnet" 4 | location = "westeurope" 5 | rg_name = "dhondhu-rg" 6 | address_space = ["10.0.0.0/16"] 7 | subnets = { 8 | snet1 = { 9 | name = "subnet1" 10 | address_prefix = "10.0.1.0/24" 11 | } 12 | snet2 = { 13 | name = "subnet2" 14 | address_prefix = "10.0.2.0/24" 15 | } 16 | snet3 = { 17 | name = "subnet3" 18 | address_prefix = "10.0.3.0/24" 19 | } 20 | } 21 | } 22 | vnet2 = { 23 | vnetName = "dhondhuvnet2" 24 | location = "westeurope" 25 | rg_name = "dhondhu-rg" 26 | address_space = ["10.1.0.0/16"] 27 | subnets = { 28 | snet1 = { 29 | name = "subnet1" 30 | address_prefix = "10.1.1.0/24" 31 | } 32 | snet2 = { 33 | name = "subnet2" 34 | address_prefix = "10.1.2.0/24" 35 | } 36 | } 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/VnetSubnetDynamicBlock/variable.tf: -------------------------------------------------------------------------------- 1 | variable "vnets" {} -------------------------------------------------------------------------------- /CodeSamples/Terraform/key_vault/.terraform.lock.hcl: -------------------------------------------------------------------------------- 1 | # This file is maintained automatically by "terraform init". 2 | # Manual edits may be lost in future updates. 3 | 4 | provider "registry.terraform.io/hashicorp/azurerm" { 5 | version = "3.98.0" 6 | constraints = "3.98.0" 7 | hashes = [ 8 | "h1:V/QrVROIPx2gZxFaQ4XHmdOvvNBHmghCk5Z1VSjl9/g=", 9 | "zh:012c79f671cff194d769ee53d50c56e7d353d4b78de8fceec9915bcf5955878b", 10 | "zh:022d07683f84f8534fa40567860f76da6d15713d678cbc979c1d8cd502bb3246", 11 | "zh:12cefd7df62c23c434d853e1824d421b4f18ff683540861376cf37138d70795b", 12 | "zh:42626315686f504c59bec02745d7beff2bdfa732c3ecfaca7794f6641fbebfdc", 13 | "zh:44708deec3fe13ea7cdd899ee766971fd024c06e2d8e189c30b59bd56ef3a5d3", 14 | "zh:54a54fb4c8fc6537aae658503182e03af545e9151afe68da0f254d9b31037c63", 15 | "zh:8265688742f6b532f06a3cd0bb14a891eb2277a834cf126f4b483b6de0a8d8fa", 16 | "zh:97294d6e502e4e07e0cd8d2669a05d7e5d1f42da542ced299b5d4a3849e8736e", 17 | "zh:bf4b48606c53db399f53b3880d94f70fc1701c72fde269472d8231f6dda5cf49", 18 | "zh:c5a957d61e4c705e2c94d53c6fff579d5262137b2192562d0dfbbda374891717", 19 | "zh:e2a8232f20f74602632b24d50c5c9d21741b0345560e4133bfb38e257d20fb77", 20 | "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", 21 | ] 22 | } 23 | 24 | provider "registry.terraform.io/hashicorp/random" { 25 | version = "3.6.1" 26 | constraints = "3.6.1" 27 | hashes = [ 28 | "h1:Xx3UvdKXObNTjfd4yYHDcFalYZujg7NBY/VpZISiTb4=", 29 | "zh:2a0ec154e39911f19c8214acd6241e469157489fc56b6c739f45fbed5896a176", 30 | "zh:57f4e553224a5e849c99131f5e5294be3a7adcabe2d867d8a4fef8d0976e0e52", 31 | "zh:58f09948c608e601bd9d0a9e47dcb78e2b2c13b4bda4d8f097d09152ea9e91c5", 32 | "zh:5c2a297146ed6fb3fe934c800e78380f700f49ff24dbb5fb5463134948e3a65f", 33 | "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", 34 | "zh:7ce41e26f0603e31cdac849085fc99e5cd5b3b73414c6c6d955c0ceb249b593f", 35 | "zh:8c9e8d30c4ef08ee8bcc4294dbf3c2115cd7d9049c6ba21422bd3471d92faf8a", 36 | "zh:93e91be717a7ffbd6410120eb925ebb8658cc8f563de35a8b53804d33c51c8b0", 37 | "zh:982542e921970d727ce10ed64795bf36c4dec77a5db0741d4665230d12250a0d", 38 | "zh:b9d1873f14d6033e216510ef541c891f44d249464f13cc07d3f782d09c7d18de", 39 | "zh:cfe27faa0bc9556391c8803ade135a5856c34a3fe85b9ae3bdd515013c0c87c1", 40 | "zh:e4aabf3184bbb556b89e4b195eab1514c86a2914dd01c23ad9813ec17e863a8a", 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/key_vault/main.tf: -------------------------------------------------------------------------------- 1 | data "azurerm_client_config" "current" {} 2 | 3 | resource "azurerm_key_vault" "key_vault" { 4 | name = "dhondhu-kv" 5 | location = "westus" 6 | resource_group_name = "rg_devopsinsiders" 7 | enabled_for_disk_encryption = true 8 | tenant_id = data.azurerm_client_config.current.tenant_id 9 | purge_protection_enabled = false 10 | sku_name = "standard" 11 | 12 | access_policy { 13 | tenant_id = data.azurerm_client_config.current.tenant_id 14 | object_id = data.azurerm_client_config.current.object_id 15 | 16 | key_permissions = [ 17 | "Get", "Create", "Delete" 18 | ] 19 | secret_permissions = [ 20 | "Get", "Set", "List" 21 | ] 22 | storage_permissions = [ 23 | "Get", 24 | ] 25 | } 26 | } 27 | 28 | resource "random_password" "password" { 29 | length = 16 30 | special = true 31 | override_special = "!#$%&*()-_=+[]{}<>:?" 32 | } 33 | 34 | resource "azurerm_key_vault_secret" "tf-secret" { 35 | name = "tf-secret" 36 | value = random_password.password.result 37 | key_vault_id = azurerm_key_vault.key_vault.id 38 | } 39 | 40 | resource "azurerm_key_vault_secret" "xyz-secret" { 41 | name = "dhondhu-secret" 42 | value = "PyajLelo" 43 | key_vault_id = azurerm_key_vault.key_vault.id 44 | } -------------------------------------------------------------------------------- /CodeSamples/Terraform/key_vault/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.98.0" 6 | } 7 | random = { 8 | source = "hashicorp/random" 9 | version = "3.6.1" 10 | } 11 | } 12 | } 13 | 14 | provider "azurerm" { 15 | features {} 16 | } 17 | 18 | provider "random" { 19 | # Configuration options 20 | } 21 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/key_vault/terraform.tfvars: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Terraform/key_vault/terraform.tfvars -------------------------------------------------------------------------------- /CodeSamples/Terraform/key_vault/variables.tf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Terraform/key_vault/variables.tf -------------------------------------------------------------------------------- /CodeSamples/Terraform/list_resource_group/main.tf: -------------------------------------------------------------------------------- 1 | variable "rg_list" { 2 | default = ["monu-rg", "sonu-rg", "kalu-rg"] 3 | } 4 | 5 | resource "azurerm_resource_group" "rg" { 6 | for_each = toset(["monu-rg", "sonu-rg", "kalu-rg"]) 7 | name = each.value 8 | location = "West Europe" 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/list_resource_group/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.97.1" 6 | } 7 | } 8 | } 9 | 10 | provider "azurerm" { 11 | features {} 12 | } 13 | 14 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/list_resource_group/terraform.tfvars: -------------------------------------------------------------------------------- 1 | rg_list = ["monu-rg1", "sonu-rg1", "kalu-rg1"] 2 | 3 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/list_resource_group/variables.tf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/Terraform/list_resource_group/variables.tf -------------------------------------------------------------------------------- /CodeSamples/Terraform/map_resource_group/complex_map.tf: -------------------------------------------------------------------------------- 1 | resource "azurerm_resource_group" "resource_groups" { 2 | for_each = var.rg_complex_map 3 | name = each.value.rg_name 4 | location = each.value.rg_location 5 | } 6 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/map_resource_group/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.97.1" 6 | } 7 | } 8 | } 9 | 10 | provider "azurerm" { 11 | features {} 12 | } 13 | 14 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/map_resource_group/simple_map.tf: -------------------------------------------------------------------------------- 1 | resource "azurerm_resource_group" "rg" { 2 | for_each = { 3 | monu-rg = "westus" 4 | sonu-rg = "centralindia" 5 | kalu-rg = "eastus" 6 | tonu-rg = "canadacentral" 7 | lalu-rg = "southindia" 8 | } 9 | name = each.key 10 | location = each.value 11 | } 12 | 13 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/map_resource_group/terraform.tfvars: -------------------------------------------------------------------------------- 1 | rg_complex_map = { 2 | rg1 = { 3 | rg_name = "monu-rg" 4 | rg_location = "westus" 5 | } 6 | rg2 = { 7 | rg_name = "tonu-rg" 8 | rg_location = "eastus" 9 | } 10 | rg3 = { 11 | rg_name = "sonu-rg" 12 | rg_location = "centralindia" 13 | } 14 | rg4 = { 15 | rg_name = "saurabhsingh-rg" 16 | rg_location = "centralindia" 17 | } 18 | rg5 = { 19 | rg_name = "rohit-rg" 20 | rg_location = "centralindia" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/map_resource_group/variables.tf: -------------------------------------------------------------------------------- 1 | variable "rg_complex_map" { 2 | type = any 3 | } 4 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/resource_group_assignment2803/main.tf: -------------------------------------------------------------------------------- 1 | resource "azurerm_resource_group" "rg1" { 2 | name = var.rg_name 3 | location = var.rg_location 4 | } 5 | 6 | resource "azurerm_resource_group" "rg2" { 7 | name = var.rg_name2 8 | location = var.rg_location2 9 | } 10 | 11 | resource "azurerm_resource_group" "rg3" { 12 | name = var.rg_name3 13 | location = var.rg_location3 14 | } 15 | 16 | resource "azurerm_resource_group" "rg4" { 17 | name = var.rg_name4 18 | location = var.rg_location4 19 | } 20 | 21 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/resource_group_assignment2803/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.97.1" 6 | } 7 | } 8 | } 9 | 10 | provider "azurerm" { 11 | features {} 12 | } 13 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/resource_group_assignment2803/terraform.tfvars: -------------------------------------------------------------------------------- 1 | rg_name = "test123" 2 | rg_name2 = "dhakka-rg" 3 | rg_name3 = "mukki-rg" 4 | rg_name4 = "dhakka-mukki-rg" -------------------------------------------------------------------------------- /CodeSamples/Terraform/resource_group_assignment2803/variables.tf: -------------------------------------------------------------------------------- 1 | variable "rg_name" { 2 | type = string 3 | description = "This is for Rg Name" 4 | } 5 | 6 | variable "rg_name2" { 7 | default = "lalu-rg" 8 | type = string 9 | description = "This is for Rg Name" 10 | } 11 | 12 | variable "rg_name3" { 13 | default = "kalu-rg" 14 | type = string 15 | description = "This is for Rg Name" 16 | } 17 | 18 | variable "rg_name4" { 19 | default = "kalu-rg" 20 | type = string 21 | description = "This is for Rg Name" 22 | } 23 | 24 | 25 | variable "rg_location" { 26 | default = "West Europe" 27 | type = string 28 | description = "This is for Rg Location" 29 | } 30 | 31 | variable "rg_location2" { 32 | default = "West US" 33 | type = string 34 | description = "This is for Rg Location" 35 | } 36 | 37 | variable "rg_location3" { 38 | default = "Central India" 39 | type = string 40 | description = "This is for Rg Location" 41 | } 42 | 43 | variable "rg_location4" { 44 | default = "Central India" 45 | type = string 46 | description = "This is for Rg Location" 47 | } 48 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/storage_account/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.96.0" 6 | } 7 | } 8 | } 9 | 10 | provider "azurerm" { 11 | features {} 12 | } 13 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/storage_account/storage.tf: -------------------------------------------------------------------------------- 1 | resource "azurerm_storage_account" "st1" { 2 | name = "rinkistorage1" 3 | resource_group_name = "rinkiya-ke-new-papa6" 4 | location = "West Europe" 5 | account_tier = "Standard" 6 | account_replication_type = "GRS" 7 | 8 | tags = { 9 | environment = "staging" 10 | } 11 | } 12 | 13 | resource "azurerm_storage_account" "st2" { 14 | name = "rinkistorage2" 15 | resource_group_name = "rinkiya-ke-new-papa7" 16 | location = "West Europe" 17 | account_tier = "Standard" 18 | account_replication_type = "GRS" 19 | 20 | tags = { 21 | environment = "staging" 22 | } 23 | } -------------------------------------------------------------------------------- /CodeSamples/Terraform/subnet/main.tf: -------------------------------------------------------------------------------- 1 | resource "azurerm_subnet" "subnets" { 2 | for_each = var.subnet_map 3 | name = each.value.name 4 | resource_group_name = each.value.resource_group_name 5 | virtual_network_name = each.value.virtual_network_name 6 | address_prefixes = each.value.address_prefixes 7 | } 8 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/subnet/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.98.0" 6 | } 7 | } 8 | 9 | # backend "azurerm" { 10 | # resource_group_name = "devopsinsders" # Can be passed via `-backend-config=`"resource_group_name="` in the `init` command. 11 | # storage_account_name = "devopsinsiders765" # Can be passed via `-backend-config=`"storage_account_name="` in the `init` command. 12 | # container_name = "tfstate" # Can be passed via `-backend-config=`"container_name="` in the `init` command. 13 | # key = "subnets.tfstate" # Can be passed via `-backend-config=`"key="` in the `init` command. 14 | # } 15 | 16 | } 17 | 18 | 19 | provider "azurerm" { 20 | features {} 21 | } 22 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/subnet/terraform.tfvars: -------------------------------------------------------------------------------- 1 | subnet_map = { 2 | snet1 = { 3 | name = "frontend-subnet" 4 | resource_group_name = "rg_crime_master_gogo" 5 | virtual_network_name = "devops-vnet1" 6 | address_prefixes = ["10.0.1.0/24"] 7 | } 8 | snet2 = { 9 | name = "backend-subnet" 10 | resource_group_name = "rg_crime_master_gogo" 11 | virtual_network_name = "devops-vnet1" 12 | address_prefixes = ["10.0.2.0/24"] 13 | } 14 | snet3 = { 15 | name = "database-subnet" 16 | resource_group_name = "rg_crime_master_gogo" 17 | virtual_network_name = "devops-vnet1" 18 | address_prefixes = ["10.0.3.0/24"] 19 | } 20 | snet4 = { 21 | name = "frontend-subnet" 22 | resource_group_name = "rg_crime_master_gogo" 23 | virtual_network_name = "devops-vnet2" 24 | address_prefixes = ["10.0.3.0/24"] 25 | } 26 | snet5 = { 27 | name = "backend-subnet" 28 | resource_group_name = "rg_crime_master_gogo" 29 | virtual_network_name = "devops-vnet2" 30 | address_prefixes = ["10.0.2.0/24"] 31 | } 32 | snet6 = { 33 | name = "database-subnet" 34 | resource_group_name = "rg_crime_master_gogo" 35 | virtual_network_name = "devops-vnet2" 36 | address_prefixes = ["10.0.5.0/24"] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/subnet/variables.tf: -------------------------------------------------------------------------------- 1 | variable "subnet_map" { 2 | type = map(any) 3 | } -------------------------------------------------------------------------------- /CodeSamples/Terraform/virtual_machine/data_sources.tf: -------------------------------------------------------------------------------- 1 | data "azurerm_subnet" "gogo_subnet" { 2 | for_each = var.linux_vms 3 | name = each.value.subnet_name 4 | virtual_network_name = each.value.virtual_network_name 5 | resource_group_name = each.value.resource_group_name 6 | } 7 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/virtual_machine/main.tf: -------------------------------------------------------------------------------- 1 | resource "azurerm_public_ip" "public_ip" { 2 | for_each = var.linux_vms 3 | name = each.value.pip_name 4 | resource_group_name = each.value.resource_group_name 5 | location = each.value.location 6 | allocation_method = "Static" 7 | } 8 | 9 | resource "azurerm_network_interface" "network_interface" { 10 | for_each = var.linux_vms 11 | name = each.value.nic_name 12 | location = each.value.location 13 | resource_group_name = each.value.resource_group_name 14 | 15 | ip_configuration { 16 | name = "internal" 17 | subnet_id = data.azurerm_subnet.gogo_subnet[each.key].id 18 | private_ip_address_allocation = "Dynamic" 19 | public_ip_address_id = azurerm_public_ip.public_ip[each.key].id 20 | } 21 | 22 | } 23 | 24 | resource "azurerm_linux_virtual_machine" "virtual_machine" { 25 | for_each = var.linux_vms 26 | name = each.value.vm_name 27 | resource_group_name = each.value.resource_group_name 28 | location = each.value.location 29 | size = each.value.vm_size 30 | disable_password_authentication = false 31 | admin_username = each.value.vm_username 32 | admin_password = each.value.vm_password 33 | network_interface_ids = [ 34 | azurerm_network_interface.network_interface[each.key].id, 35 | ] 36 | 37 | os_disk { 38 | caching = "ReadWrite" 39 | storage_account_type = "Standard_LRS" 40 | } 41 | 42 | source_image_reference { 43 | publisher = "canonical" 44 | offer = "0001-com-ubuntu-server-jammy" 45 | sku = "22_04-lts" 46 | version = "latest" 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/virtual_machine/outputs.tf: -------------------------------------------------------------------------------- 1 | # output "vm_public_ip" { 2 | # value = azurerm_linux_virtual_machine.virtual_machine.public_ip_address 3 | # } 4 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/virtual_machine/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.98.0" 6 | } 7 | } 8 | 9 | # backend "azurerm" { 10 | # resource_group_name = "devopsinsders" # Can be passed via `-backend-config=`"resource_group_name="` in the `init` command. 11 | # storage_account_name = "devopsinsiders765" # Can be passed via `-backend-config=`"storage_account_name="` in the `init` command. 12 | # container_name = "tfstate" # Can be passed via `-backend-config=`"container_name="` in the `init` command. 13 | # key = "virtualmachine.tfstate" # Can be passed via `-backend-config=`"key="` in the `init` command. 14 | # } 15 | 16 | } 17 | 18 | 19 | provider "azurerm" { 20 | features {} 21 | } 22 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/virtual_machine/terraform.tfvars: -------------------------------------------------------------------------------- 1 | linux_vms = { 2 | vm1 = { 3 | pip_name = "gogo1-ip" 4 | nic_name = "gogo1-nic" 5 | vm_name = "gogo1-vm" 6 | resource_group_name = "rg_crime_master_gogo" 7 | location = "westus" 8 | vm_size = "Standard_F2" 9 | subnet_name = "frontend-subnet" 10 | virtual_network_name = "devops-vnet2" 11 | vm_username = "adminuser" 12 | vm_password = "6ZyT40,Vo+c<" 13 | } 14 | vm2 = { 15 | pip_name = "chachi420-ip" 16 | nic_name = "chachi420-nic" 17 | vm_name = "chachi420-vm" 18 | resource_group_name = "rg_crime_master_gogo" 19 | location = "westus" 20 | subnet_name = "backend-subnet" 21 | virtual_network_name = "devops-vnet2" 22 | vm_size = "Standard_F2" 23 | vm_username = "adminuser" 24 | vm_password = "6ZyT40,Vo+c<" 25 | } 26 | vm3 = { 27 | pip_name = "dhondhu-ip" 28 | nic_name = "dhondhu-nic" 29 | vm_name = "dhondhu-vm" 30 | resource_group_name = "rg_crime_master_gogo" 31 | location = "westus" 32 | subnet_name = "database-subnet" 33 | virtual_network_name = "devops-vnet2" 34 | vm_size = "Standard_F2" 35 | vm_username = "adminuser" 36 | vm_password = "6ZyT40,Vo+c<" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/virtual_machine/variables.tf: -------------------------------------------------------------------------------- 1 | variable "linux_vms" {} 2 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/virtual_network/main.tf: -------------------------------------------------------------------------------- 1 | resource "azurerm_virtual_network" "virtual_networks" { 2 | for_each = var.vnet_map 3 | name = each.value.name 4 | location = each.value.location 5 | resource_group_name = each.value.resource_group_name 6 | address_space = each.value.address_space 7 | } 8 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/virtual_network/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | azurerm = { 4 | source = "hashicorp/azurerm" 5 | version = "3.98.0" 6 | } 7 | } 8 | 9 | # backend "azurerm" { 10 | # resource_group_name = "devopsinsders" # Can be passed via `-backend-config=`"resource_group_name="` in the `init` command. 11 | # storage_account_name = "devopsinsiders765" # Can be passed via `-backend-config=`"storage_account_name="` in the `init` command. 12 | # container_name = "tfstate" # Can be passed via `-backend-config=`"container_name="` in the `init` command. 13 | # key = "virtualnetwork.tfstate" # Can be passed via `-backend-config=`"key="` in the `init` command. 14 | # } 15 | 16 | } 17 | 18 | 19 | provider "azurerm" { 20 | features {} 21 | } 22 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/virtual_network/terraform.tfvars: -------------------------------------------------------------------------------- 1 | vnet_map = { 2 | vnet1 = { 3 | name = "devops-vnet1" 4 | location = "eastus" 5 | resource_group_name = "rg_crime_master_gogo" 6 | address_space = ["10.0.0.0/16"] 7 | } 8 | vnet2 = { 9 | name = "devops-vnet2" 10 | location = "westus" 11 | resource_group_name = "rg_crime_master_gogo" 12 | address_space = ["10.0.0.0/16"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/virtual_network/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vnet_map" { 2 | type = map(any) 3 | } 4 | -------------------------------------------------------------------------------- /CodeSamples/Terraform/vm/main.tf: -------------------------------------------------------------------------------- 1 | resource "azurerm_public_ip" "pip" { 2 | name = "acceptanceTestPublicIp1" 3 | resource_group_name = "babitajee-rg" 4 | location = "Central India" 5 | allocation_method = "Static" 6 | sku = "Standard" 7 | } 8 | 9 | resource "azurerm_network_interface" "nic" { 10 | name = "frontend-nic" 11 | location = "Central India" 12 | resource_group_name = "babitajee-rg" 13 | 14 | ip_configuration { 15 | name = "internal" 16 | subnet_id = "/subscriptions/dfc51e53-38c1-4d27-813f-b0ee11f6a7c4/resourceGroups/babitajee-rg/providers/Microsoft.Network/virtualNetworks/billorani/subnets/frontend" 17 | private_ip_address_allocation = "Dynamic" 18 | public_ip_address_id = azurerm_public_ip.pip.id 19 | } 20 | } 21 | 22 | resource "azurerm_linux_virtual_machine" "frontendvm" { 23 | name = "frontend-machine" 24 | resource_group_name = "babitajee-rg" 25 | location = "Central India" 26 | size = "Standard_DS1_v2" 27 | admin_username = "devopsinsiders" 28 | admin_password = "3@O!-LAc2j:6" 29 | disable_password_authentication = false 30 | 31 | network_interface_ids = [ 32 | azurerm_network_interface.nic.id, 33 | ] 34 | 35 | os_disk { 36 | caching = "ReadWrite" 37 | storage_account_type = "Standard_LRS" 38 | disk_size_gb = "30" 39 | name = "frontend-disk" 40 | } 41 | 42 | source_image_reference { 43 | publisher = "Canonical" 44 | offer = "0001-com-ubuntu-server-jammy" 45 | sku = "22_04-lts-gen2" 46 | version = "latest" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /CodeSamples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | My Beautiful Website 7 | 63 | 64 | 65 |
66 |

Welcome to My Website

67 |
68 | 74 |
75 |

Your Hero Section

76 |
77 |
78 |
79 |

About Us

80 |

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vitae ligula et orci pretium tincidunt.

81 | 82 |

Our Services

83 |

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vitae ligula et orci pretium tincidunt.

84 | 85 |

Contact Us

86 |

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vitae ligula et orci pretium tincidunt.

87 |
88 |
89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /CodeSamples/moreComingSoon.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/moreComingSoon.md -------------------------------------------------------------------------------- /CodeSamples/moreComingSoon1.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopsinsiders/azure-devsecops-batch-15/501cf8503ec93b898e3e9451ba9c32892827a196/CodeSamples/moreComingSoon1.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # B15 Class Repository - DevOps Insiders 📚👩‍💻 2 | 3 | Welcome to the official repository for B15 at DevOps Insiders! 🚀 Here, you'll find a meticulously organized collection of class notes, assignments, and code snippets generated during our engaging sessions. 4 | 5 | ## 📔 Class Notes 6 | Explore detailed notes from each B15 class, offering a comprehensive overview of DevOps topics covered. Whether you missed a class or need a quick review, the class notes are your reliable study companion. 7 | 8 | ## 📝 Assignments 9 | Access and submit B15 class assignments seamlessly through this repository. Stay on top of your coursework and contribute to a collaborative learning environment by sharing your solutions. 10 | 11 | ## 💻 Code Samples 12 | Find and review code examples demonstrated in B15 classes. This section serves as a valuable reference for practical implementations and coding exercises covered during our DevOps sessions. 13 | 14 | ## 🗂️ Repository Structure 15 | - **/ClassNotes**: Contains organized class notes for easy navigation. 16 | - **/Assignments**: Store and submit your B15 assignments here. 17 | - **/CodeSamples**: Explore code snippets and examples from our DevOps classes. 18 | 19 | ## 🤝 Contributing 20 | Feel free to contribute by adding your own notes, improvements, or additional resources. Create branches for specific topics or suggest edits through pull requests. Let's build a collaborative space for learning DevOps together! 21 | 22 | ## 🏢 About DevOps Insiders 23 | DevOps Insiders is a leading institute fostering knowledge in DevOps practices. Explore more about our institute at [devopsinsiders.com](https://devopsinsiders.com). 24 | 25 | ## 📌 How to Use 26 | 1. Clone the repository to your local machine. 27 | 2. Navigate to relevant folders for class notes, assignments, or code samples. 28 | 3. Stay updated with the latest changes and additions by pulling the latest updates. 29 | 30 | Happy learning, B15! 🚀🚀📖 31 | --------------------------------------------------------------------------------