Generative AI on Azure
Generative AI connects model concepts, prompt design, grounding, Azure services, and responsible AI controls into one practical workload story.
What generative AI actually is
Know the workload pattern before you memorize products.Generative AI produces new content: text, code, images, summaries, search answers, or chat responses. Traditional AI patterns usually return a label, number, group, or prediction. For AI-900, keep it simple: generative AI creates an artifact from learned patterns and prompt instructions.
| Task | Input | Output | Example |
|---|---|---|---|
| Classification | Known example with features | A category or label | Mark an email as spam or not spam. |
| Regression | Known example with numeric patterns | A number | Predict next month’s sales revenue. |
| Clustering | Unlabeled examples | Groups of similar items | Group customers by buying behavior. |
| Generative AI | A prompt plus optional context | New generated content | Draft a reply, summarize a file, or create an image. |
If the requirement says “generate,” “draft,” “rewrite,” “summarize,” “create,” or “answer in natural language,” think generative AI.
Text generation
Create emails, descriptions, policies, learning content, or customer responses.
Summarization
Condense documents, meetings, tickets, transcripts, or search results.
Code generation
Produce code, tests, scripts, explanations, and refactoring suggestions.
Image generation
Create or edit images from text prompts.
Chat and copilots
Hold a conversation that follows instructions and helps users complete tasks.
Agents that call tools
Use a model to decide when to call APIs, search, databases, or workflows.
Language generation relies on the Transformer architecture from skill area 2. Transformers represent relationships between tokens, so they can generate text, answer questions, translate language, write code, and use conversation context.
If the answer is a new document, message, image, code block, summary, or chat response, think generative AI. If the answer is a label or number, think classification or regression.
Models, tokens, and the shape of a request
Understand what is sent to the model and what controls the output.A large language model is a foundation model trained on enormous text collections to predict useful continuations. You send a prompt; the model returns a completion. Chat apps package prompts as messages: system instructions, the user request, prior turns, and grounding data.
A token is a chunk of text: a word, word part, punctuation mark, or whitespace. For example, the sentence Azure AI helps students prepare. might split roughly as Azure AI helps students prepare .. The exact split depends on the model.
Tokens are what you are billed for and what fills the context window. Long prompts, chat history, retrieved passages, and long answers all consume tokens.
The context window is the maximum text the model can consider: instructions, prompt, history, retrieved content, tool outputs, and completion. Facts outside the window cannot be used reliably.
Multi-modal models accept more than one input type. A common example is text plus images, such as asking about a screenshot or diagram. Choose the model family that matches the input and output.
| Model family | What it does | Typical use |
|---|---|---|
| GPT models | Generate and transform natural language and code. | Chat, copilots, summarization, drafting, reasoning over supplied context, and code assistance. |
| Embedding models | Convert text into numeric vectors that capture meaning. | Semantic search, similarity comparison, clustering text, and retrieval augmented generation. |
| DALL-E | Generate images from text prompts. | Illustrations, design concepts, marketing images, and visual brainstorming. |
| Whisper | Convert speech audio into text. | Transcription, captions, meeting notes, and voice-driven workflows. |
Inference settings affect the current response; they do not train the model.
| Setting | What it controls | Exam-friendly interpretation |
|---|---|---|
| Temperature | How random or creative token selection is. | Lower temperature gives more deterministic, repeatable output. Higher temperature gives more variety, not more accuracy. |
| Top-p | The probability mass of candidate tokens considered. | Higher top-p allows a wider set of possible next tokens. Lower top-p narrows the choices. |
| Max tokens | The maximum length of the completion. | Use it to cap cost, latency, and answer length. |
| Stop sequences | Text patterns that tell generation to stop. | Use them when you need a response to end at a delimiter or before another section begins. |
AI-900 usually expects the high-level idea: temperature and top-p affect randomness. They are not responsible AI filters, data sources, or training settings.
Prompt engineering
Use instructions, examples, and context before changing the model.Prompt engineering means writing instructions that steer the model toward the desired output. It is the cheapest lever because it changes the request, not the model or infrastructure. Good prompts reduce ambiguity.
The system message is the highest-level instruction in many chat apps. It defines role, boundaries, tone, allowed sources, format, safety rules, and what to do when information is missing. Put durable behavior there, not one-time user details.
Weak prompt: Write something about the outage.
Strong rewrite: You are a customer support analyst. Write a 120-word status update for nontechnical retail store managers. Use only the incident notes below. Include impact, current workaround, next update time, and a calm tone. If a detail is missing, write “not yet confirmed.”
Specific prompts name the audience, task, format, constraints, and source material. Replace “make this better” with the exact output you want.
| Prompt type | Meaning | Worked example |
|---|---|---|
| Zero-shot | No example is provided. | “Classify this support ticket as Billing, Technical, Account, or Other.” |
| One-shot | One example shows the pattern. | “Example: ‘My invoice is wrong’ → Billing. Now classify: ‘I cannot reset my password.’” |
| Few-shot | Several examples teach the desired pattern. | “Invoice issue → Billing; error code → Technical; password reset → Account. Now classify this ticket.” |
Examples help enforce style or structure. Few-shot prompts can often fix format problems without fine-tuning. Chain-of-thought style prompts ask the model to explain reasoning or show steps. In practice, ask for a concise rationale, evidence, assumptions, or calculation steps so users can review the answer.
You can include source material directly in short prompts. Paste the policy, email, ticket, or passage and tell the model to answer only from that text. For large content libraries, use retrieval augmented generation instead of stuffing everything into the prompt.
Role + task + audience + source + format + constraints + fallback. That pattern answers most prompt-engineering questions on the exam.
Grounding, RAG, and fine-tuning
This is the highest-value generative AI decision area.Grounding means giving the model trusted information to use when it answers. The model does not automatically know your current policies, contracts, tickets, inventory, or private documents. Grounding connects responses to supplied facts.
Retrieval augmented generation, or RAG, is the key grounding pattern. It combines search with generation by retrieving relevant content at request time and placing it in the prompt.
RAG end to end
- Your documents are split into useful chunks and indexed, commonly in Azure AI Search.
- The user asks a question.
- The question is converted into an embedding, a numeric vector that represents meaning.
- Azure AI Search finds relevant passages using vector search, keyword search, or hybrid search.
- The passages are inserted into the prompt, and the model answers from them with citations when configured.
RAG reduces hallucination because authoritative context is in the prompt. It also keeps answers current without retraining: update the index, and the next retrieval can use the new passage. That is very different from fine-tuning, which changes behavior but is not a knowledge-refresh strategy.
Fine-tuning trains a model further on curated examples. It can teach tone, format, domain phrasing, or a narrow task when prompting and grounding cannot produce a consistent pattern. It requires prepared data, evaluation, and more cost.
Fine-tuning is bad for changing knowledge. If the assistant must answer from a handbook, catalog, policy, contract library, or knowledge base, choose RAG. Private or domain-specific data does not automatically mean fine-tuning.
| Approach | What it changes | Cost and effort | Best for | Not for |
|---|---|---|---|---|
| Prompt engineering | The instructions, examples, format, and context sent in a request. | Lowest cost and fastest to change. | Improving clarity, tone, format, and task instructions. | Large private knowledge bases or behavior the prompt cannot reliably enforce. |
| Retrieval augmented generation | The information retrieved and inserted into the prompt at answer time. | Medium effort: indexing, chunking, search, ranking, and citations. | Answering from current documents, policies, tickets, and enterprise data. | Changing the model’s core style or teaching a repeatable output pattern by example. |
| Fine-tuning | The model’s learned response behavior for a task. | Highest effort: curated labeled data, training, evaluation, and deployment. | Consistent tone, format, and narrow specialized behavior after other methods fail. | Keeping facts current, replacing search, or storing private documents in the model. |
Try prompt engineering first, then grounding with RAG, and only fine-tune when the first two cannot get you there.
Hallucinations are plausible but false, unsupported, or invented statements. They happen because the model predicts likely text; confident tone is not proof. Mitigate them with trusted grounding, lower temperature, and instructions to say it does not know when context is insufficient. For high-risk decisions, add human review and citations.
Embeddings support retrieval. They do not rewrite the model’s weights. Fine-tuning changes learned behavior. RAG changes the context supplied at generation time.
Azure AI Foundry, Azure OpenAI, and the model catalog
Know which Azure service does which job.Azure OpenAI Service gives Azure customers access to OpenAI models through Azure security, networking, regional availability, monitoring, quota, and governance. You create a model deployment before calling a model so the app has a named endpoint tied to a model version and capacity configuration.
Quota is commonly described in tokens per minute and requests per minute. Long prompts with retrieved content can hit token quota quickly. The Azure OpenAI “on your data” capability wires an Azure AI Search index into a chat deployment for RAG. The model generates the answer; Azure AI Search supplies passages.
Azure AI Foundry is the portal and development environment for generative AI apps on Azure. It provides hubs, projects, model playgrounds, prompt flow, and evaluations for quality, groundedness, relevance, risk, and safety. The Azure AI Foundry model catalog contains OpenAI models and open models from other providers. Serverless API deployment is pay per token with no infrastructure. Managed compute means you provision and pay for the compute that hosts the model.
Azure AI Content Safety detects and filters risky content. It covers hate, sexual, violence, and self-harm categories with severity levels, plus prompt shields for jailbreak and indirect prompt injection attempts, groundedness detection, and protected material detection.
| Service or feature | What it is | Use it when |
|---|---|---|
| Azure OpenAI Service | Azure-hosted access to OpenAI models with enterprise controls. | You need GPT, embeddings, DALL-E, or Whisper capabilities in an Azure app. |
| Model deployment | A named deployment of a selected model version. | Your app needs an endpoint and Azure-governed capacity. |
| Tokens per minute quota | A capacity limit based on prompt and completion tokens. | You estimate throughput, cost, scaling, and rate limits. |
| Azure OpenAI on your data | A built-in RAG path that connects chat to Azure AI Search. | You want grounded chat over documents with less custom retrieval code. |
| Azure AI Foundry | A portal and project environment for generative AI apps. | You want model experiments, prompt flow, evaluations, and project assets. |
| Azure AI Foundry playgrounds | Interactive places to try models and prompts without code. | You need to compare prompts or demo a model quickly. |
| Prompt flow | A way to design, connect, test, and evaluate multi-step generative workflows. | Your app needs retrieval, prompt construction, model calls, and post-processing. |
| Evaluations | Tools for measuring quality and safety of outputs. | You need repeatable checks for relevance, groundedness, coherence, risk, and regression. |
| Azure AI Foundry model catalog | A catalog of OpenAI and open models. | You need to discover, compare, and deploy models. |
| Serverless API deployment | A pay-per-token endpoint with no infrastructure to manage. | You want simple consumption-based access to supported catalog models. |
| Managed compute deployment | A deployment where you provision compute to host a model. | You need more control and accept paying for provisioned infrastructure. |
| Azure AI Search | Search and indexing for keyword, vector, and hybrid retrieval. | You build RAG over enterprise documents or knowledge bases. |
| Azure AI Content Safety | Safety service for harmful content, attacks, groundedness, and protected material. | You need policy enforcement around prompts and completions. |
| Azure Machine Learning | ML platform for training, MLOps, and custom workflows. | You need broader ML lifecycle management. |
| Azure AI Vision | Service for image analysis and computer vision. | You need OCR, image analysis, or object detection. |
| Azure AI Language | Service for sentiment, key phrases, and entity recognition. | You need classic language analysis rather than open-ended generation. |
| Azure AI Speech | Service for speech to text, text to speech, and translation. | You need speech input, voice output, transcription, or spoken interaction. |
Azure AI Foundry is not just Azure Machine Learning studio with a new name. For AI-900, associate Foundry with generative AI projects, playgrounds, catalog models, prompt flow, and evaluations.
Responsible generative AI
Safety is part of the workload, not an afterthought.Microsoft describes a four-stage process for responsible generative AI: identify potential harms, measure them, mitigate them, and operate responsibly. Keep doing it after release because model and user behavior can change.
| Stage | What you do | Generative AI example |
|---|---|---|
| Identify | List ways the system could cause harm. | Wrong medical advice, leaked confidential data, offensive output, unsafe automation, or fabricated citations. |
| Measure | Test how often harms appear and under which prompts. | Run evaluations with normal prompts, adversarial prompts, edge cases, and protected-class scenarios. |
| Mitigate | Reduce risk at several layers. | Use model choice, content filters, system messages, grounding, prompt shields, output validation, and human review. |
| Operate | Release and monitor responsibly. | Use a release plan, logging, user feedback, incident response, and rollback procedures. |
Mitigation is layered: choose an appropriate model, use Azure AI Content Safety and filters, define refusal rules in the system message, ground with trusted data and citations, and design the user experience with warnings and confirmations.
| Responsible AI principle | Generative AI meaning |
|---|---|
| Fairness | Outputs should not create unfair treatment or reinforce harmful bias across groups. |
| Reliability and safety | The system should behave consistently, handle failures, and avoid unsafe recommendations. |
| Privacy and security | Prompts, completions, retrieved documents, and logs must be protected and governed. |
| Inclusiveness | The experience should work for people with different abilities, languages, and contexts. |
| Transparency | Users should know they are interacting with AI and understand limitations, sources, and uncertainty. |
| Accountability | People and organizations remain responsible for design, deployment, monitoring, and decisions. |
Content filters can block or annotate harmful prompts and responses. Thresholds are configurable by severity, but production apps still need safety controls that match risk. Use human oversight when outputs affect people, money, health, legal obligations, employment, or safety. Be transparent that content is AI-generated and may need source verification.
If users can type anything and the system can answer or call tools without guardrails, the app is exposed to jailbreaks, prompt injection, data leakage, and unsafe actions.
Where people lose points here
Memorize the contrasts, not just the names.| Trap | Correct exam answer |
|---|---|
| Choosing fine-tuning when the scenario needs current company documents. | Use grounding with RAG, usually with Azure AI Search. |
| Thinking higher temperature makes answers more accurate. | Higher temperature increases variety. Lower temperature is more deterministic. |
| Confusing embeddings with fine-tuning. | Embeddings convert text to vectors for similarity and retrieval. Fine-tuning changes model behavior. |
| Assuming Azure OpenAI trains on your prompts or business data. | Azure OpenAI Service does not train OpenAI models on your data by default. |
| Confusing Azure AI Foundry with Azure Machine Learning studio. | Foundry is the generative AI app platform with projects, model catalog, playgrounds, prompt flow, and evaluations. |
| Confusing model catalog deployment choices. | Serverless API is pay per token with no infrastructure. Managed compute uses provisioned compute. |
| Treating content filters as optional. | Safety filters and responsible AI mitigations are expected parts of production generative AI. |
If the data must be fresh, cited, or sourced from your documents, choose RAG. Fine-tuning is not a knowledge-base refresh strategy.
Azure AI Search does not generate the final natural language answer. It retrieves the most relevant passages. The generative model writes the answer from those passages.
The night-before cheat sheet
Fast recall for exam day.Generative scenarios
Text generation drafts content. Rewriting changes tone or style. Summarization condenses content. Code generation writes or explains code. Image generation creates visuals. Chat and copilots converse. Agents call tools to act.
Model families
GPT is for text, chat, and code. Embeddings turn text into vectors. DALL-E generates images. Whisper converts speech to text. Multi-modal models can accept more than text.
Generation settings
Temperature controls randomness. Low temperature is more repeatable. High temperature is more varied. Top-p controls the candidate token pool. Max tokens caps output length. Stop sequences end generation at a pattern.
The improvement ladder
First improve the prompt. Next add grounding with RAG. Only then consider fine-tuning for consistent style, format, or narrow behavior that examples and grounding cannot solve.
| RAG in five steps | Remember it as |
|---|---|
| 1. Index trusted content. | Documents become searchable chunks. |
| 2. Embed the user question. | The question becomes a vector for semantic matching. |
| 3. Retrieve relevant passages. | Azure AI Search finds the best matches. |
| 4. Add passages to the prompt. | The model receives facts at answer time. |
| 5. Generate an answer with citations. | The model writes from grounded context. |
| Azure item | One-line recall |
|---|---|
| Azure OpenAI Service | OpenAI models hosted in Azure with enterprise controls. |
| Azure AI Foundry | Build, test, evaluate, and manage generative AI apps. |
| Model catalog | Find and deploy OpenAI and open models. |
| Azure AI Search | Index and retrieve content for RAG. |
| Azure AI Content Safety | Detect harmful content, jailbreaks, groundedness issues, and protected material. |
Responsible AI process: identify harms → measure harms → mitigate harms → operate responsibly. Map every generative AI system to fairness, reliability and safety, privacy and security, inclusiveness, transparency, and accountability.
Final memory hook: Prompt for behavior, RAG for facts, fine-tune for a specialized pattern, and content safety for guardrails.