# PART 8: AI / ML SERVICES

---

## 8.1 Azure OpenAI Service

### Overview
Azure-hosted OpenAI models. GPT-4o, GPT-4, GPT-3.5, DALL-E, Whisper, Embeddings. Enterprise security, compliance, regional availability.

### Key Features
- **Models** — GPT-4o, GPT-4, GPT-4-32k, GPT-3.5-turbo, DALL-E 3, Whisper, text-embedding-ada-002
- **Deployments** — Create deployment with specific model + capacity (PTUs or pay-per-use)
- **PTUs (Provisioned Throughput Units)** — Reserved capacity, predictable latency
- **Content Filters** — Built-in safety filters (hate, sexual, violence, self-harm). Configurable.
- **Private Endpoints** — Access via private IP
- **RBAC** — Role-based access
- **Fine-tuning** — Customize models with your data (GPT-3.5-turbo, Babbage, Davinci)
- **On Your Data** — Ground models in your data (search over documents)
- **Assistants API** — Build AI assistants with tools (code interpreter, file search, function calling)

### Interview Q&A
**Q: Why use Azure OpenAI vs OpenAI directly?**
A: Enterprise features: private endpoints, RBAC, content safety, regional data residency, VNet integration, compliance certifications. Data not used to train models.

---

## 8.2 Azure AI Services (Cognitive Services)

### Overview
Pre-built AI APIs. No ML expertise needed. REST APIs + SDKs.

### Vision
| Service | What It Does |
|---|---|
| **Computer Vision** | Image analysis, OCR, spatial analysis |
| **Custom Vision** | Train custom image classifiers/object detectors |
| **Face** | Face detection, recognition, verification |
| **Video Indexer** | Extract insights from video |

### Speech
| Service | What It Does |
|---|---|
| **Speech to Text** | Real-time & batch transcription |
| **Text to Speech** | Neural TTS voices |
| **Speech Translation** | Real-time speech translation |
| **Speaker Recognition** | Identify/verify speakers |

### Language
| Service | What It Does |
|---|---|
| **Language Service** | Sentiment, NER, key phrase extraction, PII detection, summarization, conversation |
| **Translator** — Real-time text translation (100+ languages) |
| **Document Intelligence** (Form Recognizer) | Extract structure from documents (invoices, forms, IDs) |

### Decision
| Service | What It Does |
|---|---|
| **Content Safety** | Detect harmful content (text + image) |
| **Personalizer** | RL-based content ranking |

---

## 8.3 Azure Machine Learning

### Overview
End-to-end ML platform. Train, deploy, manage, monitor ML models.

### Key Components
- **Workspace** — Top-level resource. Contains all ML artifacts.
- **Compute** — Compute instances (dev), compute clusters (training), inference clusters (deploy), attached compute (AKS, etc.)
- **Data** — Datastores (connect to Storage, SQL), Datasets (versioned data references)
- **Experiments** — Track training runs. Log metrics, parameters, artifacts.
- **Models** — Register, version, package models
- **Endpoints** — Real-time endpoints (online), Batch endpoints (batch scoring)
- **Pipelines** — Orchestrate ML workflows (data prep → train → evaluate → deploy)
- **Prompt Flow** — Build LLM orchestrations (RAG, chains, agents)

### Key Features
- **AutoML** — Automatically try algorithms + hyperparameters
- **MLflow** — Open-source tracking (integrated)
- **Managed Endpoints** — Deploy models with auto-scaling, A/B testing, traffic splitting
- **Responsible AI Dashboard** — Fairness, error analysis, interpretability
- **Feature Store** — Centralized feature management (preview)

---

## 8.4 Azure AI Search (Cognitive Search)

### Overview
AI-powered search over your data. Full-text search, vector search, semantic search.

### Key Concepts
- **Index** — Searchable collection of documents. Schema-defined fields.
- **Indexer** — Crawl data source (Blob, SQL, Cosmos DB) → populate index. Scheduled or on-demand.
- **Skillset** — AI enrichment pipeline. Extract text from images, OCR, entity recognition, translation.
- **Knowledge Store** — Save enriched data to Storage for analytics.

### Search Features
- Full-text search (Lucene-based)
- Vector search (embeddings, nearest neighbor)
- Semantic search (AI-reranked results)
- Faceted navigation, filters, suggestions, autocomplete
- Synonym maps, scoring profiles

