Deploying Code to a Web App using Azure App Services

I will write a tutorial on what Azure is and what Web Apps are in a different article. For now we are gonna get right into action.

Step 1:

create an account at portal.azure.com — you get $200 free credit and free services for a year, great stuff.

Upon creation lets go into Resource Groups in your dashboard. If it’s not in your dashboard, just click the arrow for more services and find it, or type in App Services in the search bar.

After that we will hit the Add button with the Plus icon on the top left corner,

Fill in any name you want under Resource Names, I picked my youtube channel name:

Proceed with the creation

Now we can go back to our dashboard and select App Services

Then go ahead and hit Add here ->

Step 2:

Lets fill out the forms.
So we have quite a few options, Subscription, resource group, instance name, publish type, runtime stack, operating system, region and App service plan.

I’ve filled them out as so, also important to notice the Sku and size, let’s change this so we don’t get charged any fees… There is a free option. So click on that to get to the next part:

Click Dev / Test tab and select option F1 for 1GB memory for free cost.

Hit apply and hit next for the creation process, so we can move to the monitoring tab.

Okay, we got an error. Application Insights is not supported because we selected Linux in the previous menu, but doesn’t mean we can’t create it. so let’s hit next to tags

Don’t worry about tags for this lab, let’s hit next again to Review + Create

You may get an error here if you’re using a resource group that isn’t setup for the pricing tier you selected, but if you followed my steps, we should be doing just fine.

Let’s create it!

Hopefully you got the same green checkmark as me for creating our deployment service.

Step 3:

Lets hit the dropdown arrow for Deployment details and check out the resource group we made —

As you can see the app is already running, so let’s go ahead and stop it, and then restart it.
Once it is running again, let’s check out some monitoring logs to see what happened.

So just a heads up before you view the next 2 screenshots, remember with Linux, we get a lot less options in Azure for this specific feature, so we won’t get to see many different logs. — There would be way more options here if we setup with a Windows OS.

So the only thing we’re modifying is setting the Retention Period for 5 days. What that means is the system is going to be deleting logs older than 5 days.

Step 4:

Let’s head over to the fun stuff now.

We see a few different options.
Local Git : If we want to Deploy from a local repository
Azure Repos : If we want continuous integration with Azure repositories
Bitbucket : If we want continuous integration with bitbucket repositories
GitHub : If we want continuous integration with a GitHub repository

Let’s go with GitHub to keep things simple.

It will ask you to login to GitHub if you aren’t already signed in. If you don’t have an account, it’s free and very easy to setup @ https://github.com

Again when you hit continue we will get a bunch of CI/CD options.
Kudu App Service build service : Helps us automate code building during our deployment process
GitHub Actions: Helps us automate building, testing and deployment steps.
Azure Pipelines: Helps us configure intricate pipelines with many different options and helping us automate the tedious aspects of deployment.

For this exercise I am running Kudu App Service Builder.

Next we get to pick our Organization/Or GitHub account, the repository (will be different for everyone) and our Branch.
If you don’t have a repository, feel free to download my Simple Calculator Python app here:
https://github.com/B00tyBay/BasicCalculator
Upload it to your GitHub so we can continue with this lab.

Once you have chosen a repository we can hit continue and finish the process.
It will take a few minutes for the deployment to go through, or longer depending on how big your code is.

We can click on the logs icon to monitor the status of the deployment process.

If you see Success (Active) then we are happy campers.

That brings us to the end of this short lab, I hope you learned something.
If you have any questions, please reach out to me on LinkedIn.

https://www.linkedin.com/in/adam-marton-beke-01458416b/

Aspiring DevOps Engineer