Creating an Azure App Service web app

In this demonstration, we are going to create an Azure App Service web app. We are going to deploy a web API from GitHub to Azure using the CLI. Then, we are going to use Azure Cloud Shell for deployment. 

Go through the following steps:

  1. Navigate to the Azure portal by opening https://portal.azure.com/.
  2. Select the Cloud Shell button from the top-right menu bar in the Azure portal.
  3. Add the following code to deploy the web API from the GitHub repository. First, set the GitHub repository URL and the web app name:
gitrepo="https://github.com/PacktPublishing/Microsoft-Azure-Architect-Technologies-Exam-Guide-AZ-300/Chapter14/PacktPubToDoAPI"
webappname="PacktPubToDoAPI"
  1. Create a resource group:
az group create --location eastus --name PacktWebAppResourceGroup
  1. Create an App Service plan in the free tier:
az appservice plan create --name $webappname --resource-group PacktWebAppResourceGroup --sku FREE
  1. Create a web app:
az webapp create --name $webappname --resource-group PacktWebAppResourceGroup --plan $webappname
  1. Deploy the code from the GitHub repository:
az webapp deployment source config --name $webappname --resource-group PacktWebAppResourceGroup 
--repo-url $gitrepo --branch master --manual-integration
  1. Open a browser and add the following URL:
https://packtpubtodoapi.azurewebsites.net/api/ToDo

You will see the following output in the browser:

Output API

Now, we have deployed the web API inside an Azure Web App. In the next section, we are going to create documentation for the API.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.109.4