---

# PART 9: ANALYTICS SERVICES

---

## 9.1 Azure Stream Analytics

### Overview
Real-time stream processing. SQL-like queries over event streams. Input from Event Hubs/IoT Hub, output to multiple sinks.

### Key Features
- SQL-like query language (SAQL)
- Windowing: Tumbling, Hopping, Sliding, Session
- Input: Event Hubs, IoT Hub, Blob Storage
- Output: Event Hubs, Blob, SQL, Cosmos DB, Power BI, Service Bus, Data Lake
- Reference data joins (static data enrichment)
- ML scoring (custom functions)
- Job diagram for debugging

---

## 9.2 Azure Data Factory

### Overview
Cloud ETL / data integration. Orchestrate data movement and transformation at scale.

### Key Concepts
- **Pipelines** — Logical grouping of activities
- **Activities** — Actions: Copy Data, Databricks Notebook, Stored Procedure, ForEach, If Condition, etc.
- **Datasets** — Data structures (point to data source)
- **Linked Services** — Connection info (connection strings, auth)
- **Integration Runtimes** — Compute for data movement:
  - **Azure IR** — Cloud data movement
  - **Self-hosted IR** — On-prem / VNet data movement
  - **SSIS IR** — Run SSIS packages

### Key Features
- **Copy Activity** — Move data between 100+ sources and sinks
- **Mapping Data Flows** — Visual ETL transformations
- **Tumbling Window Trigger** — Scheduled pipeline execution
- **Event-based Trigger** — Trigger on blob creation
- **Monitoring** — Visual monitoring, alerts
- **Managed VNet** — Secure data movement

---

## 9.3 HDInsight

### Overview
Managed Hadoop ecosystem. Open-source big data analytics.

- Hadoop, Spark, Kafka, Storm, HBase, Interactive Query (Hive LLAP)
- For organizations already using Hadoop ecosystem
- Deploy as clusters (pay while running — can be deleted when not needed)
- Enterprise Security Package (ESP) — Domain-join with Entra Domain Services

---

## 9.4 Azure Analysis Services

### Overview
Enterprise OLAP / semantic modeling. Tabular data models for BI.

- Power BI connects to Analysis Services for enterprise modeling
- Semantic layer over data warehouse
- Row-level security
- Scale up/down, pause when not in use

---

## 9.5 Microsoft Purview

### Overview
Unified data governance. Data catalog, classification, lineage, compliance.

- **Data Map** — Automated data discovery and mapping
- **Data Catalog** — Searchable inventory of data assets
- **Data Estate Insights** — Understand your data landscape
- **Classification** — Auto-classify sensitive data (SSN, credit card, etc.)
- **Lineage** — Track data flow from source to destination
- **Integration** — Scans: Azure, on-prem SQL, AWS, SAP, etc.

---

# PART 10: MANAGEMENT & GOVERNANCE

---

## 10.1 Azure Resource Manager (ARM)

### Overview
Deployment and management layer for Azure. Every action goes through ARM. Consistent management plane.

### Key Concepts
- **Resource** — Individual Azure service instance (VM, Storage Account, etc.)
- **Resource Group** — Logical container for resources. Lifecycle boundary (delete RG = delete all resources). Region-scoped metadata.
- **Subscription** — Billing + management boundary. Limits/quota per subscription.
- **Management Group** — Manage multiple subscriptions. Policy + RBAC inheritance.

### Hierarchy
Management Group → Subscription → Resource Group → Resource

### ARM Templates / Bicep
- **ARM Templates** — JSON IaC. Declarative. Idempotent.
- **Bicep** — DSL that compiles to ARM JSON. Cleaner syntax, easier to read/write. Recommended over JSON.

### Interview Q&A
**Q: What is ARM?**
A: Azure Resource Manager. The management layer that handles all CRUD operations on Azure resources. Every tool (Portal, CLI, PowerShell, SDK) goes through ARM. Provides RBAC, tags, locks, and policy enforcement.

---

## 10.2 Azure Monitor

### Overview
Full observability platform. Metrics, logs, alerts, dashboards.

