Develop Azure Compute Solutions (25-30%) Flashcards

This section focuses on implementing and managing compute resources like containerized solutions, Azure App Service web apps, and Azure Functions. (111 cards)

1
Q

How would you deploy a container instance in Azure Container Instances (ACI) with an Azure file share mounted as a volume?

A

Use the az container create command with volume mount parameters: az container create --resource-group myResourceGroup --name mycontainer --image mcr.microsoft.com/azuredocs/aci-helloworld --azure-file-volume-account-name <storage-account-name> --azure-file-volume-account-key <storage-account-key> --azure-file-volume-share-name <share-name> --azure-file-volume-mount-path /mnt/azfile. This mounts an Azure file share to the /mnt/azfile path in the container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can you deploy a web application to Azure App Service using a ZIP file?

A

Use the az webapp deploy command: az webapp deploy --resource-group <group-name> --name <app-name> --src-path <filename>.zip. This deploys the contents of the ZIP file to the /home/site/wwwroot directory of the web app.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the primary purpose of Azure Functions within the ‘Develop Azure Compute Solutions’ section?

A

Azure Functions provide a serverless compute platform to execute code in response to events (e.g., HTTP requests, timers, or queue messages) without managing infrastructure, enabling scalable, event-driven solutions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which Azure storage services are you expected to develop solutions for under the ‘Develop for Azure Storage’ domain?

A

The key storage services include: Azure Blob Storage for unstructured data like files and media. Azure Cosmos DB for globally distributed, multi-model database solutions. Azure Table Storage and Queue Storage for specific use cases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the three types of blobs supported by Azure Blob Storage, and what are their primary use cases?

A

Block Blobs: Optimized for large data uploads (e.g., documents, media files); composed of blocks. Append Blobs: Optimized for append operations (e.g., logging); supports appending blocks. Page Blobs: Optimized for random read/write (e.g., VHD files); composed of 512-byte pages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the five consistency levels offered by Azure Cosmos DB, and how do they differ in terms of consistency and performance?

A

Azure Cosmos DB offers: Strong: Highest consistency, lowest throughput, highest latency; ensures reads return the latest write. Bounded Staleness: Balances consistency and availability; reads lag within a specified window. Session: Ensures consistency within a session; moderate throughput and latency. Consistent Prefix: Guarantees write order; higher throughput than session, lower than eventual. Eventual: Lowest consistency, highest throughput, lowest latency; replicas converge eventually.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you initialize a CosmosClient instance in .NET to interact with Azure Cosmos DB?

A

