Search Tutorials


Top Azure App Service Interview Questions (2026) | JavaInuse

Top 20 Azure App Service Interview Questions and Answers


  1. What is Azure App Service?
  2. What is an App Service Plan and what are its pricing tiers?
  3. What is the difference between Azure App Service and Azure Virtual Machines?
  4. How do you deploy applications to Azure App Service?
  5. What are deployment slots in Azure App Service?
  6. How does auto-scaling work in Azure App Service?
  7. What is Azure App Service Environment (ASE)?
  8. How do you configure custom domains and SSL certificates?
  9. What are WebJobs in Azure App Service?
  10. How do you implement authentication in Azure App Service?
  11. What is the difference between continuous and triggered WebJobs?
  12. How do you configure application settings and connection strings?
  13. What is VNET Integration in Azure App Service?
  14. How do you enable and view application logs?
  15. What is Azure App Service Hybrid Connections?
  16. How do you implement CI/CD for Azure App Service?
  17. What are health checks in Azure App Service?
  18. How do you handle traffic routing between deployment slots?
  19. What is the difference between Azure App Service Web Apps and Functions?
  20. How do you configure backup and restore for App Service?

Microsoft Azure Interview Questions

Comprehensive interview questions for Azure cloud services and data engineering roles.

1. What is Azure App Service?

Azure App Service is a fully managed Platform as a Service (PaaS) offering from Microsoft Azure for hosting web applications, REST APIs, mobile backends, and serverless code. It abstracts the underlying infrastructure, allowing developers to focus on application development.

Key Features:
- Multiple Language Support: .NET, .NET Core, Java, Ruby, Node.js, PHP, Python
- Built-in DevOps: CI/CD integration with Azure DevOps, GitHub, Bitbucket
- Global Scale: High availability with SLA up to 99.95%
- Security: ISO, SOC, PCI DSS compliant with built-in authentication
- Enterprise Features: Custom domains, SSL, hybrid connectivity

Types of Apps Supported:
- Web Apps (websites and web applications)
- API Apps (RESTful APIs)
- Mobile Apps (mobile backend services)
- Logic Apps (workflow automation)
- Function Apps (serverless code execution)

2. What is an App Service Plan and what are its pricing tiers?

An App Service Plan defines the compute resources allocated to run your App Service applications. It determines the region, number of VM instances, size of instances, and pricing tier.

Pricing Tiers:

Free and Shared (Dev/Test):
- Shared infrastructure with other customers
- Limited compute minutes (Free: 60 min/day, Shared: 240 min/day)
- No custom domains (Free) or limited custom domains
- No SLA provided

Basic (B1, B2, B3):
- Dedicated VM instances
- Manual scaling up to 3 instances
- Custom domains and SSL supported
- Best for: Development and testing

Standard (S1, S2, S3):
- Auto-scaling up to 10 instances
- Deployment slots (5 slots)
- Daily backups
- Best for: Production workloads

Premium (P1v2, P2v2, P3v2, P1v3, P2v3, P3v3):
- Enhanced performance and scale
- Up to 30 instances with auto-scale
- 20 deployment slots
- VNET Integration
- Best for: Enterprise production

Isolated (I1, I2, I3):
- Dedicated App Service Environment (ASE)
- Network isolation in customer's VNET
- Up to 100 instances
- Best for: High security/compliance requirements

3. What is the difference between Azure App Service and Azure Virtual Machines?

AspectAzure App Service (PaaS)Azure VMs (IaaS)
ManagementPlatform managed - no OS patching requiredFull control - manual OS management
ScalingBuilt-in auto-scalingManual or VM Scale Sets
DeploymentMultiple easy deployment optionsManual deployment and configuration
CostGenerally lower TCOHigher due to management overhead
CustomizationLimited to platform capabilitiesFull customization possible
Use CaseWeb apps, APIs, modern applicationsLegacy apps, full control needs