### Key Components
- **Metrics** — Time-series data from resources (CPU, memory, request count). 93 days retention.
- **Logs** — Log Analytics workspace. KQL queries. Custom logs. 30-730 days retention.
- **Application Insights** — APM for web apps. Request tracking, dependency tracking, live metrics, availability tests.
- **Alerts** — Metric alerts, log alerts, activity log alerts. Action groups (email, SMS, webhook, Logic App).
- **Dashboards** — Shared dashboards in Portal.
- **Workbooks** — Interactive reports combining metrics, logs, parameters.

### Key Features
- **Diagnostic Settings** — Route resource logs and metrics to Log Analytics, Storage, or Event Hubs.
- **Data Collection Rules (DCR)** — Define what data to collect from VMs (AMA - Azure Monitor Agent).
- **VM Insights** — Pre-built monitoring for VMs (performance, maps).
- **Container Insights** — Pre-built monitoring for AKS/ARC K8s.
- **Network Insights** — Network monitoring dashboards.

### Interview Q&A
**Q: Metrics vs Logs in Azure Monitor?**
A: Metrics = numeric time-series (CPU%, memory), pre-collected, 93 days, fast to query. Logs = everything else, KQL queries, flexible, longer retention, more expensive. Use metrics for alerting (fast). Use logs for deep investigation.

---

## 10.3 Azure Advisor

### Overview
Personalized best-practice recommendations. Analyzes your resources and configuration.

Categories: Cost, Security, Reliability, Performance, Operational Excellence

- Free service
- Weekly updates
- Postpone or dismiss recommendations
- Download as PDF/CSV

---

## 10.4 Azure Cost Management

### Overview
Track, allocate, and optimize Azure spend.

### Key Features
- **Cost Analysis** — View spend by resource, resource group, service, tag
- **Budgets** — Set spending limits. Alert when threshold reached.
- **Cost Alerts** — Budget alerts, credit alerts, department spending alerts (EA)
- **Exports** — Schedule cost data export to Storage Account
- **Tags** — Organize and track costs by project, department, environment
- **Reservation Recommendations** — Identify resources for Reserved Instances savings

### Interview Q&A
**Q: How do you optimize Azure costs?**
A: Right-size VMs (Advisor), Reserved Instances (predictable workloads), Spot VMs (fault-tolerant), auto-shutdown (dev/test), use Cool/Archive tiers for storage, delete unmanaged disks/orphaned resources, use Budgets for alerts, review cost analysis weekly.

---

## 10.5 Azure Arc

### Overview
Manage on-premises and multi-cloud resources from Azure. Project Azure management plane everywhere.

### What You Can Manage
- **Servers** — On-prem Linux/Windows servers. Install extensions (MDE, monitoring, custom scripts).
- **Kubernetes** — Attach any K8s cluster (on-prem, EKS, GKE). Deploy GitOps, policies, monitoring.
- **SQL Server** — Manage on-prem SQL Server from Azure. Pay-as-you-go licensing.
- **Data Services** — Run Azure SQL Managed Instance, PostgreSQL on any infrastructure.
- **Machine Learning** — Extend ML to on-prem

### Key Benefits
- Single management plane for hybrid/multi-cloud
- Apply Azure Policy to non-Azure resources
- Use Azure Monitor for on-prem servers
- Run Azure data services anywhere

---

## 10.6 Azure Migrate

### Overview
Assessment and migration tool for moving on-prem workloads to Azure.

### Key Features
- **Discovery** — Discover on-prem servers, databases, web apps
- **Assessment** — Right-sizing, cost estimation, readiness check
- **Migration** — Server migration (agent-based or agentless), database migration, web app migration
- **Dependency Mapping** — Visualize server dependencies (using Service Map/AMA)

### Tools
- **Azure Migrate: Server Assessment** — Assess VMware, Hyper-V, physical servers
- **Azure Migrate: Server Migration** — Replicate and failover servers
- **Data Migration Assistant (DMA)** — Assess SQL Server migration readiness
- **Azure Database Migration Service (DMS)** — Migrate databases with minimal downtime

---

## 10.7 Azure Lighthouse

### Overview
Multi-tenant management. Service providers manage customer resources from their own tenant.

- Delegated resource management
- No need for guest accounts in customer tenant
- Azure Portal, CLI, PowerShell, SDK support
- Audit all cross-tenant actions
- For MSPs, centralized IT teams
