Host a RESTful API in Azure App Service Using Azure Cloud Shell
- Select the Cloud Shell button on the menu bar at the upper right in the Azure portal.
- 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>
- Create a resource group
az group create --name myResourceGroup --location "West Europe"
- Create an App Service plan
az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku FREE
- 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
- Get deployment user details from
- Clone the code
git clone https://github.com/Azure-Samples/dotnet-core-api
cd dotnet-core-api
- 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
- Browse to the Azure app
Navigate tohttp://<app_name>.azurewebsites.net/swagger
in a browser and play with the Swagger UI.