DEV Community

Cover image for How to create an App service application in Azure.
EMMANUEL
EMMANUEL

Posted on

How to create an App service application in Azure.

Azure App Service allows developers to build, host, and scale web apps, RESTful APIs, and mobile backends quickly without worrying about managing the underlying infrastructure. It is fully managed by platform as a service (PaaS).Think of it as a ready-to-use web hosting platform in the cloud, where you focus on your code and business logic while Azure takes care of servers, operating systems, scaling, load balancing, and security patches. It can scale automatically, vertical and horizontal with set rules (CPU%, memory, request count etc.),thereby increasing performance.

Types of Apps You Can Host on App Service

  • Web App (Websites and web applications)
  • API Apps (REST APIs for use by web, mobile, or IoT clients.)
  • Mobile Apps(Backend services for mobile apps(push notifications, offline sync, etc.)
  • Azure Function (Serverless event-driven apps. Though Functions is a separate service, but it runs on the same underlying infrastructure as App Service).

In this article, we are going to create a dummy code and use Azure App service to host the code. In other to create App service application we need three things:

  • A resource group.
  • A plan ( The plan determines the compute resources to be used).
  • An empty Web Application.

In the article we are going to generate a code from chatGPT and host it in Azure App service.

1.To create a dummy code, go to chatGPT ,in the search portal ask chatGPT to "give you a sample html, CSS and JavaScript for a simple Chess game" and click enter to generate the code by chatGPT,.Because this is Platform as a service, we are only coming with the code to host it on Azure infrastructure.

Generated code in chatGPT.

2.Login to your Azure portal.

Azure portal login

3.In your Azure portal, in the search resources, search for Azure App services. Click to open the selected App service.

App service

4.Select + Create and choose Web App.

+ Create Web App

5.On the Basics,under Project details,select the Subscription and create Resource group.

Project details

6.Still on the Basics, under the Instance details, choose a name to fill the part of the empty Web App. The next things we are going to do is to choose Code as the publish because we are using code and not container, choose your Runtime stacks .NET 8, then your operating system, in App service we have only two operating system Linux and windows but we are going to choose windows for the article. Then we choose the region.

Instance details

7.Under the Pricing Plan, we choose/create the windows plan and the pricing plan, remember the Plan determines the compute resource.

Pricing plan

8.Select Review + Create and wait for validation pass.

Review + Create

9.After the validation is passed, select Create.

Create

10.Wait for Complete deployment. Go to resource

Complete deployment

11.In other to see that empty web application was create, open the default domain link in another tab.

Domain default link

Empty web app created

12.On the resource, go to the search menu and search for Advanced Tools.Then click on GO

Advanced Tools & Go

13.It will ask you to sign in and then It will open a tool for you that you will use to interact and upload your code.

Sign in

Tool page to upload my code

14.Select Debug console and choose CMD.

Debug console + CMD

15.In CMD select the site.

Site

16.Select wwwroot

wwwroot

17.Click on the pencil icon

Pencil icon

18.A white page will prompt up with a line of code which is responsible for showing us an empty web App.

Empty web app page

19.Go to chatGPT and copy the code for the Chess game generated by chatGPT .

Copied generated code

20.Delete the default code on CMD and paste the code you copied from chatGPT. And save it'

Code

21.Go back to Azure portal, on the web App overview page, click on the default domain link.

Default domain link

22.Verifing the code ( for the chess game) we hosted on the App service. THE CHESS GAME!

Chess game

Top comments (0)