App Services / Functions / Container Apps
Platform Selection
| Platform | Use Case | Pricing Model | Scalability |
|---|---|---|---|
| App Service | Web apps, APIs | Fixed plan | Manual/Auto |
| Functions | Event-driven, microservices | Consumption/Premium | Auto |
| Container Apps | Microservices, containerized apps | Usage-based | Auto (KEDA) |
App Service
Create Web App
# Create App Service Plan
New-AzAppServicePlan -Name "MyPlan" `
-ResourceGroupName "MyRG" `
-Location "East Asia" `
-Tier "Standard" `
-NumberofWorkers 2
# Create Web App
New-AzWebApp -Name "myapp" `
-ResourceGroupName "MyRG" `
-Location "East Asia" `
-AppServicePlan "MyPlan"
Azure Functions
HTTP Trigger Example
[FunctionName("HttpTrigger")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
return new OkObjectResult("Hello from Azure Functions!");
}
Container Apps
Deploy Container App
# Create Container Apps environment
az containerapp env create \
--name myenvironment \
--resource-group MyRG \
--location eastasia
# Deploy container app
az containerapp create \
--name myapp \
--resource-group MyRG \
--environment myenvironment \
--image mcr.microsoft.com/azuredocs/containerapps-helloworld:latest \
--target-port 80 \
--ingress external
Next Steps
- Network and Security: VNet integration
- AI/OpenAI: Functions and OpenAI integration