Getting Started With Azure DevOps
Getting Started With Azure DevOps
Getting Started With Azure DevOps
© KC Martin
www.kevsbooks.com
Before we get going you may already know about Azure, of not here is a
brief introduction. Microsoft Azure, commonly referred to as Azure, is
a cloud computing service created by Microsoft for building, testing,
deploying, and managing applications and services through Microsoft-
managed data centres. The service provides software as a service
(SaaS), platform as a service (PaaS) and infrastructure as a service (IaaS) and
supports many different programming languages, tools, and frameworks,
including both Microsoft-specific and third-party software and systems.
To sign-up or sign-in to Azure simply go to this URL and get yourself sorted.
https://portal.azure.com/. For general information about the services try this
URL https://azure.microsoft.com/en-gb/ also. For the purpose of this
demonstration I will be linking with my stored code at Azure DevOps
(dev.azure.com/myAccount/), you may also have such an account if not why
not sign up for one, it is free.
Here I will walk through the steps that will show you the true power of the
dark side, sorry I mean Azure DevOps. If the then feel the desire to learn this
further there are plenty of books and websites that can offer a lot of good,
helpful information on this subject.
So once you are all setup and ready to go follow my steps here or simply just
read through this document.
Step 1 – Create Storage Account. In your azure portal select this link.
Now either select from the list or type in storage in the search box.
And type in a label of your choice. Then complete the page something like
mine below, try not to select Premium options unless you want to pay for
them.
Keep all other options as per default and step through to create, when
complete you will see a message like this.
Select create and step through the process. Resource group should be the one
you created in Step 1. Then complete the remaining options.
Step through the remaining pages with default options and create.
Go to the resource to confirm.
Finally check the dashboard, you should see your new additions.
Step 3. In this step we need to enable Admin user in the Container registry
and create a Username with a password. So first select your Container
registry from your dashboard.
On the next page you will probably be prompted to login to your Microsoft
account, this is standard procedure and nothing to worry about. Once logged
in you will be linked to you Azure account subscription. You will also be
able to selected the Resource group you created earlier.
Finally you will need to provide a Service connection name, the description is
optional, see next page for the screenshot.
Then click save, after a couple of moments your Service connection will be
created.
Now add a second Service connection, this time select type Docker registry.
Choose type Azure Container Registry, the rest is the same as before.
Next you will select your template, this will be decided by the project type, in
my example it is ASP.Net Core because this matches my project.
To create click Save & queue->Save and Run. At this point you will have a
basic pipeline but now we need to enhance the functionality.
So now edit pipeline and add Docker build and Push. To do this click on the
+ link shown below.
Then select Docker, you may have to search for this option.
Select the Container registry and add the Container repository name.
You will also notice a URL on the page, this is where your application will
reside should the deployment pass. In this case my test URL is
https://spicetheworlddev.azurewebsites.net/. This test site is not always up
but if you try it you may well see a page like that below, this was deployed
by DevOps.
From this point on every time you update your source code and submit the
changes the Continuous Deployment will kick in, the code will be built, unit
tests (if you have created them) will be run and if all goes well the updated
application will be deployed to your test server. Now that is cool.
So what you need to remember her is that now all of the services and
pipelines have been created your CI/CD DevOps should kick in every time
you commit code to your repository on the branch that you have setup during
this process. There is a lot more to DevOps than this but I hope this small
walk-through will give you a taste for what is possible.