From the course: Azure Essential Training for Developers

Create an App Service to host an API - Azure Tutorial

From the course: Azure Essential Training for Developers

Start my 1-month free trial

Create an App Service to host an API

- [Instructor] Using the Azure Cloud Shell we can quickly create an Azure app service to host an API. I'll show you how in literally just a few steps. As you can see I'm already logged onto the Azure portal. Open the Azure Cloud Shell by clicking on its icon located on the top menu. You can maximize this window to be in full focus. To host an Azure app service we first need to create a plan. We can do this by using the AZ app service plan create command. Type az space appservice space plan space create. Next, we'll need to add some parameters about our plan. First, will be the name so type dash dash name followed by the name of the app service plan. For me I'll use dev dash cakes dash api. Next, we'll need to assign it to a resource group so use the resource group parameter. That's dash dash resource dash group. And since this is a dev API I will also tie it to my dev resource group. Lastly, we'll need to use the dash dash sku parameter which is the pricing tier. In this case, I just want to use the FREE tier since this will be a dev instance. Just press Enter. Awesome, we've created our app service plan. You'll know that is was successfully created when you see an object given back like this. Next, we'll need to create the web app itself. The one that's going to host the api. Type az space webapp space create and then specify the resource group which will be dev for me, the plan which is the name of the plan I just created. So for me that's dev dash cakes dash api. And the name of the web app itself which will be cakes for all. Finally, add the deployment local git parameter so that we can use git to deploy our app. That'll be dash dash deployment dash local dash git. Then press Enter. Once this command finishes successfully you should receive some JSON output like this. All that's left is to find the deployment local git URL. Go ahead and copy that URL and you'll be able to add it as a git remote where you can push your API.

Contents