Was ist Azure App Service?
Azure App Service ist eine vollständig verwaltete PaaS (Platform as a Service) für Web-Applikationen, REST APIs und Backends. Microsoft verwaltet die Server, Betriebssystem-Updates und Load Balancer – Sie deployen nur Code.
Unterstützte Runtimes
| Runtime | Versionen |
|---|---|
| .NET / ASP.NET | .NET 6, 7, 8 |
| Node.js | 18, 20 |
| Python | 3.9, 3.10, 3.11, 3.12 |
| Java | 11, 17, 21 |
| PHP | 8.0, 8.1, 8.2 |
| Ruby | 3.1, 3.2 |
App Service Plan
Der App Service Plan definiert Region, OS und Compute-Ressourcen:
| Tier | vCPU | RAM | Preis/Monat |
|---|---|---|---|
| F1 (Free) | Shared | 1 GB | Kostenlos |
| B1 (Basic) | 1 | 1,75 GB | ~13 € |
| B2 | 2 | 3,5 GB | ~27 € |
| P1v3 (Premium) | 2 | 8 GB | ~72 € |
| P2v3 | 4 | 16 GB | ~145 € |
# App Service Plan erstellen
az appservice plan create \
--name asp-firma-prod \
--resource-group rg-firma-prod \
--sku B2 \
--is-linux \
--location germanywestcentral
# Web App erstellen
az webapp create \
--name firma-webapp \
--resource-group rg-firma-prod \
--plan asp-firma-prod \
--runtime "NODE:20-lts"
Deployment-Methoden
1. Git-Deployment (Local Git)
# Deployment-Credentials setzen
az webapp deployment user set \
--user-name deployer \
--password SicheresPasswort123!
# Git Remote hinzufügen
git remote add azure https://[email protected]/firma-webapp.git
git push azure main
2. GitHub Actions (empfohlen)
# .github/workflows/azure-deploy.yml
name: Deploy to Azure
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: azure/webapps-deploy@v2
with:
app-name: firma-webapp
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
3. Docker Container
az webapp create \
--name firma-webapp \
--resource-group rg-firma-prod \
--plan asp-firma-prod \
--deployment-container-image-name myregistry.azurecr.io/myapp:latest
Umgebungsvariablen und Connection Strings
# App Settings setzen
az webapp config appsettings set \
--name firma-webapp \
--resource-group rg-firma-prod \
--settings \
NODE_ENV=production \
API_URL=https://api.firma.de
# Connection String (verschlüsselt gespeichert)
az webapp config connection-string set \
--name firma-webapp \
--resource-group rg-firma-prod \
--connection-string-type SQLAzure \
--settings DB_CONN="Server=..."
Deployment Slots (Staging → Produktion)
# Staging-Slot erstellen (nur Standard/Premium)
az webapp deployment slot create \
--name firma-webapp \
--resource-group rg-firma-prod \
--slot staging
# In Staging deployen (separat erreichbar)
# https://firma-webapp-staging.azurewebsites.net
# Swap: Staging → Produktion (Zero-Downtime!)
az webapp deployment slot swap \
--name firma-webapp \
--resource-group rg-firma-prod \
--slot staging \
--target-slot production
Auto-Scaling
# Autoscale-Profil (nur Premium)
az monitor autoscale create \
--resource firma-webapp \
--resource-group rg-firma-prod \
--resource-type Microsoft.Web/sites \
--name autoscale-webapp \
--min-count 2 \
--max-count 10 \
--count 2
# Skalierungsregel: CPU > 70% → +1 Instanz
az monitor autoscale rule create \
--autoscale-name autoscale-webapp \
--resource-group rg-firma-prod \
--scale out 1 \
--condition "Percentage CPU > 70 avg 5m"
Custom Domain und SSL
# Domain hinzufügen
az webapp config hostname add \
--webapp-name firma-webapp \
--resource-group rg-firma-prod \
--hostname www.firma.de
# Managed SSL-Zertifikat (kostenlos!)
az webapp config ssl create \
--name firma-webapp \
--resource-group rg-firma-prod \
--hostname www.firma.de
FAQ
Was ist der Unterschied zu Azure Container Apps?
App Service: Traditionelles PaaS, fest gebunden an Runtimes. Azure Container Apps: Serverless Container-Plattform, flexibler. Für neue Projekte empfehlen wir Container Apps oder App Service für einfache Web-Apps.
Kann ich SSH in einen App Service nutzen?
Ja: az webapp ssh --name firma-webapp --resource-group rg-firma-prod oder im Portal über die App Service Editor Console.
Fazit
Azure App Service ist der schnellste Weg eine Web-App in der Cloud zu deployen – ohne Server-Management, mit eingebautem SSL und Auto-Scaling.
Azure-Deployments für KMU in Heidelberg, Mannheim und der Rhein-Neckar-Region. Cloud-Beratung anfragen.