Interview Q&A

Technical interview questions with detailed answers—organized by course, like Dot Net Tutorials interview sections. Original content for Toolliyo Academy.

Popular tracks

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Seamless integration with .NET and Visual Studio.
  • Provides scalable cloud services like App Services, Functions, and Storage.
  • Supports PaaS, IaaS, and SaaS deployment models.
  • Built-in monitoring, security, and identity management.
  • Rapid deployment of microservices and serverless apps.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Trigger)

Scenario: When a customer places an order, the backend pushes a message to Azure

Storage Queue.

Azure Function processes it asynchronously.

Trigger: QueueTrigger

Use Case: Payment processing, inventory updates, email notifications.

Code Example (C#)

public class OrderProcessor

[FunctionName("ProcessOrder")]

public void Run(

[QueueTrigger("orders", Connection = "StorageConn")] string

orderJson,

ILogger log)

var order = JsonSerializer.Deserialize<Order>(orderJson);

log.LogInformation($"Processing order #{order.Id}");

// Call payment gateway

// Update inventory

// Send confirmation email

public record Order(int Id, string Product, int Qty);

✅ 2. Schedule Daily Database Backup

(Timer Trigger)

Scenario: Run SQL backup, archive logs, or clean old data every night.

Trigger: TimerTrigger

Use Case: Automation jobs, scheduled cleanups, maintenance tasks.

Code Example

public static class DailyBackup

[FunctionName("DailyDatabaseBackup")]

public static async Task Run(

[TimerTrigger("0 0 2 * * *")] TimerInfo timer,

ILogger log)

log.LogInformation("Starting daily database backup...");

// Call SQL API / storage account to create backup

await BackupService.RunBackupAsync();

log.LogInformation("Backup completed.");

⏰ "0 0 2 * * *" → runs daily at 2 AM

✅ 3. Generate Thumbnails for Uploaded

Images (Blob Trigger)

Scenario: When a user uploads an image, automatically create a thumbnail and store it.

Trigger: BlobTrigger

Use Case: Photo apps, e-commerce product images, document

workflows.

Code Example

[FunctionName("GenerateThumbnail")]

public static async Task Run(

[BlobTrigger("uploads/{name}", Connection = "StorageConn")]

Stream input,

string name,

[Blob("thumbnails/{name}", FileAccess.Write, Connection =

"StorageConn")] Stream output,

ILogger log)

log.LogInformation($"Creating thumbnail for {name}");

using var image = Image.Load(input);

image.Mutate(x => x.Resize(200, 200)); // resize

image.SaveAsJpeg(output);

✅ 4. Send Email Notifications from

Event Grid (Event Grid Trigger)

Scenario: A new user signs up → Event Grid sends event → Function triggers email.

Trigger: EventGridTrigger

Use Case: User signup, audit logs, subscription events.

Code Example

[FunctionName("UserSignupEmail")]

public static async Task Run(

[EventGridTrigger] EventGridEvent eventGridEvent,

ILogger log)

var data = eventGridEvent.Data.ToObjectFromJson<UserEvent>();

log.LogInformation($"New user signup: {data.Email}");

await EmailService.SendWelcomeEmail(data.Email);

✅ 5. Serverless REST API (HTTP

Trigger)

Scenario: Build lightweight APIs without using App Services.

Trigger: HttpTrigger

Use Case: Microservices, webhooks, backend-for-frontend APIs.

Code Example

[FunctionName("GetUserById")]

public static IActionResult Run(

[HttpTrigger(AuthorizationLevel.Function, "get", Route =

"users/{id}")] HttpRequest req,

string id,

ILogger log)

var user = UserDb.GetUser(id);

if (user == null)

return new NotFoundResult();

return new OkObjectResult(user);

✅ 6. Process Messages from Service

Bus (Service Bus Trigger)

Scenario: Enterprise integration between microservices.

Trigger: ServiceBusTrigger

Use Case: Order processing, billing, messaging between systems.

Code Example

[FunctionName("ProcessPayment")]

public static async Task Run(

[ServiceBusTrigger("payments", Connection = "ServiceBusConn")]

string message,

ILogger log)

var payment = JsonSerializer.Deserialize<Payment>(message);

log.LogInformation($"Processing payment {payment.Id}");

await PaymentService.CompleteAsync(payment);

✅ 7. Auto-Delete Expired Files (Blob +

Timer + Logic)

Scenario: Remove files older than 30 days to reduce storage costs.

Trigger: TimerTrigger

Use Case: Data lifecycle automation.

Code Example

[FunctionName("DeleteOldFiles")]

public static async Task Run(

[TimerTrigger("0 */30 * * * *")] TimerInfo timer,

ILogger log)

var client = new BlobContainerClient(

Environment.GetEnvironmentVariable("StorageConn"), "logs");

await foreach (var blob in client.GetBlobsAsync())

if (blob.Properties.CreatedOn <

DateTimeOffset.UtcNow.AddDays(-30))

await client.DeleteBlobAsync(blob.Name);

log.LogInformation($"Deleted old file: {blob.Name}");

🔹 Section 1: Azure for .NET Developers – General

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Supports staging slots, approvals, and automated rollback.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • ASP.NET Core apps can be deployed to Azure App Service or Azure Functions.
  • Supports Azure SQL Database, Cosmos DB, Blob Storage, and other services.
  • Configuration through Azure Key Vault and App Settings.

Example: Deploying an ASP.NET Core app to App Service via Visual Studio:

public class Startup

public void ConfigureServices(IServiceCollection services)

services.AddControllers();

services.AddDbContext<MyDbContext>(options =>

options.UseSqlServer(Configuration.GetConnectionString("DefaultConne

ction")));

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Model Description Example for .NET

IaaS

(Infrastructure)

Provides virtual machines,

networking, storage

Azure VM running Windows + IIS

hosting ASP.NET app

PaaS (Platform) Managed hosting environment

for apps

Azure App Service, Azure Functions

SaaS (Software) Fully managed software

accessible via browser

Office 365, Dynamics 365

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure SDK for .NET – for resource management and service integration.
  • Azure CLI & PowerShell – scripting deployments.
  • Visual Studio / VS Code Extensions – publish and manage resources.
  • NuGet packages – Azure.Storage.Blobs, Azure.Cosmos, Azure.Identity.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • By using Azure SDKs or REST APIs.
  • Use Azure Identity for authentication.
  • Example for Azure Blob Storage:

using Azure.Storage.Blobs;

var blobServiceClient = new

BlobServiceClient("<connection_string>");

var containerClient =

blobServiceClient.GetBlobContainerClient("mycontainer");

await containerClient.UploadBlobAsync("sample.txt", new

BinaryData("Hello Azure!"));

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • A set of NuGet packages to interact with Azure resources from .NET apps.
  • Includes services like Storage, Cosmos DB, Key Vault, Event Hubs, and more.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure Identity library: supports Managed Identity, Service Principal, and

Interactive Login.

Example using DefaultAzureCredential:

using Azure.Identity;

using Azure.Storage.Blobs;

var credential = new DefaultAzureCredential();

var blobServiceClient = new BlobServiceClient(new

Uri("

credential);

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Configuration management for multiple environments (dev, staging, prod).
  • Connection strings and secrets management.
  • Handling scaling and performance tuning.
  • Ensuring proper authentication and permissions.
  • Monitoring logs and diagnostics effectively.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Direct publish to Azure App Service from Visual Studio.
  • Manage Azure resources using Cloud Explorer.
  • Add Azure SDK references and NuGet packages easily.
  • Supports Azure Functions, WebJobs, and Logic Apps templates.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure App Service App Settings or Azure Key Vault.
  • ASP.NET Core supports appsettings.json, appsettings.{Environment}.json, and

environment variables.

Example:

// appsettings.Production.json

"ConnectionStrings": {

"DefaultConnection":

"Server=tcp:myserver.database.windows.net;Database=prodDB;..."

var connectionString =

Configuration.GetConnectionString("DefaultConnection");

🔹 Section 2: Azure App Services – .NET Developer

Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure App Service is a fully managed PaaS platform for hosting web apps, REST

APIs, and mobile backends.

  • It handles infrastructure, scaling, security, and patching automatically.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Web Apps – host web applications.
  • API Apps – host REST APIs.
  • Mobile Apps – backend for mobile applications.
  • Function Apps – serverless compute for small tasks and triggers.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Visual Studio: Right-click project → Publish → Azure → App Service → Create or

select existing → Publish.

  • Azure CLI:

az webapp up --name myapp --resource-group myResourceGroup --runtime

"DOTNET:6.0"

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Web Apps: Designed for websites, support Razor Pages, MVC, and Blazor.
  • API Apps: Optimized for RESTful APIs, includes built-in Swagger support and API

authentication features.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Defines the compute resources (CPU, memory, storage) for your App Service.
  • Determines pricing tier, scaling, and availability.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Vertical scaling: Increase instance size (CPU, memory).
  • Horizontal scaling: Add more instances (scale out).
  • Autoscaling: Automatically adjust instances based on metrics like CPU usage.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Deployment slots are separate environments (like staging or testing) within the

same App Service.

  • You can deploy new versions to staging before swapping to production.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Deploy the new version to a staging slot.
  • Test functionality and performance.
  • Swap staging with production instantly with zero downtime.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use the deployment history in the App Service → select a previous deployment →

Redeploy.

  • Alternatively, swap back staging slot if using blue-green deployment.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • In Azure Portal → App Service → Diagnostics logs → Enable:
  • Application Logging (Filesystem/Blob)
  • Web Server Logging
  • Detailed Error Messages
  • Failed Request Tracing
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Kudu Console:
  • Or Log Stream in Azure Portal → App Service → Log Stream
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure Portal → App Service → Custom Domains → Add domain → Validate →

Update DNS.

  • SSL/TLS can be applied using Azure-managed certificates.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • App Service supports HTTPS endpoints.
  • Use Azure-managed certificates or bring your own certificate.
  • SSL binding is done per custom domain.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use the startup command for Linux apps (App Service Plan) in Azure Portal.
  • For Windows apps, configure web.config or use Program.cs in ASP.NET Core:

public class Program

public static void Main(string[] args)

var host = CreateHostBuilder(args).Build();

// Custom startup logic here

host.Run();

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Configure scale rules based on metrics: CPU %, memory, HTTP queue length.
  • Set minimum and maximum instance counts.
  • Azure automatically adds or removes instances to handle traffic.

🔹 Section 3: Deploying ASP.NET Core Web Apps –

Azure Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Visual Studio Publish: One-click deployment from IDE.
  • Azure CLI / PowerShell: Command-line deployment scripts.
  • Zip Deploy: Upload a zipped package of the app.
  • FTP / FTPS: Manual upload of files to Azure App Service.
  • WebDeploy (MSDeploy): Supports incremental deployment.
  • CI/CD Pipelines: Using Azure DevOps or GitHub Actions.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Method Description Use Case

Zip Deploy Upload a zip file; replaces app

content

Quick automated

deployments

FTP/FTPS Manual file upload via FTP client Small apps or manual

updates

WebDeploy

(MSDeploy)

Incremental deployment with config

& db sync

Complex apps with

dependencies

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Create workflow YAML in .github/workflows/.
  • Use Azure WebApp Action to deploy.

name: Build and Deploy ASP.NET Core

on:

push:

branches: [ main ]

jobs:

build-and-deploy:

runs-on: ubuntu-latest

steps:

  • uses: actions/checkout@v3
  • name: Setup .NET

uses: actions/setup-dotnet@v3

with:

dotnet-version: '6.0.x'

  • name: Build

run: dotnet publish -c Release -o publish

  • name: Deploy to Azure Web App

uses: azure/webapps-deploy@v2

with:

app-name: 'my-azure-app'

publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}

package: ./publish

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Create Azure DevOps Pipeline:
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure App Service App Settings override appsettings.json.
  • Use Azure Key Vault for sensitive information like connection strings.

builder.Configuration.AddAzureKeyVault(

new Uri("

new

DefaultAzureCredential());

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Check Deployment Center logs in Azure Portal.
  • Use Kudu diagnostic console
  • Enable detailed error messages and application logging.
  • Check App Service Health and Resource Quotas.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Kudu is the deployment engine behind Azure App Service.
  • Provides:
  • Console access to the app environment
  • Process explorer
  • Deployment logs
  • File explorer for troubleshooting
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Entity Framework Core Migrations:

dotnet ef database update

  • Automate in deployment pipeline:

using (var scope = app.Services.CreateScope())

var db =

scope.ServiceProvider.GetRequiredService<MyDbContext>();

db.Database.Migrate();

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • In Azure Portal → App Service → Configuration → Application settings → Add

key-value pairs.

  • ASP.NET Core automatically reads ASPNETCORE_ENVIRONMENT for

environment-specific configs.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Create appsettings.Production.json, appsettings.Staging.json etc.
  • Set ASPNETCORE_ENVIRONMENT in App Service → App Settings.
  • ASP.NET Core automatically loads the appropriate file:

var builder = WebApplication.CreateBuilder(args);

builder.Configuration

.AddJsonFile("appsettings.json")

.AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.jso

n", optional: true);

🔹 Section 4: Slot Deployment – Azure App Service

Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • A deployment slot is a separate environment for your App Service, e.g., staging,

testing, QA, or production.

  • Each slot runs as a full App Service instance with its own hostname, configuration,

and settings.

  • Enables zero-downtime deployments by swapping slots.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Safe deployment: Test new versions in staging before production.
  • Zero downtime: Swap staging to production instantly.
  • Rollback support: Swap back to previous slot if issues arise.
  • Configuration isolation: Slot-specific settings and connection strings.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Deploy the new version to a staging slot.
  • Test thoroughly using the staging URL.
  • Swap staging → production via Azure Portal, CLI, or PowerShell.

Example using Azure CLI:

az webapp deployment slot swap \

  • -resource-group MyResourceGroup \
  • -name MyAppService \
  • -slot staging \
  • -target-slot production
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Slot-sticky settings remain specific to a slot and do not swap.
  • Examples:
  • Connection strings marked as “Slot Setting”
  • App settings marked as “Slot Setting”
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Access the staging slot URL (e.g.,
  • Verify:
  • App functionality
  • Database connectivity
  • Third-party integrations
  • Performance and load tests
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Yes, by swapping back the staging slot to production.
  • Alternatively, use deployment history to redeploy a previous version.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Settings not marked as slot-specific will swap.
  • Slot-specific settings (sticky) remain in their original slot.
  • This ensures environment-specific configs like DB connections or API keys remain

correct.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Warm-up issues: Apps may require time to initialize after swap.
  • Configuration mismatches: If slot-specific settings are not marked correctly.
  • Session state issues: If using in-memory session, it will reset.
  • Traffic routing: Any in-progress requests may be affected briefly.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Yes, Azure App Service supports multiple slots depending on the App Service Plan

tier:

  • Standard: 5 slots
  • Premium: 20 slots
  • Isolated: 25+ slots
  • Free and Basic tiers do not support slots.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Authentication settings are slot-specific if configured as sticky.
  • Use Azure AD or Managed Identity for secure slot-specific access.
  • External identity providers must be correctly configured for staging vs production.

🔹 Section 5: Azure Functions / Serverless Computing

  • Q&A
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure Functions is a serverless compute service that allows you to run

event-driven code without managing infrastructure.

  • Ideal for background jobs, event processing, and microservices.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • No infrastructure management
  • Automatic scaling based on demand
  • Pay-per-use billing model
  • Fast deployment and iteration
  • Integration with Azure services like Event Grid, Storage, and Service Bus
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • C#, F#, JavaScript, TypeScript, Python, Java, PowerShell, and custom handlers.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Visual Studio: File → New Project → Azure Functions → Choose Trigger → .NET

6/7

  • Example: HTTP-triggered function

[FunctionName("HelloFunction")]

public static IActionResult Run(

[HttpTrigger(AuthorizationLevel.Function, "get", "post")]

HttpRequest req,

ILogger log)

log.LogInformation("C# HTTP trigger function processed a

request.");

string name = req.Query["name"];

return new OkObjectResult($"Hello, {name ?? "World"}!");

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • In-process: Runs within the same process as the Functions runtime. Direct access

to runtime APIs.

  • Isolated process: Runs in a separate process, providing better dependency

isolation and .NET version flexibility.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Triggers: Define how a function is invoked (e.g., HTTP request, timer, queue

message).

  • Bindings: Simplify input/output connections to external services (e.g., Storage,

Cosmos DB).

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • HTTP trigger
  • Timer trigger
  • Blob trigger
  • Queue trigger
  • Event Grid trigger
  • Event Hub trigger
  • Service Bus trigger
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

[FunctionName("QueueProcessor")]

public static void Run(

[QueueTrigger("myqueue", Connection = "AzureWebJobsStorage")]

string message,

ILogger log)

log.LogInformation($"Queue message received: {message}");

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Durable Functions allow stateful workflows in serverless apps.
  • Enable orchestration, chaining, and long-running tasks without managing state

manually.

Example:

[FunctionName("OrchestratorFunction")]

public static async Task RunOrchestrator(

[OrchestrationTrigger] IDurableOrchestrationContext context)

await context.CallActivityAsync("HelloActivity", "Tokyo");

await context.CallActivityAsync("HelloActivity", "Seattle");

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Durable Functions, Azure Storage, Cosmos DB, or Redis Cache.
  • Serverless functions themselves are stateless by design.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Function.json or attributes in C# for retry policies.

[FunctionName("QueueRetryFunction")]

[FixedDelayRetry(3, "00:00:10")]

public static void Run([QueueTrigger("retryqueue")] string message,

ILogger log)

log.LogInformation($"Processing message: {message}");

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Right-click the Function Project → Publish → Azure → Select Function App →

Publish

  • Supports slots, CI/CD, and zip deployment
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Function keys are authentication tokens used to control access to Azure Functions.
  • Can be function-level or host-level.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure Functions Core Tools:

func start

  • Supports local storage emulator and debugging in Visual Studio.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Consumption Plan: Automatically scales out based on trigger events.
  • Premium Plan: Provides pre-warmed instances for faster response and scaling.
  • Dedicated App Service Plan: Manual scaling like a normal App Service.

🔹 Section 6: Triggers and Bindings in Azure Functions

  • Q&A
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • A trigger defines how and when a function is invoked.
  • Examples: HTTP requests, queue messages, blob changes, timer events.
  • Every function must have exactly one trigger.

Example (HTTP trigger):

[FunctionName("HttpTriggerFunction")]

public static IActionResult Run(

[HttpTrigger(AuthorizationLevel.Function, "get", "post")]

HttpRequest req,

ILogger log)

log.LogInformation("HTTP trigger executed.");

return new OkObjectResult("Hello from Azure Function!");

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Input bindings: Provide data to the function from external sources (e.g., queue

message, blob content).

  • Output bindings: Send data from the function to external destinations (e.g., Cosmos

DB, Storage Queue).

Example:

[FunctionName("QueueToBlobFunction")]

public static void Run(

[QueueTrigger("myqueue")] string queueMessage,

[Blob("output-container/{rand-guid}.txt", FileAccess.Write)] out

string blobContent,

ILogger log)

log.LogInformation($"Processing queue message: {queueMessage}");

blobContent = queueMessage; // Write to blob

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Yes. A function can have one trigger and multiple input/output bindings.
  • Simplifies reading/writing from multiple sources in a single execution.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use [BlobTrigger] for input or [Blob] for output.

Example (input blob):

[FunctionName("BlobProcessor")]

public static void Run(

[BlobTrigger("input-container/{name}")] Stream blobStream,

string name,

ILogger log)

log.LogInformation($"Processing blob: {name}");

Example (output blob):

[Blob("output-container/output.txt", FileAccess.Write)] out string

outputBlob

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use [CosmosDBTrigger] for input and [CosmosDB] for output.

Example (input Cosmos DB trigger):

[FunctionName("CosmosDBTriggerFunction")]

public static void Run(

[CosmosDBTrigger(

databaseName: "MyDatabase",

collectionName: "MyCollection",

ConnectionStringSetting = "CosmosDBConnection",

LeaseCollectionName = "leases")] IReadOnlyList<Document>

input,

ILogger log)

foreach (var doc in input)

log.LogInformation($"Document received: {doc.Id}");

Example (output Cosmos DB binding):

[CosmosDB(

databaseName: "MyDatabase",

collectionName: "MyCollection",

ConnectionStringSetting = "CosmosDBConnection")] out dynamic

outputDoc

outputDoc = new { id = Guid.NewGuid(), Name = "New Item" };

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Trigger: Invokes the function. Every function must have one trigger.
  • Binding: Connects function inputs/outputs to external resources. Optional, can have

multiple.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Remove manual SDK code for connecting to Azure services.
  • Automatically serialize/deserialize data.
  • Focus on business logic instead of plumbing.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • In Function attributes (C#) like [Blob], [QueueTrigger]
  • Or in function.json for configuration settings:

"type": "queueTrigger",

"direction": "in",

"name": "myQueueItem",

"queueName": "myqueue",

"connection": "AzureWebJobsStorage"

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Store secrets in Azure App Service Application Settings or Key Vault.
  • Reference via Connection property in binding:

[QueueTrigger("myqueue", Connection = "AzureWebJobsStorage")]

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Yes, using binding expressions like {name}, {rand-guid}, or {datetime}.

Example (dynamic blob output):

[Blob("container/{name}-{datetime}.txt", FileAccess.Write)] out

string outputBlob

🔹 Section 7: Azure SQL / Cosmos DB – Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure SQL Database is a fully managed relational database service on Azure.
  • Provides automatic backups, patching, scaling, high availability, and security.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure Cosmos DB is a globally distributed, multi-model NoSQL database.
  • Supports key-value, document, graph, and column-family data models.
  • Provides automatic scaling, low latency, and global replication.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Feature Azure SQL Cosmos DB

Type Relational NoSQL, multi-model

Schema Fixed Schema-less

Scaling Vertical/Horizontal Horizontal, automatic

Consistenc

ACID Multiple consistency levels (Strong, Eventual, etc.)

Use Case OLTP, structured

data

Global apps, unstructured data, IoT

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use connection string in appsettings.json:

"ConnectionStrings": {

"DefaultConnection":

"Server=tcp:myserver.database.windows.net,1433;Initial

Catalog=MyDb;Persist Security Info=False;User

ID=myuser;Password=mypassword;MultipleActiveResultSets=False;Encrypt

=True;TrustServerCertificate=False;Connection Timeout=30;"

  • Inject DbContext using Entity Framework Core:

builder.Services.AddDbContext<MyDbContext>(options =>

options.UseSqlServer(builder.Configuration.GetConnectionString("Defa

ultConnection")));

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • SQL Authentication: Username and password.
  • Azure Active Directory (AAD) authentication.
  • Managed Identity: Use Azure App Service identity to connect without storing

credentials.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Serverless compute tier auto-scales based on workload and pauses during inactivity.
  • Cost-efficient for intermittent workloads.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure Data Migration Assistant (DMA).
  • Use bacpac import/export.
  • Use SQL Server Management Studio (SSMS) deploy options.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • DTU (Database Transaction Unit): Bundled measure of CPU, memory, IOPS.
  • vCore: Separate allocation of virtual cores, memory, and storage.
  • vCore allows flexible scaling and cost optimization.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use ADO.NET connection pooling (default in .NET).
  • Ensure DbContext is scoped per request in ASP.NET Core.
  • Example:

services.AddDbContext<MyDbContext>(options =>

options.UseSqlServer(connectionString));

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Enable Transparent Data Encryption (TDE).
  • Configure firewall rules and VNet integration.
  • Use AAD authentication or Managed Identity.
  • Enable Advanced Threat Protection.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Restricts database access to specific IP ranges or VNets.
  • Ensures only authorized clients can connect.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Provisioned throughput: Fixed Request Units (RUs) per second.
  • Serverless: Automatically scales and billed per request.
  • Use serverless for low or intermittent traffic.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • SQL (Core) API
  • MongoDB API
  • Cassandra API
  • Gremlin (Graph) API
  • Table API
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure.Cosmos NuGet package (v3+) is preferred.
  • Example:

var cosmosClient = new CosmosClient(endpointUri, primaryKey);

var container = cosmosClient.GetContainer("DatabaseId",

"ContainerId");

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use QueryDefinition and FeedIterator with MaxItemCount.

var query = new QueryDefinition("SELECT * FROM c");

var iterator = container.GetItemQueryIterator<MyItem>(query,

requestOptions: new QueryRequestOptions { MaxItemCount = 10 });

while (iterator.HasMoreResults)

foreach (var item in await iterator.ReadNextAsync())

Console.WriteLine(item.Id);

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Cosmos DB supports Strong, Bounded Staleness, Session, Consistent Prefix,

Eventual.

  • Set consistency when creating CosmosClient:

var clientOptions = new CosmosClientOptions

ConsistencyLevel = ConsistencyLevel.Session

var cosmosClient = new CosmosClient(endpointUri, primaryKey,

clientOptions);

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Cosmos DB automatically indexes all properties by default.
  • You can customize index paths for performance.

"indexingMode": "consistent",

"includedPaths": [

{"path": "/name/?"},

{"path": "/age/?"}

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Automatic backups every 4 hours (retention 7–30 days depending on config).
  • Restore using point-in-time restore in Azure Portal or via CLI.

🔹 Section 8: Azure Key Vault – Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure Key Vault is a cloud service for securely storing and managing secrets,

keys, and certificates.

  • Helps protect sensitive information like connection strings, passwords, API keys,

and encryption keys.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Secrets: Strings, passwords, API keys, connection strings
  • Keys: Cryptographic keys for encryption/decryption (RSA, EC)
  • Certificates: SSL/TLS or client certificates
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure.Extensions.AspNetCore.Configuration.Secrets package to load

secrets into IConfiguration.

var builder = new ConfigurationBuilder()

.AddAzureKeyVault(new Uri("

new DefaultAzureCredential());

var configuration = builder.Build();

var secretValue = configuration["MySecret"];

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Configure Access Policies in Azure Portal or via Azure CLI.
  • Assign roles:
  • Get → read secrets
  • List → enumerate secrets
  • Set → update secrets
  • Use Managed Identity for apps instead of storing credentials.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Feature Secret Key Certificate

Data type Any string Cryptographic key X.509 certificate

Use case Passwords, connection

strings

Encryption, signing SSL/TLS or client auth

Managed

Secret store Key store Certificate store

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Enable Managed Identity on your App Service or Function App.
  • Grant Key Vault access policy to the identity.
  • Access secrets without storing credentials:

var client = new SecretClient(new

Uri("

new

DefaultAzureCredential());

KeyVaultSecret secret = client.GetSecret("MySecret");

string value = secret.Value;

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Enable diagnostic logging in Azure Key Vault.
  • Logs include secret reads, updates, deletions, and authentication attempts.
  • Can be sent to Log Analytics, Event Hub, or Storage Account.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Update via Azure Portal, Azure CLI, PowerShell, or SDK.

Example using SDK:

var client = new SecretClient(new

Uri("

new

DefaultAzureCredential());

client.SetSecret("MySecret", "NewValue");

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Store connection strings as secrets in Key Vault.
  • Load them in ASP.NET Core via IConfiguration.
  • Avoid storing secrets in appsettings.json or code.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Yes, using in-memory caching or Azure App Configuration with Key Vault

integration.

  • Improves performance and reduces frequent Key Vault calls.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Managed Identity instead of app credentials.
  • Enable soft-delete and purge protection.
  • Rotate secrets regularly.
  • Restrict access using RBAC or access policies.
  • Enable logging and monitoring for audit purposes.

🔹 Section 9: Azure Storage – Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • An Azure Storage Account is a container for all storage services in Azure.
  • Provides Blob, Queue, Table, and File storage.
  • Offers scalable, durable, and highly available storage.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Containers are logical groups of blobs within a storage account.
  • Like folders in a file system.
  • Each blob must belong to one container.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure.Storage.Blobs NuGet package.

Upload example:

var blobServiceClient = new BlobServiceClient(connectionString);

var containerClient =

blobServiceClient.GetBlobContainerClient("mycontainer");

var blobClient = containerClient.GetBlobClient("file.txt");

using var fileStream = File.OpenRead("localfile.txt");

await blobClient.UploadAsync(fileStream, overwrite: true);

Download example:

var downloadPath = "downloaded.txt";

await blobClient.DownloadToAsync(downloadPath);

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Blob tier determines cost and access latency.
  • Can be set during upload or later:

await blobClient.SetAccessTierAsync(AccessTier.Cool);

  • Hot: Frequently accessed
  • Cool: Infrequent access
  • Archive: Rarely accessed
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • A message queuing service for decoupled communication between applications.
  • Supports FIFO processing, retries, and message TTL.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure.Storage.Queues package.

Send message:

var queueClient = new QueueClient(connectionString, "myqueue");

await queueClient.CreateIfNotExistsAsync();

await queueClient.SendMessageAsync("Hello, Azure Queue!");

Receive message:

var message = await queueClient.ReceiveMessageAsync();

Console.WriteLine(message.Value.MessageText);

await queueClient.DeleteMessageAsync(message.Value.MessageId,

message.Value.PopReceipt);

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Feature Azure Queue Service Bus Queue

Protocol HTTP/REST AMQP

Features Simple FIFO Advanced (sessions, transactions,

dead-letter)

Scalability High High but more complex

Use Case Simple decoupling Enterprise messaging with reliability

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Table Storage stores key-value pairs in entities.
  • Use PartitionKey and RowKey for unique identification.

Example:

var tableClient = new TableClient(connectionString, "MyTable");

await tableClient.CreateIfNotExistsAsync();

var entity = new TableEntity("partition1", "row1")

{ "Name", "John" },

{ "Age", 30 }

await tableClient.AddEntityAsync(entity);

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure.Storage.Blobs, Azure.Storage.Queues, Azure.Data.Tables,

Azure.Storage.Files.Shares.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Provides SMB/NFS-based shared file storage.
  • Useful for legacy apps, lift-and-shift, or file shares across VMs.

Example:

var shareClient = new ShareClient(connectionString, "myfileshare");

await shareClient.CreateIfNotExistsAsync();

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Configure via Azure Portal or Azure CLI.
  • Example CLI:

az storage cors add --methods GET POST --origins

  • -services b --account-name mystorage
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Shared Access Signatures (SAS)
  • Enable storage account firewall & VNet rules
  • Use Azure AD authentication
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • SAS provides temporary, limited access to storage resources.
  • Can define expiry time, permissions, and resource type.

Example:

var sasToken = blobClient.GenerateSasUri(BlobSasPermissions.Read,

DateTimeOffset.UtcNow.AddHours(1));

Console.WriteLine(sasToken);

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure Monitor, Metrics, and Diagnostic Logs.
  • Track requests, bandwidth, errors, latency.
  • Can integrate with Log Analytics or Application Insights.

🔹 Section 10: Azure DevOps – Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure DevOps is a set of development tools for software teams to plan, develop,

test, and deploy applications.

  • Provides CI/CD pipelines, version control, agile planning, and package

management in one platform.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Provides Git repositories for version control.
  • Supports branching, pull requests, code reviews, and collaboration among teams.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure Pipelines → Create new YAML pipeline or Classic pipeline.
  • Example YAML for ASP.NET Core:

trigger:

  • main

pool:

vmImage: 'windows-latest'

steps:

  • task: UseDotNet@2

inputs:

packageType: 'sdk'

version: '7.x'

  • script: dotnet build --configuration Release

displayName: 'Build project'

  • script: dotnet test --no-build --verbosity normal

displayName: 'Run tests'

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Feature Classic

Pipeline

YAML Pipeline

Definition GUI-based Code-based (in repo)

Versioning Manual Versioned with code

CI/CD Supported Supported,

recommended

Reusability Limited High

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Add a release stage in pipeline targeting Azure App Service.
  • Example YAML step:
  • task: AzureWebApp@1

inputs:

azureSubscription: 'MyAzureConnection'

appName: 'my-webapp'

package: '$(System.DefaultWorkingDirectory)/drop/*.zip'

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Logical groups representing Dev, QA, Staging, Production.
  • Support approval gates, deployment strategy, and rollback.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Pipeline Variables (secret) or Azure Key Vault integration.
  • Example:

variables:

  • name: MySecret

value: $(MySecretFromVault)

isSecret: true

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Centralized package repository for NuGet, npm, Maven, or Python packages.
  • Enables sharing, versioning, and dependency management across teams.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Publish in pipeline:
  • task: NuGetCommand@2

inputs:

command: push

packagesToPush: '**/*.nupkg'

publishVstsFeed: 'MyFeed'

  • Consume in projects by adding feed URL in nuget.config.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Track work items, bugs, features, and tasks.
  • Plan sprints, create Kanban boards, and monitor team velocity.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • A unit of work like bug, task, user story, or feature.
  • Can be assigned, tracked, and linked to code commits.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Boards, Dashboards, Queries, and Analytics.
  • Monitor burn-down charts, lead time, and cycle time.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Link GitHub repo in Service Connections.
  • Configure build pipeline to trigger on GitHub pushes or pull requests.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Machines managed by you to run CI/CD pipelines.
  • Useful for custom software, large builds, or on-prem resources.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Key-value pairs used in pipelines for configuration, secrets, or dynamic values.
  • Can be set at pipeline, stage, or runtime.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Define stages in YAML for Dev, QA, Staging, and Production.
  • Example:

stages:

  • stage: Build

jobs:

  • job: BuildJob

steps:

  • script: dotnet build
  • stage: Deploy

dependsOn: Build

jobs:

  • deployment: DeployJob

environment: 'Production'

strategy:

runOnce:

deploy:

steps:

  • script: echo Deploying to Production
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use deployment slots in Azure App Service.
  • Configure previous successful release as rollback target in pipeline.
  • Example: swap staging → production if failure occurs.

🔹 Section 11: Azure Active Directory & Identity – Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure Active Directory (Azure AD) is a cloud-based identity and access

management service.

  • Provides authentication, single sign-on (SSO), multi-factor authentication

(MFA), and identity protection for apps and services.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Users authenticate via OAuth 2.0 / OpenID Connect.
  • Azure AD issues tokens (ID token, access token, refresh token).
  • Tokens are validated by the app to authorize access.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Feature Azure AD Azure AD B2C

Target Employees/internal Customers/external

Features SSO, MFA, RBAC Customizable login, social logins

Protocol

OAuth, SAML, OpenID OAuth, OpenID, social authentication

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • RBAC restricts access to resources based on roles assigned to users/groups.
  • Example: Reader, Contributor, Owner roles in Azure.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Microsoft.Identity.Web for ASP.NET Core.
  • Configure authentication in Program.cs:

builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationS

cheme)

.AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("AzureA

d"));

app.UseAuthentication();

app.UseAuthorization();

  • Tokens from Azure AD validate API requests.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • MSAL (Microsoft Authentication Library) enables apps to authenticate users and

acquire tokens.

  • Supports .NET, JavaScript, Python, Java.

Example: acquiring token in .NET:

var app = ConfidentialClientApplicationBuilder.Create(clientId)

.WithClientSecret(clientSecret)

.WithAuthority(new

Uri($"

.Build();

string[] scopes = { "

var result = await app.AcquireTokenForClient(scopes).ExecuteAsync();

Console.WriteLine(result.AccessToken);

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • OpenID Connect (OIDC) is an identity layer on top of OAuth 2.0.
  • Provides authentication and ID tokens for apps.
  • Ensures SSO and identity validation in modern applications.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Enable App Service Authentication / “Easy Auth”.
  • Connect to Azure AD under Authentication settings.
  • App Service validates tokens before reaching the app.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • App Registration represents a client app in Azure AD.
  • Defines Application ID, redirect URIs, API permissions, secrets/certificates.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Managed Identity allows apps to access Azure resources without storing

credentials.

  • System-assigned or user-assigned identity is granted access to resources like Key

Vault or SQL Database.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Feature System-assigne

User-assigned

Lifecycle Tied to resource Independent

Reusabl

No Yes

Example App Service Shared across multiple

resources

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Go to App Registration → API permissions
  • Add delegated or application permissions
  • Admin consent may be required
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • API validates incoming JWT bearer token from Azure AD.
  • Configure authentication in ASP.NET Core:

builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationS

cheme)

.AddJwtBearer(options =>

options.Authority =

options.Audience = clientId;

});

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Register app with multi-tenant support in Azure AD.
  • Use common or organizations endpoint for authentication:
  • Validate tenant ID in API to ensure authorized access.

🔹 Section 12: Azure API Management – Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • APIM is a full-featured API gateway for publishing, securing, monitoring, and

analyzing APIs.

  • Helps abstract backend services, provide security, and manage consumption by

developers.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Import via OpenAPI/Swagger, WSDL (SOAP), or Azure Functions.
  • Example in Azure Portal:
  • Go to APIM → APIs → Add API → OpenAPI
  • Upload your .json or .yaml API specification
  • Configure backend URL and endpoints
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • API Keys: Generated per subscription, required in request headers or query

parameters.

  • OAuth 2.0: APIM can validate bearer tokens issued by Azure AD or external IdP.

Example – API key header:

GET

Header: Ocp-Apim-Subscription-Key: <your-subscription-key>

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Policies are configuration statements to modify API behavior.
  • Can be applied at global, API, or operation level.
  • Examples: rate limit, caching, authentication, request/response transformation

Example – Rate limit policy:

<rate-limit calls="10" renewal-period="60" />

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use the <rate-limit> or <quota> policy in APIM.
  • Controls max requests per minute/hour to prevent abuse.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Create API versions via URL path, query string, or header.
  • Example:
  • URL versioning: /v1/products
  • Header versioning: api-version: 1.0
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Enable Azure Monitor, Application Insights, or built-in logging.
  • Track requests, response times, errors, and throttling events.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use policies like <set-body>, <set-header>, <rewrite-uri>
  • Example: Add a custom response header:

<set-header name="X-Custom-Header" exists-action="override">

<value>API Managed</value>

</set-header>

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Developer portal allows you to:
  • Browse APIs
  • View documentation
  • Generate code snippets
  • Test endpoints using “Try It” button
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use API gateway policies to enforce:
  • Authentication/authorization
  • IP filtering
  • TLS/HTTPS
  • Keeps backend services hidden from direct internet access
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • A subscription grants access to APIs in APIM.
  • Each subscription has a unique key for identifying and authorizing requests.
  • Can enforce rate limits and quotas per subscription.

🔹 Section 13: Monitoring, Logging, and

Troubleshooting – Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Application Insights – Application performance, exceptions, telemetry
  • Azure Monitor – Metrics, alerts, dashboards
  • Log Analytics – Query logs across resources
  • Azure Diagnostics – Collect runtime logs from App Services, VMs
  • Network Watcher – Monitor networking issues
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Application Insights is an APM (Application Performance Monitoring) service.
  • Tracks requests, dependencies, exceptions, page views, and telemetry for .NET

apps.

Example – Integrating with ASP.NET Core:

builder.Services.AddApplicationInsightsTelemetry(builder.Configurati

on["APPINSIGHTS_INSTRUMENTATIONKEY"]);

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Distributed tracing tracks requests across services and microservices.
  • Application Insights supports W3C trace context.
  • Example in ASP.NET Core:

builder.Services.AddApplicationInsightsTelemetry(options =>

options.EnableDependencyTrackingTelemetryModule = true;

});

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Centralized log collection and query platform in Azure Monitor.
  • Allows querying with Kusto Query Language (KQL) to analyze logs from App

Services, Functions, SQL, etc.

Example query:

requests

| where success == false

| summarize count() by operation_Name

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use TrackMetric API in Application Insights.
  • Example:

var telemetry = new TelemetryClient();

telemetry.TrackMetric("ItemsProcessed", 100);

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure Monitor is a comprehensive platform to collect, analyze, and act on

telemetry across Azure resources.

  • Supports metrics, logs, alerts, dashboards, and automation.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure Monitor Alerts on metrics or log queries.
  • Example: Alert when HTTP request failures exceed threshold:

Metric: ServerResponseTime

Condition: > 1000ms

Action: Email, Webhook, Logic App

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Enable Application Insights in Function App.
  • Monitor exceptions, failed invocations, and retries.
  • Example: Check telemetry via FunctionInvocationException.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Query Performance Insight in Azure SQL portal
  • Monitor DTU consumption, long-running queries, blocking sessions
  • Enable Query Store for historical analysis
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Deployment Center in App Service
  • Enable App Service logs (Application, HTTP, Web server logs)
  • Access logs via Kudu Console or FTP
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Advanced management console for Azure App Services
  • Provides file explorer, process explorer, environment variables, and log

streaming

  • Access via

🔹 Section 14: Best Practices & Real-World Scenarios –

Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use modular architecture with microservices or layered design.
  • Host APIs in Azure App Services or Azure Functions.
  • Store data in Azure SQL, Cosmos DB, or Blob Storage.
  • Implement CI/CD with Azure DevOps or GitHub Actions.
  • Apply monitoring with Application Insights and security with Azure AD.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure Key Vault to store secrets, connection strings, and certificates.
  • Configure managed identity for pipeline tasks.
  • Avoid storing secrets in code or pipeline variables directly.

Example – Azure DevOps pipeline:

  • task: AzureKeyVault@2

inputs:

azureSubscription: 'MyServiceConnection'

KeyVaultName: 'MyKeyVault'

SecretsFilter: '*'

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use deployment slots in Azure App Services.
  • Deploy new version to staging slot, test it, then swap with production.
  • Rollback is possible by swapping back.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure App Configuration or Feature Management library.
  • Enables dynamic feature enable/disable without redeploying.

Example in .NET:

if (_featureManager.IsEnabledAsync("NewCheckout"))

// Execute new feature code

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure Functions for business logic
  • API Management as gateway
  • Azure Storage / Cosmos DB for persistence
  • Application Insights for monitoring
  • Event Grid / Service Bus for event-driven communication
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Deploy across multiple regions
  • Use availability zones for VM-based apps
  • Enable auto-scaling for App Services or Functions
  • Use Azure Front Door or Traffic Manager for global load balancing
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure Functions (Serverless): Pay per execution and resource usage –

cost-effective for sporadic workloads

  • App Services: Pay per plan (CPU/RAM), better for constant workloads
  • Choose based on traffic patterns and scaling needs
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Choose appropriate partition key
  • Use asynchronous SDK methods
  • Enable RU-based throughput scaling
  • Cache frequently accessed data using Redis Cache
  • Example in .NET SDK:

var container = cosmosClient.GetContainer("db", "container");

var query = new QueryDefinition("SELECT * FROM c WHERE c.status =

@status")

.WithParameter("@status", "Active");

var iterator = container.GetItemQueryIterator<MyItem>(query);

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure Cache for Redis or in-memory caching in .NET.
  • Cache frequently accessed data to reduce DB calls.

Example in ASP.NET Core:

services.AddStackExchangeRedisCache(options =>

options.Configuration = Configuration["Redis:ConnectionString"];

});

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure Front Door is a global load balancer and CDN.
  • Provides SSL termination, caching, fast failover, and routing rules.
  • Improves latency, availability, and performance for global apps.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use retry policies for transient failures
  • Implement circuit breakers
  • Deploy redundant instances across regions
  • Use queue-based asynchronous communication
  • Monitor health and alerts to detect failures

🔹 Bonus Section: Advanced Azure Topics – Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure Bicep is a domain-specific language (DSL) for declaratively deploying

Azure resources.

  • Simplifies ARM templates with cleaner syntax.

Example – Deploy an Azure Storage Account:

resource storageAccount

'Microsoft.Storage/storageAccounts@2022-09-01' = {

name: 'mystorageacct'

location: resourceGroup().location

sku: {

name: 'Standard_LRS'

kind: 'StorageV2'

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Bicep, ARM templates, Terraform, or Azure CLI scripts.
  • Integrate into CI/CD pipelines in Azure DevOps or GitHub Actions.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Service to define and deploy a repeatable set of Azure resources.
  • Combines ARM templates, policies, and RBAC into a single package.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure Policy enforces rules and effects on resources.
  • Example: Deny creation of public IPs in production resource groups.
  • Policies can be assigned at subscription, resource group, or resource level.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Provides private connectivity to Azure services via a private IP.
  • Prevents traffic over the public internet, enhancing security.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure Arc to manage on-premises or multi-cloud resources.
  • Integrates VMs, Kubernetes, and databases with Azure management and policies.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Physically separate datacenters within an Azure region.
  • Ensure high availability and fault tolerance.
  • Example: Deploy VMs across Zone 1, 2, 3 for resiliency.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Configure federation using SAML, OpenID Connect, or OAuth 2.0.
  • Example: Integrate Google Workspace or Okta for authentication.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Service Principal is a security identity for apps or automation.
  • Used for authentication in scripts, CI/CD pipelines, and service-to-service

communication.

Example – Azure CLI login:

az login --service-principal -u <appId> -p <password> --tenant

<tenantId>

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure AD roles – Manage identity and directory-level permissions (e.g., User

Administrator, Global Admin)

  • Azure RBAC – Manage resource-level permissions (e.g., Reader, Contributor,

Owner)

  • Both work together to enforce security and access control in Azure.

🔹 Final Questions for Interviews – Q&A

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Deploy ASP.NET Core apps to Azure App Service or Azure Functions.
  • Use deployment slots for blue/green deployments.
  • Enable auto-scaling based on CPU, memory, or request count.
  • Monitor with Application Insights for performance metrics.
  • Example: Scaled an eCommerce API to 3 instances with auto-scale on 70% CPU.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Application Insights to trace exceptions and request failures.
  • Access Kudu console for logs and process inspection.
  • Use Remote Debugging from Visual Studio.
  • Example: Enabled detailed error messages and traced a null reference exception in

production logs.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Example: CI/CD failed due to secret misconfiguration in Key Vault.
  • Resolved by configuring pipeline managed identity and updating Key Vault

access policies.

  • Ensured staging deployments were successful before production swap.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use deployment slots in Azure App Service.
  • Swap staging and production after successful smoke tests.
  • Enable traffic routing gradually using Azure Front Door.
  • Use feature flags to hide new features until fully validated.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure AD for authentication and authorization.
  • Protect APIs with OAuth 2.0 / JWT tokens.
  • Use API Management to enforce policies like rate limiting.
  • Enable Private Endpoints / VNET integration for network isolation.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Example: Automated invoice processing using Azure Functions triggered by Blob

uploads.

  • Reduced manual workload and scaled automatically during peak hours.
  • Integrated with Azure Storage, Cosmos DB, and Service Bus for processing

workflow.

Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Use Azure Policy to enforce resource rules.
  • Store secrets in Azure Key Vault.
  • Implement role-based access control (RBAC) for all resources.
  • Enable Azure Security Center for continuous monitoring.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Azure App Service or Azure Kubernetes Service (AKS) for hosting APIs.
  • Azure API Management for gateway and throttling.
  • Cosmos DB with partitioned throughput for high-speed data.
  • Azure Cache for Redis for frequently accessed data.
  • Use Azure Front Door / CDN for global load balancing.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

  • Database latency or unoptimized queries.
  • Blocking synchronous calls instead of async patterns.
  • Memory or CPU constraints on App Service Plan.
  • Excessive cold starts in serverless functions.
  • Poor caching strategy or missing CDNs.
Permalink

Microsoft Azure Microsoft Azure Tutorial · Azure

Review the concept and prepare a concise verbal explanation with a real project example.

Permalink