Overview
Azure App Service is a fully managed platform for building, deploying, and scaling web apps. This guide walks you through creating your first web app, deploying code, and monitoring health.
Prerequisites
- An Azure account
- Azure CLI installed (
az) - Git installed
- Basic HTML/Node/Python/.NET knowledge
1. Create an App Service
Run the following commands in your terminal:
az group create --name MyResourceGroup --location "East US"
az appservice plan create --name MyPlan --resource-group MyResourceGroup --sku FREE
az webapp create --name my-first-app-$(date +%s) --resource-group MyResourceGroup --plan MyPlan
2. Deploy Your Code
Initialize a simple Node.js app and push it to Azure:
mkdir myapp && cd myapp
npm init -y
npm install express
cat > index.js <<'EOF'
const express = require('express');
const app = express();
app.get('/', (req, res) => res.send('Hello from Azure App Service!'));
app.listen(process.env.PORT || 3000);
EOF
git init
git add .
git commit -m "Initial commit"
git remote add azure \$(az webapp deployment source config-local-git --name my-first-app-$(date +%s) --resource-group MyResourceGroup --query url -o tsv)
git push azure master
3. Monitor the App
Open the Azure portal or use Azure CLI to view logs:
az webapp log tail --name my-first-app-$(date +%s) --resource-group MyResourceGroup