DEV Community

Cover image for Click, Code, Host: A Beginner's Guide to Azure App Services
Precious Oladele
Precious Oladele

Posted on

Click, Code, Host: A Beginner's Guide to Azure App Services

INTRODUCTION

Building, deploying, and scaling web apps is made easier with Microsoft Azure's Azure App Service, a flexible platform-as-a-service (PaaS) solution. Everything from simple websites to intricate business apps can be hosted on it. It's a popular alternative for developers because of its advantages, which include easy scalability, numerous deployment choices, worldwide hosting, and smooth connection with other Azure services.
This article will walk you through setting up an App Service and deploying content.

1.Prerequisites

  • A Microsoft Azure account.
  • Azure CLI
  • Basic understanding of Azure portal navigation.
  • Necessary files or content to upload (e.g., a sample HTML website).

2. Download and Install Azure CLI

search for the azure CLI on google and install the compactible version to your PC(Windows or MacOS)
az
imdn

3. Create the web App with Azure CLI and PowerShell

  • open terminal or powershare and run as administrator
  • login to azure using the command
az login
Enter fullscreen mode Exit fullscreen mode
  • The Azure login page will open in your browser. Sign in to your Azure account login
  • Next step is to create a resource group. To create enter the command
az group create --name YesAppRGOladele --location canadacentral
Enter fullscreen mode Exit fullscreen mode

A simple explanation of this command

  • az- azure portal, we are working on azure
    • group- what we want to do on azure is to create a 'resource group'
    • create- the action we want to do, which is to create
    • --name YesAppRGoladele- this is the name to be assigned to the resource group created. You can change it to any name that suits you.
    • --location canadacentral- the location where we want our server to be will be canada central.

Notice there is a space after each command word.
iois

  • Create an App service plan. Enter the command
az appservice plan create --name YesAppoladelePlan --resource-group YesAppRGoladele
Enter fullscreen mode Exit fullscreen mode

myaoo

This will set up YesAppoladelePlan within the already created YesoladeleRGAfeez resource group.

  • Set up a Web App. Enter the command
az webapp create --name YesAppServiceApp --resource-group YesAppRGoladele --plan YesAppoladelePlan
Enter fullscreen mode Exit fullscreen mode

tz

4. Upload content on the webapp

  • Go to azure portal in the App Service section to ensure the web App was successfully created. Search for the app service. add
  • click on the created webapp wenappn
  • on the overview page click on the default domain
    degv
    The link will be re-directed to the created webapp, which should be running and waiting for contents to be uploaded
    tedf

  • In the azure portal search Advanced Tools.

  • Select it and click Go.
    webapp
    A browser(KuduPlus) is opened up in a new browser this contains tools for uploading our code

  • click on debug console

  • select CMD from the dropdown
    cmd

  • select on site
    site

  • Select the wwwroot folder
    imabu

  • Click on the pencil icon on hostingstart.html
    penci

  • Paste in your code and click Save
    davbiks

  • Reopen the Default domain and notice your content have been uploaded and its live

    jki

In this tutorial, you discovered how to create and deploy a web app with Azure App Services. We walked through setting up the service, configuring it, and adding content. Thanks to its scalability, user-friendly interface, and global reach, Azure App Services is an excellent choice for hosting web applications. Your app is now live and ready for further development and exploration.
Thank you for taking the time to read this guide.

Top comments (2)

Collapse
 
tjasper profile image
Oluwaloseyi Oluwatofunmi Emmanuel

Amazing work!

Collapse
 
under2wenty profile image
Precious Oladele

I appreciate you brother