Host a RESTful API in Azure App Service Using Azure Cloud Shell

0 87
  1. Select the Cloud Shell button on the menu bar at the upper right in the Azure portal.
  2. FTP and local Git can deploy to an Azure web app by using a deployment user. Once you configure your deployment user, you can use it for all your Azure deployments. Your account-level deployment username and password are different from your Azure subscription credentials.
    To configure the deployment user, run the az webapp deployment user set command in Azure Cloud Shell. Replace <username> and <password> with a deployment user username and password.
    az webapp deployment user set --user-name <username> --password <password>
  3. Create a resource group
    az group create --name myResourceGroup --location "West Europe"
  4. Create an App Service plan
    az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku FREE
  5. Create a web app, replace <app-name> with your app name
    az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name <app-name> --deployment-local-git
  6. Get deployment user details from
  7. Clone the code
    git clone https://github.com/Azure-Samples/dotnet-core-api
    cd dotnet-core-api
  8. Push to Azure from Git, replace <deploymentLocalGitUrl-from-create-step> this with your deployment user details
    git add .
    git commit -m "Deploying to App Service"
    git remote add azure <deploymentLocalGitUrl-from-create-step>
    git push azure master
  9. Browse to the Azure app
    Navigate to http://<app_name>.azurewebsites.net/swagger in a browser and play with the Swagger UI.

Leave A Reply

Your email address will not be published.