When to choose App Service:
- Standard web frameworks and languages
- No need for OS-level access
- Want to minimize operational overhead
- Need quick deployment and scaling

When to choose VMs:
- Legacy applications with specific dependencies
- Need full control over the operating system
- Applications requiring specific software installations
- Custom networking requirements

4. How do you deploy applications to Azure App Service?

Azure App Service supports multiple deployment methods:

1. Azure DevOps / GitHub Actions:
# GitHub Actions workflow
name: Deploy to Azure Web App
on:
  push:
    branches: [main]

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    
    - name: Deploy to Azure Web App
      uses: azure/webapps-deploy@v2
      with:
        app-name: 'my-web-app'
        publish-profile: [null]
        package: '.'

2. Azure CLI:
# Deploy from local folder
az webapp up --name my-web-app --resource-group myRG --runtime "PYTHON:3.9"

# Deploy from ZIP
az webapp deployment source config-zip --resource-group myRG \
  --name my-web-app --src app.zip

3. FTP/FTPS:
- Get FTP credentials from Azure Portal
- Upload files directly to /site/wwwroot

4. Local Git:
- Enable local Git in Deployment Center
- Push to Azure remote repository

5. Container Deployment:
- Deploy Docker containers from ACR or Docker Hub

5. What are deployment slots in Azure App Service?

Deployment slots are live apps with their own hostnames that allow you to deploy and test changes before swapping to production.

Benefits:
- Zero-downtime deployments
- Warm-up instances before swap
- Easy rollback by swapping back
- A/B testing capabilities

Slot-specific vs Swap Settings:
// Slot-specific settings (NOT swapped):
- Connection strings marked as "slot setting"
- App settings marked as "slot setting"
- Custom domain bindings
- SSL certificates

// Settings that ARE swapped:
- Application code
- App settings (not marked slot-specific)
- Handler mappings
- Public certificates

Common Workflow:
# Create staging slot
az webapp deployment slot create --name my-web-app \
  --resource-group myRG --slot staging

# Deploy to staging
az webapp deployment source config-zip --name my-web-app \
  --resource-group myRG --slot staging --src app.zip

# Swap staging to production
az webapp deployment slot swap --name my-web-app \
  --resource-group myRG --slot staging --target-slot production




6. How does auto-scaling work in Azure App Service?

Azure App Service supports both manual and automatic scaling based on metrics or schedules.

Scale Up (Vertical):
- Change to a higher pricing tier
- More CPU, memory, disk space
- Additional features

Scale Out (Horizontal):
- Add more instances
- Load balanced automatically
- Available in Standard tier and above

Auto-scale Configuration:
// Metric-based auto-scale rule (JSON)
{
  "rules": [{
    "metricTrigger": {
      "metricName": "CpuPercentage",
      "metricResourceUri": "[resourceId('Microsoft.Web/serverfarms', 'myPlan')]",
      "timeGrain": "PT1M",
      "statistic": "Average",
      "timeWindow": "PT10M",
      "timeAggregation": "Average",
      "operator": "GreaterThan",
      "threshold": 70
    },
    "scaleAction": {
      "direction": "Increase",
      "type": "ChangeCount",
      "value": "1",
      "cooldown": "PT5M"
    }
  }],
  "profiles": [{
    "capacity": {
      "minimum": "1",
      "maximum": "10",
      "default": "1"
    }
  }]
}

Common Metrics for Scaling:
- CPU Percentage
- Memory Percentage
- HTTP Queue Length
- Data In/Out
- Custom metrics

7. What is Azure App Service Environment (ASE)?

App Service Environment is a premium, fully isolated, and dedicated environment for securely running App Service apps at high scale.

Key Features:
- Network Isolation: Deployed directly into customer's VNET
- Dedicated Infrastructure: Single-tenant environment
- High Scale: Up to 100 instances per ASE
- Internal Load Balancer: Apps accessible only within VNET