Use the following code: CosmosClient client = new CosmosClient(\"your_endpoint\", \"your_key\");. This creates a client instance with the endpoint URI and primary key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which component of the Azure Cosmos DB Change Feed Processor is responsible for storing state and coordinating processing across multiple consumers?

A

The Lease Container manages state and coordinates processing by storing lease documents, ensuring each change feed event is processed exactly once by one consumer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the primary security areas you need to master under the ‘Implement Azure Security’ domain?

A

Key topics include: Implementing authentication and authorization (e.g., Microsoft Entra ID, OAuth 2.0). Securing data with Azure Key Vault for keys, secrets, and certificates. Using Managed Identities to eliminate credential management.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What core skills are evaluated in the ‘Monitor, Troubleshoot, and Optimize Azure Solutions’ domain?

A

Skills include: Monitoring with Azure Monitor and Application Insights. Troubleshooting application performance and errors. Optimizing solutions for cost, performance, and scalability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What types of integration scenarios should you be prepared for under the ‘Connect to and Consume Azure Services and Third-party Services’ domain?

A

Scenarios include: Consuming Azure services like Event Grid, Service Bus, and Event Hubs for messaging. Integrating with Azure API Management for API exposure. Connecting to third-party services via APIs or SDKs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you deploy a containerized web app to Azure App Service, and what service is often used?

A

Create a Docker image, store it in Azure Container Registry, and deploy via Web App for Containers. Azure Container Registry manages the images.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Azure App Service, and what types of applications can it host?

A

Azure App Service is a fully managed PaaS for hosting web applications, REST APIs, and mobile back ends. It supports apps in .NET, .NET Core, Java, Node.js, Python, PHP, and custom containers on Windows and Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are some key features of Azure App Service you should know that simplify app development and management?

A

Features include multi-language support, managed environment (auto-patching), autoscaling, high availability, continuous deployment (e.g., GitHub, Azure DevOps), custom domains, TLS/SSL, and Docker container support.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How can you create an Azure App Service web app, and what’s a prerequisite?

A

Create it via Azure portal, CLI, or tools like Visual Studio. Prerequisite: an Azure account with an active subscription.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What determines compute resources for an Azure App Service app, and how does scaling work?

A

The App Service plan defines resources and pricing tiers. Scaling can be manual (scale up/out) or automatic (autoscale) based on metrics like CPU or memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How does Azure App Service handle authentication and authorization, and what providers are supported?

A

It offers built-in auth/auth with minimal code, supporting Microsoft Entra ID, Google, Facebook, Twitter, and Microsoft accounts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What app settings can you configure in Azure App Service, and how are they managed?

A

Settings include key-value pairs, SSL/TLS certificates, diagnostic logging, virtual directories, and feature toggles, managed via Azure portal, CLI, or PowerShell.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How does autoscaling work in Azure App Service, and what factors configure it?

A

Autoscaling adjusts resources based on demand, using metrics (e.g., CPU, memory), conditions (thresholds), and rules to scale out (add instances) or up (increase size).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What’s the purpose of deployment slots in Azure App Service, and how do they aid deployment?

A

Slots allow staging/testing updates (e.g., ‘staging’ slot) before swapping to production, enabling zero-downtime deployments and rollbacks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How does a deployment slot swap work in Azure App Service, and what happens during it?

A

It swaps content and config between slots (e.g., staging to production). Staging warms up, then swaps with no downtime; settings can swap or stay slot-specific.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What experience is recommended before tackling Azure App Service topics?

A

One year of developing scalable solutions across all software development phases, plus basic Azure, cloud, and portal knowledge.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How do you secure web traffic in Azure App Service, and what’s required?

A

Install an SSL/TLS certificate via the portal’s TLS/SSL settings. Requires a custom domain and a valid certificate (e.g., from a CA or Azure Key Vault).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

How can you set up continuous deployment for Azure App Service, and what tools are supported?

A

Set up via Azure portal or CLI, integrating with GitHub, Azure DevOps, Bitbucket, or Docker Hub to trigger deployments on code/image updates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How do you enable diagnostic logging in Azure App Service, and what can it troubleshoot?
Enable via the portal’s 'Monitoring' settings for app logs, server logs, or failed request traces. Troubleshoots errors, performance, or deployment issues.
26
What are Azure Functions, and what is their primary purpose?
Azure Functions is a serverless compute service for running event-driven code without managing infrastructure. Its primary purpose is to execute small, single-purpose functions in response to triggers like HTTP requests or timers.
27
What programming languages are supported by Azure Functions development?
Supported languages include C#, Java, JavaScript (Node.js), Python, PowerShell, and TypeScript, with custom handlers for other languages.
28
What are triggers in Azure Functions, and can you name some examples?
Triggers are events that invoke a function. Examples include HTTP requests, timers (TimerTrigger), Azure Blob storage changes (BlobTrigger), and Azure Service Bus messages (ServiceBusTrigger).
29
What role do bindings play in Azure Functions, and how do they differ from triggers?
Bindings connect functions to external data or services (input/output) without extra code. Unlike triggers (which start execution), bindings handle data flow, e.g., Blob storage input or Cosmos DB output.
30
How can you create an Azure Function, and what tools are commonly used?
Create via Azure portal, Azure CLI, or development tools like Visual Studio, Visual Studio Code, or Maven. Requires an Azure subscription and a function app.
31
What is a function app in Azure Functions, and what does it provide?
A function app is a container for one or more Azure Functions, providing a runtime environment, shared configuration (e.g., app settings), and a hosting plan (Consumption, Premium, or App Service).
32
What are the hosting plans for Azure Functions, and how do they differ?
**Consumption**: Serverless, pay-per-execution, auto-scales. **Premium**: Pre-warmed instances, VNet support, longer execution. **App Service**: Dedicated VMs, predictable costs, shared with web apps.
33
How does scaling work in Azure Functions, and what drives it?
Scaling is automatic in Consumption/Premium plans, driven by event volume (e.g., HTTP requests, queue depth). The Scale Controller monitors and adjusts instance count dynamically.
34
What are Durable Functions in Azure Functions, and what problem do they solve?
Durable Functions is an extension for stateful, long-running workflows in a serverless environment. It solves the problem of managing state and orchestration in event-driven apps.
35
What are the main patterns supported by Durable Functions?
Function Chaining: Sequential execution. Fan-out/Fan-in: Parallel tasks with aggregation. Async HTTP APIs: Long-running operations. Monitor: Recurring checks. Human Interaction: Approval workflows.
36
What settings can you configure for an Azure Function, and how are they managed?
Settings include app settings (key-value pairs), runtime version, authentication, and CORS. Managed via Azure portal, CLI, or `host.json`/`local.settings.json`.
37
How do you secure Azure Functions, and what methods are used?
Secure with function keys (host, function-specific), Microsoft Entra ID for auth, API Management integration, and network security (VNet, private endpoints in Premium plan).
38
How can you monitor Azure Functions, and what tools are involved?
Monitor using Azure Monitor and Application Insights for logs, metrics (e.g., execution count, errors), and tracing. Configured via the portal or CLI.
39
What are the deployment options for Azure Functions, and how do they work?
Options include: Zip deploy: Push a .zip package. GitHub/Azure DevOps: Continuous deployment. VS/VS Code: Direct publishing. Deployment targets the function app.
40
What should you know about HTTP triggers in Azure Functions?
HTTP triggers invoke functions via HTTP requests (GET, POST, etc.), support auth levels (anonymous, function, admin), and can return responses directly or via output bindings.
41
How are timer triggers used in Azure Functions, and what defines their schedule?
Timer triggers run functions on a schedule (e.g., every 5 minutes), defined by a CRON expression (e.g., `0 */5 * * * *` for every 5 minutes) in the function’s configuration.
42
What Azure services can Azure Functions integrate with via bindings?
Integration includes Blob Storage, Cosmos DB, Event Hubs, Service Bus, Event Grid, and Queue Storage for input/output operations.
43
How can you develop and test Azure Functions locally?
Use Azure Functions Core Tools and an IDE (e.g., VS Code) to write, run, and debug functions locally, simulating triggers/bindings with `local.settings.json`.
44
What is Infrastructure as a Service (IaaS) in Azure, and what are its key components?
IaaS provides virtualized compute resources managed by Azure. Key components include Azure Virtual Machines (VMs), virtual networks (VNets), and storage, offering full control over OS and infrastructure.
45
How do you create an Azure Virtual Machine, and what are the basic steps?
Create via Azure portal, CLI, or SDK. Steps: Choose image (e.g., Windows/Linux), size, region, VNet, authentication (password/SSH), and configure disks/networking.
46
How do you provision an Azure VM using Azure CLI?
Use `az vm create`: `az vm create --resource-group myRG --name myVM --image UbuntuLTS --admin-username azureuser --generate-ssh-keys`.
47
What are ARM templates in Azure, and what’s their purpose?
ARM (Azure Resource Manager) templates are JSON files defining infrastructure declaratively. Purpose: Automate, repeat, and manage deployments of resources like VMs, storage, and networks.
48
What’s the basic structure of an ARM template?
Includes: `$schema`, `contentVersion`, `parameters`, `variables`, `resources`, `outputs`.
49
How do you deploy a VM using an ARM template and Azure CLI?
Define VM in `resources`, then deploy with `az deployment group create`: `az deployment group create --resource-group myRG --template-file vm-template.json --parameters vmName=myVM adminUsername=azureuser`.
50
How do you create a VM using the Azure.ResourceManager SDK?
Use `ArmClient` to define and deploy a VM: `using Azure.ResourceManager; using Azure.ResourceManager.Compute; ArmClient client = new ArmClient(new DefaultAzureCredential()); ResourceGroupResource rg = client.GetResourceGroupResource(ResourceGroupResource.CreateResourceIdentifier(\"subscription-id\", \"myRG\")); VirtualMachineCollection vmCollection = rg.GetVirtualMachines(); VirtualMachineData vmData = new VirtualMachineData(rg.Data.Location) { /* Configure VM properties */ }; await vmCollection.CreateOrUpdateAsync(WaitUntil.Completed, \"myVM\", vmData);`.
51
How do you configure a VM with a custom script extension?
Use ARM or CLI to add a Custom Script Extension: `az vm extension set --resource-group myRG --vm-name myVM --name CustomScriptExtension --publisher Microsoft.Azure.Extensions --settings '{\"fileUris\": [\"https://script.sh\"], \"commandToExecute\": \"./script.sh\"}'`.
52
What are the availability options for Azure VMs, and how do they improve reliability?
Availability Sets: Distribute VMs across fault/update domains. Availability Zones: Place VMs in separate physical locations. VM Scale Sets: Auto-scale identical VMs. Improve reliability via redundancy.
53
What are VM Scale Sets in Azure, and how do they work?
VM Scale Sets manage identical, load-balanced VMs. They auto-scale based on demand (e.g., CPU usage) and simplify deployment/maintenance of multiple VMs.
54
How do you create a VM Scale Set using Azure CLI?
Use `az vmss create`: `az vmss create --resource-group myRG --name myScaleSet --image UbuntuLTS --instance-count 2 --admin-username azureuser --generate-ssh-keys`.
55
How do you deploy an application to an Azure VM?
Options: Manual setup (SSH/RDP, copy files), Custom Script Extension, or CI/CD (e.g., Azure DevOps) to automate deployment post-provisioning.
56
How can you run containers in Azure IaaS, and what’s a common approach?
Run containers on VMs using Docker. Common approach: Provision VM, install Docker, pull image, and run: `docker run -d -p 80:80 myimage`.
57
What are Azure Container Instances (ACI) in the context of AZ-204 IaaS, and how do you deploy to them?
ACI provides serverless container hosting. Deploy with CLI: `az container create --resource-group myRG --name mycontainer --image myimage --ports 80`.
58
How do you secure Azure IaaS resources like VMs?
Use Network Security Groups (NSGs), firewalls, Microsoft Entra ID (RBAC), disk encryption, and VNet isolation (e.g., private endpoints).
59
How do you monitor Azure IaaS solutions, and what tools are used?
Use Azure Monitor for metrics (e.g., CPU, disk) and Log Analytics for detailed logs, configured via portal or SDK.
60
How do you configure networking for an Azure VM?
Assign to a VNet/subnet, set NSG rules, and configure public IP or load balancer via portal, CLI, or SDK: `az vm open-port --resource-group myRG --name myVM --port 80`.
61
How does hosting an app on a VM differ from Azure App Service?
VMs (IaaS) offer full control over OS/software but require manual management. App Service (PaaS) is managed, auto-scales, and abstracts infrastructure.
62
How do you publish and manage a container image to Azure Container Registry (ACR)?
Use Docker and the Azure CLI: 1. Build and tag the Docker image locally: `docker build -t myimage:latest .` `docker tag myimage:latest myregistry.azurecr.io/myimage:latest` 2. Log in to ACR and push the image: `az acr login --name myregistry` `docker push myregistry.azurecr.io/myimage:latest` 3. Manage the image in ACR using: `az acr repository list --name myregistry --output table` `az acr repository delete --name myregistry --image myregistry.azurecr.io/myimage:latest`. This stores and manages the image in ACR for deployment.
63
How do you create a solution using Azure Container Apps to host a containerized application?
Use the Azure CLI to deploy a container app: `az containerapp create --name mycontainerapp --resource-group myResourceGroup --image myregistry.azurecr.io/myimage:latest --environment myenvironment --target-port 80 --ingress 'external' --min-replicas 1 --max-replicas 3`. This deploys a scalable container app with external ingress, using an image from Azure Container Registry.
64
How can you deploy a containerized application to Azure App Service?
Use the Azure CLI to deploy a Docker container: `az webapp create --resource-group myResourceGroup --name mywebapp --plan myAppServicePlan --deployment-container-image-name myregistry.azurecr.io/myimage:latest`. Configure the app to use the container image, ensuring the App Service plan supports Linux and Docker.
65
How do you implement autoscaling for an Azure App Service Web App to handle varying loads?
Configure autoscale rules in the Azure portal or CLI: 1. Navigate to the App Service plan and enable autoscale. 2. Use the Azure CLI: `az appservice plan update --name myAppServicePlan --resource-group myResourceGroup --min-instances 1 --max-instances 5 --scale-up-rule \"CpuPercentage > 70 for 10 minutes\"`. This scales the app from 1 to 5 instances based on CPU usage exceeding 70% for 10 minutes.
66
How do you configure and implement diagnostics and logging for an Azure App Service Web App?
Enable logging using the Azure CLI: `az webapp log config --name mywebapp --resource-group myResourceGroup --application-logging true --web-server-logging filesystem`. View logs in real-time: `az webapp log tail --name mywebapp --resource-group myResourceGroup`. Configure Application Insights for advanced monitoring: `var builder = WebApplication.CreateBuilder(args); builder.Services.AddApplicationInsightsTelemetry();`.
67
How do you configure TLS, API settings, and connection strings for an Azure App Service Web App?
"1. **TLS**: Bind a custom SSL certificate: `az webapp config ssl bind --resource-group myResourceGroup --name mywebapp --certificate-thumbprint --ssl-type SNI`. 2. **API Settings**: Set via app settings: `az webapp config appsettings set --name mywebapp --resource-group myResourceGroup --settings \"API_KEY=your-api-key\"`. 3. **Connection Strings**: Configure in app settings: `az webapp config connection-string set --name mywebapp --resource-group myResourceGroup --settings \"DefaultConnection=Server=tcp:server.database.windows.net
68
How do you create and configure an Azure Functions app using the Azure CLI?
Use the Azure CLI to create and configure a Functions app: `az functionapp create --resource-group myResourceGroup --name myfunctionapp --storage-account mystorage --consumption-plan-location eastus --runtime dotnet`. Configure settings like app settings: `az functionapp config appsettings set --name myfunctionapp --resource-group myResourceGroup --settings \"FUNCTIONS_EXTENSION_VERSION=~4\"`.
69
How do you implement input and output bindings in an Azure Function using .NET?
Use attributes in a .NET Function: `using Microsoft.Azure.Functions.Worker; using Microsoft.Extensions.Logging; public class MyFunction { [Function(\"ProcessData\")] public static void Run( [BlobTrigger(\"input-container/{name}\", Connection = \"AzureWebJobsStorage\")] string inputBlob, [Blob(\"output-container/{name}\", Connection = \"AzureWebJobsStorage\")] out string outputBlob, ILogger log) { log.LogInformation($\"Processing blob: {inputBlob}\"); outputBlob = inputBlob.ToUpper(); } }`. This uses a Blob trigger as input and writes to an output blob.
70
How do you implement Azure Function triggers using data operations, timers, and webhooks?
1. **Data Operations (e.g., Blob Trigger)**: `[Function(\"BlobTrigger\")] public static void Run( [BlobTrigger(\"container-name/{name}\", Connection = \"AzureWebJobsStorage\")] string myBlob, ILogger log) { log.LogInformation($\"Blob trigger processed: {myBlob}\"); }`. 2. **Timer Trigger**: `[Function(\"TimerTrigger\")] public static void Run([TimerTrigger(\"0 */5 * * * *\")] TimerInfo myTimer, ILogger log) { log.LogInformation($\"Timer trigger executed at: {DateTime.Now}\"); }`. 3. **Webhook (HTTP Trigger)**: `[Function(\"WebhookTrigger\")] public static IActionResult Run( [HttpTrigger(AuthorizationLevel.Function, \"post\")] HttpRequest req, ILogger log) { log.LogInformation(\"Webhook triggered.\"); return new OkResult(); }`.
71
What is a Quick task scenario for Azure Container Registry (ACR) tasks, and how can it be used to build and maintain container images?
A Quick task in ACR is used for simple, one-off builds or maintenance of container images. It supports running a quick build command, such as: `az acr build --registry myregistry --image myimage:latest .`. This triggers a build of a Docker image from the current directory and pushes it to ACR, ideal for rapid testing or single-step image updates.
72
What is an Automatically triggered tasks scenario for Azure Container Registry (ACR) tasks, and how can it automate container image management?
Automatically triggered tasks in ACR automate image builds based on events, such as code commits or base image updates. Configure it using: `az acr task create --registry myregistry --name mytask --trigger-source git --trigger-event commit --source-location https://github.com/myrepo --image myimage:latest --cmd \"docker build -t myregistry.azurecr.io/myimage:latest .\"`. This triggers a build automatically when a git commit occurs, ensuring continuous integration for container images.
73
What is a Multi-step task scenario for Azure Container Registry (ACR) tasks, and how can it be used for complex container image workflows?
A Multi-step task in ACR supports complex workflows with multiple steps, such as building, testing, and pushing images. Define it using a YAML file and run: `az acr task create --registry myregistry --name multistep-task --file multistep-task.yaml`. Example `multistep-task.yaml`: `steps: - cmd: docker build -t myregistry.azurecr.io/myimage:build . - cmd: docker test myregistry.azurecr.io/myimage:build - cmd: docker push myregistry.azurecr.io/myimage:build`. This executes sequential steps for building, testing, and publishing an image.
74
What are the service tiers available in Azure Container Registry (ACR), and what are their key features?
Azure Container Registry offers three service tiers: - **Basic**: Cost-effective entry-level tier for small teams, limited to 10 concurrent builds, no geo-replication, suitable for development. - **Standard**: Enhanced performance with 20 concurrent builds, geo-replication support, ideal for production workloads. - **Premium**: Highest performance with 100 concurrent builds, advanced features like content trust and private endpoints, for large-scale, secure scenarios.
75
What are the primary use cases for Azure Container Registry (ACR) tasks, and how do they support containerized solutions?
ACR tasks support: - Pulling images from ACR to various deployment targets, such as scalable orchestration systems (e.g., Kubernetes, AKS). - Supporting Azure services that build and run containerized applications at scale, like Azure Container Instances and Azure App Service. - Automating image builds and deployments for continuous integration/continuous deployment (CI/CD) pipelines, ensuring consistent, scalable, and repeatable workflows.
76
What are the two common deployment methods for a multi-container group in Azure Container Instances, and how do they differ?
The two common deployment methods are: - **ARM Template**: Recommended when deploying additional Azure resources alongside container instances, offering full resource management with JSON templates. - **YAML File**: Preferred for deployments involving only container instances due to its concise format, ideal for defining container groups. ARM templates support broader infrastructure, while YAML is simpler for containers alone.
77
How does Azure Container Instances allocate resources such as CPUs, memory, and GPUs to a container group?
Azure Container Instances allocates resources by summing the resource requests of the instances in the group: - Specify CPU (e.g., 1.0), memory (e.g., 1.5 GB), and optionally GPUs (preview) for each container. - For a group with two containers, each requesting 1 CPU, the group is allocated 2 CPUs total. Example configuration in YAML: `apiVersion: 2019-12-01 properties: containers: - name: mycontainer properties: resources: requests: cpu: 1.0 memoryInGB: 1.5`.
78
How does networking function in Azure Container Instances for container groups, particularly regarding IP addresses and port namespaces?
Container groups in Azure Container Instances share a single IP address and a port namespace on that IP address: - Containers within the group communicate via `localhost` on exposed ports. - To allow external access, expose ports on the group’s IP (e.g., port 80 for HTTP). Example in CLI: `az container create --resource-group myResourceGroup --name mycontainer --image mcr.microsoft.com/azuredocs/aci-helloworld --ports 80`. This exposes port 80 for external access to the group.
79
How can you configure persistent storage for containers in Azure Container Instances by specifying and mapping external volumes?
Use Azure Files shares as persistent storage: 1. Create a storage account and file share: `az storage account create --name mystorage$RANDOM --resource-group myResourceGroup --location eastus --sku Standard_LRS` `az storage share create --name acishare --account-name mystorage$RANDOM`. 2. Mount the share in a container: `az container create --resource-group myResourceGroup --name mycontainer --image mcr.microsoft.com/azuredocs/aci-hellofiles --azure-file-volume-account-name mystorage$RANDOM --azure-file-volume-account-key $(az storage account keys list --resource-group myResourceGroup --account-name mystorage$RANDOM --query '[0].value' -o tsv) --azure-file-volume-share-name acishare --azure-file-volume-mount-path /aci/logs/`. This maps the Azure file share to `/aci/logs/` in the container for persistent data.
80
What are common use cases for multi-container groups in Azure Container Instances, and how do they benefit containerized solutions?
Multi-container groups are useful for dividing a single functional task into a small number of container images, such as: - A web application container paired with a logging container to collect logs. - An application container with a sidecar for health monitoring or content updates. This enables modular, isolated workloads, improving scalability and maintainability for complex tasks.
81
What is a use case for deploying API endpoints using Azure Container Apps, and how can it be configured?
Deploy API endpoints to expose RESTful services: - Use Azure Container Apps to host containerized APIs, scalable via HTTP traffic. - Configure with the Azure CLI: `az containerapp create --name myapiapp --resource-group myResourceGroup --image myregistry.azurecr.io/myapi:latest --environment myenvironment --target-port 8080 --ingress 'external' --min-replicas 1 --max-replicas 5`. This deploys an API endpoint accessible externally, scaling based on HTTP traffic.
82
What is a use case for hosting background processing applications using Azure Container Apps, and how does it support such workloads?
Host long-running or batch jobs, like data processing: - Use Azure Container Apps to run containerized background tasks without HTTP endpoints. - Configure with no ingress and a timer or event trigger: `az containerapp create --name mybgapp --resource-group myResourceGroup --image myregistry.azurecr.io/mybg:latest --environment myenvironment --min-replicas 1 --max-replicas 1 --ingress 'internal'`. This supports background tasks, such as batch data processing, running continuously or on a schedule.
83
What is a use case for handling event-driven processing using Azure Container Apps, and how can it be implemented?
Handle events from Azure services like Event Grid or Event Hubs: - Use Azure Container Apps to process events, scaling on event-driven triggers. - Configure with an event binding, e.g., Event Grid: `az containerapp create --name myeventapp --resource-group myResourceGroup --image myregistry.azurecr.io/myevent:latest --environment myenvironment --trigger-type eventgrid --min-replicas 0 --max-replicas 10`. This enables event-driven scaling, processing events like blob changes or custom events.
84
What is a use case for running microservices using Azure Container Apps, and how does it support microservice architectures?
Run independent, loosely coupled microservices: - Use Azure Container Apps to host containers for each microservice, scaling individually. - Configure with separate apps per service: `az containerapp create --name myservice1 --resource-group myResourceGroup --image myregistry.azurecr.io/service1:latest --environment myenvironment --target-port 80 --ingress 'external' --min-replicas 1 --max-replicas 5` `az containerapp create --name myservice2 --resource-group myResourceGroup --image myregistry.azurecr.io/service2:latest --environment myenvironment --target-port 8080 --ingress 'external' --min-replicas 1 --max-replicas 5`. This supports microservices with independent scaling and communication via HTTP.
85
What scaling options are available for Azure Container Apps, and how can you configure scaling based on HTTP traffic, events, CPU/memory load, or KEDA-supported scalers?
"Azure Container Apps support: - **HTTP Traffic**: Scale based on request volume (default). - **Event-driven Processing**: Scale on event triggers (e.g., Event Grid, Event Hubs). - **CPU/Memory Load**: Scale on resource utilization using KEDA scalers. - **KEDA-supported Scalers**: Use custom metrics via Kubernetes Event-driven Autoscaling (KEDA). Configure scaling in CLI: `az containerapp update --name mycontainerapp --resource-group myResourceGroup --min-replicas 0 --max-replicas 10 --scale-rule \"name=http
86
What is an App Service plan, and how does it define compute resources for Azure App Service Web Apps?
An App Service plan defines a set of compute resources (VMs) for one or more web apps to run on. Apps configured in the same plan share the same resources, allowing cost efficiency. Create it via CLI: `az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --location eastus --sku B1`. This specifies the compute capacity (e.g., Basic tier, 1.75 GB RAM, 1 core).
87
What are the pricing tiers of an App Service plan in Azure, and how do they differ in terms of resource allocation?
The pricing tiers are: - **Shared**: Runs on shared VMs, limited CPU minutes, no scaling out (e.g., Free, Shared tiers). - **Dedicated**: Runs on dedicated VMs (e.g., Basic, Standard, Premium), allowing scaling and full resource use. - **Isolated**: Runs on isolated VMs in a private VNet, for high security and compliance, with maximum control. Shared tiers lack scaling, while Dedicated and Isolated tiers support scaling across VM instances.
88
How do Azure App Service Web Apps run and scale in the Free and Shared tiers compared to other tiers like Dedicated and Isolated?
Free/Shared Tiers: Apps receive CPU minutes on a shared VM instance and cannot scale out; they’re limited to the allocated CPU time on a single shared VM. Dedicated/Isolated Tiers: Apps run on all VM instances configured in the App Service plan, enabling scaling out (e.g., manual or auto-scaling) across multiple VMs for higher performance and availability. Use CLI to check scaling: `az appservice plan show --name myAppServicePlan --resource-group myResourceGroup`.
89
How does Azure App Service provide continuous integration and deployment support using GitHub?
Configure CI/CD with GitHub in Azure App Service: 1. Enable deployment from GitHub in the Azure portal or CLI: `az webapp deployment source config --name mywebapp --resource-group myResourceGroup --repo-url https://github.com/myrepo --branch main --manual-integration`. 2. Use GitHub Actions for automated builds and deployments: Create a `.github/workflows/deploy.yml`: `name: Deploy to Azure App Service on: [push] jobs: build-and-deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - run: az webapp deploy --resource-group myResourceGroup --name mywebapp --src-path .`. This automates deployment on code pushes to GitHub.
90
How does Azure App Service provide continuous integration and deployment support using Bitbucket?
Configure CI/CD with Bitbucket: 1. Link Bitbucket in the Azure portal or use CLI: `az webapp deployment source config --name mywebapp --resource-group myResourceGroup --repo-url https://bitbucket.org/myrepo --branch main --manual-integration`. 2. Set up a Bitbucket pipeline (e.g., `bitbucket-pipelines.yml`): `image: mcr.microsoft.com/appsvc/php:8.0 pipelines: default: - step: script: - az login --service-principal -u $AZURE_SP_ID -p $AZURE_SP_SECRET --tenant $AZURE_TENANT - az webapp deploy --resource-group myResourceGroup --name mywebapp --src-path .`. This automates deployment on Bitbucket commits.
91
How can you perform manual deployment to an Azure App Service Web App using FTP/S?
Use FTP/S for manual deployment: 1. Retrieve FTP credentials in the Azure portal or CLI: `az webapp deployment list-publishing-profiles --name mywebapp --resource-group myResourceGroup --query \"[0].publishUrl\" -o tsv`. 2. Use an FTP client (e.g., FileZilla) or CLI to upload files: `curl -T myapp.zip ftp://@/site/wwwroot/ --ftp-password `. This uploads files to the `/site/wwwroot` directory for deployment.
92
How does Azure App Service on Linux support hosting web apps natively on Linux, including custom stacks and containers?
Azure App Service on Linux natively supports: - Hosting web apps on Linux for common stacks (e.g., Node.js, Python, PHP, Ruby) via built-in images. - Running custom Linux stacks or containers (Web App for Containers): `az webapp create --resource-group myResourceGroup --name mylinuxapp --plan myAppServicePlan --runtime \"DOCKER|mcr.microsoft.com/appsvc/static:0.1\"`. For custom containers, specify a Docker image: `az webapp config container set --name mylinuxapp --resource-group myResourceGroup --docker-custom-image-name myregistry.azurecr.io/mycustomimage:latest --docker-registry-server-url https://myregistry.azurecr.io`. This supports custom Linux environments or containerized apps.
93
What are the steps to explore staging environments in Azure App Service using deployment slots?
Explore staging environments: 1. Create a deployment slot via CLI: `az webapp deployment slot create --name mywebapp --resource-group myResourceGroup --slot staging`. 2. Deploy code to the staging slot (e.g., using ZIP deploy): `az webapp deploy --resource-group myResourceGroup --name mywebapp --slot staging --src-path myapp.zip`. 3. Test the staging environment by accessing its URL (e.g., `mywebapp-staging.azurewebsites.net`). This isolates staging from production for testing.
94
What does examining slot swapping mean in Azure App Service deployment slots, and how can you prepare for it?
"Examining slot swapping involves verifying settings and configurations before swapping: - Check slot-specific settings (e.g., connection strings) and ensure `slotSetting: true` for sticky settings: `az webapp config connection-string set --name mywebapp --resource-group myResourceGroup --slot staging --settings \"DefaultConnection=Server=tcp:server.database.windows.net
95
How can you swap deployment slots in Azure App Service to move a staging environment to production?
Swap slots using the Azure CLI: `az webapp deployment slot swap --name mywebapp --resource-group myResourceGroup --slot staging`. This moves the staging slot content to production, updating the production URL (`mywebapp.azurewebsites.net`) while preserving slot settings if marked as `slotSetting: true`.
96
How can you route traffic in Azure App Service using deployment slots to test a new version of an app?
Route traffic using slot settings and testing in production: 1. Enable traffic routing in the portal or CLI for the slot: `az webapp traffic-routing set --name mywebapp --resource-group myResourceGroup --slot staging --percentage 20`. 2. Test 20% of traffic on the staging slot while 80% goes to production, monitoring performance before full swap. This supports gradual rollout and testing in production.
97
When should you consider implementing autoscaling for Azure App Service, and what are the key benefits?
Consider autoscaling when: - Autoscaling improves elasticity and fault tolerance for your services. - Autoscaling works by adding or removing web servers based on load. - Autoscaling isn’t the best approach for handling long-term growth (use manual scaling instead). - The number of instances of a service is also a factor for scalability needs. Benefits include availability, fault tolerance, and cost efficiency by scaling dynamically based on usage.
98
What should you do to allow external access to an Azure Container Apps service that has ingress disabled and is scaling to zero instances, without causing downtime?
**Enable ingress** and **configure an HTTP scaling rule** because: - Enabling ingress allows external requests to reach the app. - An HTTP scaling rule ensures the app scales up with incoming traffic and down to zero when idle. - This prevents downtime by dynamically adjusting to demand. Other options like ASE, Traffic Manager, or VNet integration don’t directly enable external access or handle scaling efficiently.
99
What is an HTTP scaling rule in Azure Container Apps, and how does it support external access for an application?
An **HTTP scaling rule** in Azure Container Apps: - Automatically scales the app based on incoming HTTP requests. - Scales up instances when traffic increases and down to zero when idle. - Supports external access by ensuring the app is active to handle requests, preventing downtime. It’s ideal for cost-efficient, demand-driven scaling in serverless container apps.
100
How should you configure Azure Kubernetes Service (AKS) for a financial institution’s microservices handling real-time payment processing to ensure zero downtime during updates, automatic scaling during peak hours, and secure connections to Azure Key Vault?
Use **AKS Deployment Strategy with a rolling update policy** and **enable horizontal pod autoscaling (HPA)** because: - Rolling updates replace pods gradually, ensuring zero downtime during updates. - HPA scales pod replicas based on CPU usage, handling peak loads automatically. - Add managed identities to AKS for secure Key Vault access without credentials. Other options like blue-green deployment, Helm charts, or single-node pools are less efficient or don’t meet high-availability needs.
101
What is a rolling update policy in AKS, and how does it ensure zero downtime for microservices during updates?
A **rolling update policy** in AKS: - Updates pods incrementally, replacing old pods with new ones while keeping others active. - Monitors new pods’ health, halting updates if issues arise, ensuring availability. - Ensures zero downtime by maintaining active pods to serve traffic during the update. It’s ideal for high-availability apps like payment processing microservices.
102
How should you configure an Azure Function app for a logistics company processing real-time GPS data to ensure no data loss during regional outages, conflict-free multi-region processing, and automatic recovery with minimal downtime?
Use **Durable Functions with checkpointing enabled** and **deploy in multiple regions** because: - Checkpointing saves state, ensuring no data loss by resuming from the last checkpoint after failures. - Multi-region deployment enables failover to another region during outages, minimizing downtime. - Durable Functions manage state to process data from multiple regions without conflicts. Other options like geo-replication, ASE, or Event Grid don’t provide state management or automatic recovery.
103
What autoscaling methods should you configure for an Azure App Service that experiences predictable traffic spikes every month to handle increased traffic while optimizing costs?
Use **schedule recurrence** and **CPU utilization** for autoscaling because: - Schedule recurrence scales instances up during known peak times each month. - CPU utilization dynamically adjusts instances for unexpected spikes beyond scheduled scaling. - Together, they ensure performance during peaks and cost efficiency during off-peak times. Other options like predictive algorithms, fixed instances, or manual intervention lack flexibility or efficiency.
104
How do schedule recurrence and CPU utilization optimize autoscaling for predictable traffic spikes?
**Schedule recurrence** and **CPU utilization** optimize autoscaling by: - Schedule recurrence proactively scales up instances during known peak times. - CPU utilization reacts to unexpected spikes, adding instances as load increases. - Ensures cost efficiency by scaling down during off-peak periods. They provide a balanced, responsive approach for predictable traffic patterns.
105
How should you configure an Azure Function App to process messages from an Azure Storage Queue while ensuring FIFO message processing?
Use **Azure Service Bus Queue with sessions** instead of Storage Queue because: - Service Bus Queues support sessions, ensuring messages with the same session ID are processed in order. - Guarantees FIFO (First In, First Out) processing within each session. - Unlike Storage Queues, which don’t support ordering, Service Bus meets strict FIFO needs. Other options like Storage Queue settings, Timer triggers, or Logic Apps don’t ensure FIFO.
106
How does using Azure Service Bus Queue with sessions ensure FIFO message processing in an Azure Function App?
**Azure Service Bus Queue with sessions**: - Groups messages by session ID, processing them in the order they were sent. - Guarantees FIFO within each session, critical for sequential workflows. - Allows parallel processing of different sessions while maintaining order within each. It’s ideal for replacing Storage Queues when strict ordering is required.
107
What is checkpointing in Durable Functions, and how does it support disaster recovery for an Azure Function app?
**Checkpointing** in Durable Functions: - Saves the state of a workflow at key points during execution. - Allows functions to resume from the last checkpoint after a failure or outage, preventing data loss. - Supports disaster recovery by enabling automatic recovery with minimal downtime. It’s essential for reliable processing in apps like real-time GPS data systems.
108
How should you configure an Azure Function app to process large files in parallel for efficient data handling?
Set up a **Premium plan** and configure the function to run on **multiple instances** because: - Premium plan enables multiple instances for concurrent file processing. - Enhances performance with increased memory and faster cold starts. - Allows fine-tuning of concurrency for optimal throughput. Other options like single-threaded, Event Grid, or Durable Functions don’t scale as efficiently for simple concurrency.
109
How does using a Premium plan with multiple instances in an Azure Function app ensure efficient parallel processing of large files?
**Premium plan** with **multiple instances** in Azure Functions: - Runs multiple function instances simultaneously for parallel file processing. - Boosts performance with enhanced resources and faster scaling. - Supports high concurrency to handle large file workloads efficiently. It’s ideal for maximizing throughput in file-heavy applications.
110
Which Azure service should you use for a high-throughput application storing large volumes of time-series data with efficient querying?
Use **Azure Cosmos DB with the SQL API** because: - Scales horizontally to handle high-throughput time-series data. - SQL API enables efficient temporal queries with indexing. - Supports global distribution for low-latency access. Other options like SQL Database, Data Lake, or Table Storage don’t offer the same querying efficiency and scalability.
111
How does Azure Cosmos DB with the SQL API ensure efficient storage and querying for high-throughput time-series data?
**Azure Cosmos DB with the SQL API**: - Manages high-throughput data with automatic scaling and global distribution. - Provides fast temporal queries using SQL API and indexing. - Stores large volumes of time-series data with low-latency access. It’s ideal for high-performance time-series applications in Azure.