How to create an Azure web app easilly!

Hello everyone so this time we’re going to discuss about how to create an web application in Microsoft Azure!

So as the first step we have to recognize what are the programming languages we can use to create web apps in azure. We can create web apps by Microsoft .net, Java, Node.js, Python, PHP. So we will use PHP in this time. Go to the https://azure.microsoft.com/en-us/get-started/web-app/ and click in the launch quickstart in PHP section.

choose the development platform

When comes to web app creating, we can build them in Windows OS or even in Linux OS. In this article we will discuss how to deploy an app in Windows. We may need two prerequisites. We may need git and PHP installed in your computer.

How to deploy app locally

When comes to azure, we can download and run our application locally in your machine. So as I said in previous paragraph, we need Git and PHP for this step. First open the Git Bash console and add following code.

git clone https://github.com/Azure-Samples/php-docs-hello-world
cd php-docs-hello-world

In this one first line will be cloning the Azure Samples -> php-docs-hello-world file to your computer. second code line will change the direction to C:\Users\(User Name)\php-docs-hello-world.

php -S localhost:8080

After the first two lines type the above code line for start the localhost server. After adding the code in git bash. So you can successfully host the application. Then add the “http://localhost:8080” in your URL (without double quotes)

If you want to cancel the operation, just press ctlr + C

In previous example, we used bash to our operation. So lets do the same activity using Azure Cloud Shell.

Using Azure Cloud Shell

Azure hosts its applications through Azure cloud shell. Azure cloud shell is a interactive shell environment which you can access through the browser. When you use the url, https://shell.azure.com/ it will ask to use bash or Powershell to work.

Else you can go to the azure dashboard and click on the shell icon which in the menu bar and open the shell terminal. So lets run the above code in Azure terminal. First copy the code from there and paste it in the cloud shell. For pasting you can use Ctrl+Shift+V in Windows and Cmd+Shift+V in MacOS. Then press Enter button to execute the code.

Let’s discuss how to deploy apps using a deployment user in the next article…

Leave a Reply

Your email address will not be published. Required fields are marked *