ASE Versions:
- ASEv3: Latest version, simplified networking, faster scaling
- ASEv2: Legacy, being deprecated

Use Cases:
- Applications requiring network isolation
- Compliance requirements (HIPAA, PCI-DSS)
- Very large scale applications
- Integration with on-premises systems via VPN/ExpressRoute

# Create ASEv3
az appservice ase create --name myASE --resource-group myRG \
  --vnet-name myVNet --subnet ase-subnet --kind ASEv3

# Create App Service Plan in ASE
az appservice plan create --name myPlan --resource-group myRG \
  --app-service-environment myASE --sku I1v2 --is-linux

8. How do you configure custom domains and SSL certificates?

Custom Domain Configuration:
# Steps to add custom domain:
1. Add CNAME record in DNS: www.mydomain.com -> myapp.azurewebsites.net
2. Or add A record: mydomain.com -> App Service IP
3. Add TXT record for verification: asuid.mydomain.com -> verification-id

# Azure CLI
az webapp config hostname add --webapp-name myapp \
  --resource-group myRG --hostname www.mydomain.com

SSL Certificate Options:
- App Service Managed Certificate: Free, auto-renewed, for custom domains
- Bring Your Own Certificate: Upload PFX certificate
- Azure Key Vault: Reference certificates stored in Key Vault

# Create managed certificate
az webapp config ssl create --name myapp --resource-group myRG \
  --hostname www.mydomain.com

# Bind SSL certificate
az webapp config ssl bind --name myapp --resource-group myRG \
  --certificate-thumbprint  --ssl-type SNI

9. What are WebJobs in Azure App Service?

WebJobs is a feature that enables running background programs or scripts in the same instance as a web app.

Types of WebJobs:
- Continuous: Runs immediately and keeps running (long-running processes)
- Triggered: Runs on schedule or manual trigger

Supported File Types:
- .cmd, .bat, .exe (Windows)
- .sh (Linux)
- .ps1 (PowerShell)
- .py (Python)
- .js (Node.js)
- .jar (Java)

// settings.job for scheduled WebJob (CRON)
{
  "schedule": "0 */5 * * * *"  // Every 5 minutes
}

// Upload WebJob via CLI
az webapp webjob continuous create --name myapp --resource-group myRG \
  --webjob-name myWebjob --webjob-type continuous \
  --file-path ./myjob.zip

WebJobs SDK:
- Simplifies writing background processing code
- Integrates with Azure Storage queues, blobs, tables
- Supports triggers and bindings

10. How do you implement authentication in Azure App Service?

Azure App Service provides built-in authentication/authorization (Easy Auth) without code changes.

Supported Identity Providers:
- Microsoft (Azure AD)
- Facebook
- Google
- Twitter
- Apple
- Any OpenID Connect provider

# Enable Azure AD authentication via CLI
az webapp auth update --name myapp --resource-group myRG \
  --enabled true --action LoginWithAzureActiveDirectory \
  --aad-client-id  \
  --aad-client-secret  \
  --aad-token-issuer-url https://login.microsoftonline.com//v2.0

// Accessing user claims in code (.NET)
var claims = HttpContext.User.Claims;
var email = claims.FirstOrDefault(c => c.Type == "preferred_username")?.Value;

// HTTP headers provided by Easy Auth
X-MS-CLIENT-PRINCIPAL-NAME: user@domain.com
X-MS-CLIENT-PRINCIPAL-ID: 
X-MS-TOKEN-AAD-ACCESS-TOKEN: 

11. What is the difference between continuous and triggered WebJobs?

AspectContinuous WebJobTriggered WebJob
ExecutionStarts immediately and keeps runningRuns on schedule or manual trigger
InstancesRuns on all instancesSingle instance for load balancing
RestartAuto-restart on failureNo automatic restart
DebuggingSupports remote debuggingNo remote debugging
Code Location\site\wwwroot\app_data\Jobs\Continuous\site\wwwroot\app_data\Jobs\Triggered
Use CaseQueue processing, long pollingScheduled tasks, batch jobs

