Skip to content

Latest commit

 

History

History
150 lines (80 loc) · 3.94 KB

project-2.md

File metadata and controls

150 lines (80 loc) · 3.94 KB

You and your team have a requirement by your company to make things more modern so the organization can not only succeed, but stay ahead of their competition. Management now understands the needs and complexity that comes with staying ahead of their competition and they know that they need to. Otherwise, the organization will fall… The solution therein is to containerize their application

Task 1 In your Local Computer, in Vs-code, Create a New Branch, and Create a New file “Dockerfile” using Nano or vi any editor of your choice.

  • use git checkout -b <new branch name>

  • create a docker file with nano text editor nano dockerfile

Task 2 Using the Docker Registry as guide for docker command for creating docker file, and depending on the requirement from your company, Create the Dockerfile with the instructions.

FROM mcr.microsoft.com/dotnet/sdk:7.0
WORKDIR /app
COPY . .
RUN dotnet restore
RUN dotnet publish -c Release -o out
ENTRYPOINT ["dotnet", "out/dotnet-webapp.dll"]
  • save it ctrl + x and enter

Task 3 Save and commit your work then push it to the remote repository in Azure DevOps

  • save and commit code Alt text

  • create a new project in azure devops

  • go to repo and paste the push an existing repo command to vscode cli Alt text

  • check the project repo branch Alt text Alt text

Task 4

Create a Pull Request to merge your branch and verify Sonar-cloud comment on your changes, and verify it merged successfully.

  • Go to the project settings Alt text

  • click the repsitory>the dotnetweb app> the policy tab Alt text

  • click on branch policy Alt text

  • click on build validation Alt text

  • add a build policy name, leave the rest on default and save Alt text

  • save and commit Alt text

Alt text

  • Click on repo > branch click on pull request

Alt text Alt text Alt text Alt text

  • go to pipelines the pull request would trigger a build

Alt text

  • Check result in sonarcloud

Alt text

Task 5

  • Create a Build pipeline to Build the image and push to Container Registry

Alt text Alt text Alt text Alt text Alt text Alt text

  • Create a Release Pipeline to Deploy in Azure web app for containers Alt text Alt text Alt text
  • Create a New Stage and Deploy into Azure Container Instance.

Alt text Alt text Alt text Alt text

Task 6 Create a Build pipeline to Build the image and push to Container Registry and Deploy into Azure Kubernetes Service and then verify your app is up and running.

  • build pipeline and build image

Alt text

  • Create release pipeline, set the agent jobs

Alt text

  • Successful build

Alt text

  • Check the portal for results

Alt text

  • Setup kubernetes connection on the powershell terminal

Alt text

  • Our app is running

Alt text