12. How do you configure application settings and connection strings?

Application settings in App Service are environment variables available to your application at runtime.

Configuration Methods:
# Azure CLI
az webapp config appsettings set --name myapp --resource-group myRG \
  --settings MyKey="MyValue" AnotherKey="AnotherValue"

# Connection strings
az webapp config connection-string set --name myapp --resource-group myRG \
  --connection-string-type SQLAzure \
  --settings MyDb="Server=...;Database=..."

// Accessing in code
// .NET
var myValue = Environment.GetEnvironmentVariable("MyKey");
var connString = Environment.GetEnvironmentVariable("SQLAZURECONNSTR_MyDb");

// Node.js
const myValue = process.env.MyKey;

// Python
import os
my_value = os.environ.get('MyKey')

Important Notes:
- App settings override values in web.config/appsettings.json
- Connection string environment variables are prefixed by type (SQLAZURECONNSTR_, etc.)
- Mark settings as "slot setting" to prevent swapping

13. What is VNET Integration in Azure App Service?

VNET Integration allows App Service apps to access resources in or through an Azure Virtual Network.

Types of VNET Integration:

Regional VNET Integration:
- Connects to VNET in same region
- Requires dedicated subnet (/28 minimum)
- Available in Standard and above tiers
- Supports connecting to on-premises via ExpressRoute/VPN

Gateway-required VNET Integration:
- Uses VNET Gateway with Point-to-Site VPN
- Can connect to VNETs in other regions
- Older method, regional integration preferred

# Enable VNET Integration
az webapp vnet-integration add --name myapp --resource-group myRG \
  --vnet myVNet --subnet app-subnet

# Configure app to route all traffic through VNET
az webapp config appsettings set --name myapp --resource-group myRG \
  --settings WEBSITE_VNET_ROUTE_ALL="1"

14. How do you enable and view application logs?

Azure App Service provides multiple logging options:

Log Types:
- Application Logging: Your application's log output
- Web Server Logging: HTTP request logs
- Detailed Error Messages: Detailed error pages
- Failed Request Tracing: Request pipeline information

# Enable application logging
az webapp log config --name myapp --resource-group myRG \
  --application-logging filesystem --level verbose

# Enable web server logging
az webapp log config --name myapp --resource-group myRG \
  --web-server-logging filesystem

# Stream logs in real-time
az webapp log tail --name myapp --resource-group myRG

# Download logs
az webapp log download --name myapp --resource-group myRG \
  --log-file logs.zip

Log Analytics Integration:
- Send logs to Azure Monitor/Log Analytics
- Create alerts and dashboards
- Long-term retention




15. What is Azure App Service Hybrid Connections?

Hybrid Connections provide access to application resources in other networks (on-premises or other clouds) without firewall changes.

How It Works:
- Uses Azure Relay as intermediary
- Hybrid Connection Manager installed on-premises
- Outbound HTTPS connection from on-premises (no inbound rules needed)

Use Cases:
- Access on-premises SQL Server from App Service
- Connect to internal APIs
- Integrate with legacy systems

// Configuration steps:
1. Create Hybrid Connection in Azure Portal
   - Specify endpoint hostname and port (e.g., sqlserver:1433)
   
2. Install Hybrid Connection Manager on-premises
   - Download from Azure Portal
   - Configure with connection string
   
3. App connects using standard hostname
   - Connection routed through Azure Relay
   
// Connection string in app
Server=onprem-sqlserver;Database=mydb;User Id=user;Password=pass;

16. How do you implement CI/CD for Azure App Service?

Azure DevOps Pipeline:
# azure-pipelines.yml
trigger:
- main

pool:
  vmImage: 'ubuntu-latest'

stages:
- stage: Build
  jobs:
  - job: Build
    steps:
    - task: UseDotNet@2
      inputs:
        version: '6.x'
    - task: DotNetCoreCLI@2
      inputs:
        command: 'publish'
        publishWebProjects: true
        arguments: '-o $(Build.ArtifactStagingDirectory)'
    - task: PublishBuildArtifacts@1
      inputs:
        pathtoPublish: '$(Build.ArtifactStagingDirectory)'

- stage: Deploy
  jobs:
  - deployment: Deploy
    environment: 'production'
    strategy:
      runOnce:
        deploy:
          steps:
          - task: AzureWebApp@1
            inputs:
              azureSubscription: 'MySubscription'
              appName: 'myapp'
              package: '$(Pipeline.Workspace)/**/*.zip'

GitHub Actions:
- Use publish profile for authentication
- azure/webapps-deploy action for deployment
- Support for deployment slots

17. What are health checks in Azure App Service?

Health checks allow App Service to monitor application health and automatically remove unhealthy instances from load balancer rotation.

Configuration:
# Enable health check via CLI
az webapp config set --name myapp --resource-group myRG \
  --generic-configurations '{"healthCheckPath": "/health"}'

// Health check endpoint implementation (.NET)
app.MapGet("/health", () => {
    // Perform health checks
    var dbHealthy = CheckDatabaseConnection();
    var cacheHealthy = CheckCacheConnection();
    
    if (dbHealthy && cacheHealthy)
        return Results.Ok("Healthy");
    else
        return Results.StatusCode(503);
});

Behavior:
- Pings health endpoint every minute
- Instance removed after 10 consecutive failures (configurable)
- Unhealthy instances restarted automatically
- Works with auto-scale and deployment slots

18. How do you handle traffic routing between deployment slots?

Azure App Service supports gradual traffic shifting between slots for controlled rollouts.

# Route 20% of traffic to staging slot
az webapp traffic-routing set --name myapp --resource-group myRG \
  --distribution staging=20

# View current routing
az webapp traffic-routing show --name myapp --resource-group myRG

# Clear routing rules (100% to production)
az webapp traffic-routing clear --name myapp --resource-group myRG

Use Cases:
- Canary deployments - gradual rollout
- A/B testing - compare versions
- Blue-green deployments - instant switch

Auto-swap:
- Automatically swap after successful warm-up
- Useful for staging to production automation

19. What is the difference between Azure App Service Web Apps and Functions?

AspectWeb AppsAzure Functions
ArchitectureAlways-on web applicationsEvent-driven, serverless
BillingPay for allocated resourcesPay per execution (Consumption plan)
ScalingManual or auto-scale rulesAutomatic event-driven scaling
Cold StartAlways warmMay have cold starts (Consumption)
TimeoutNo timeout5-10 min default (configurable)
Use CaseFull applications, APIsBackground jobs, webhooks, event processing

Choose Web Apps when:
- Long-running HTTP requests
- Complex, full-featured applications
- Predictable workloads

Choose Functions when:
- Event-driven processing
- Variable/unpredictable workloads
- Microservices architecture

20. How do you configure backup and restore for App Service?

Azure App Service provides automated backup for app content and configuration.

Requirements:
- Standard or Premium tier
- Azure Storage account for backup storage

# Create backup configuration
az webapp config backup create --webapp-name myapp --resource-group myRG \
  --container-url "https://storage.blob.core.windows.net/backups?sv=..." \
  --backup-name myBackup

# Schedule automatic backups
az webapp config backup update --webapp-name myapp --resource-group myRG \
  --frequency 1d --retain-one true --retention 30

# Restore from backup
az webapp config backup restore --webapp-name myapp --resource-group myRG \
  --backup-name myBackup --overwrite

What's Backed Up:
- App configuration
- File content (/site/wwwroot)
- Connected databases (optional)

Limitations:
- Maximum 10GB total (4GB for databases)
- Databases must be in same subscription
- App is read-only during restore

Microsoft Azure Interview Questions

Comprehensive interview questions for Azure cloud services and data engineering roles.


Popular Posts