Microsoft Azure AI Engineer Associate AI-102 Practice Question
You are designing a prompt flow in Azure AI Foundry. The team wants one reusable prompt template that can automatically expand any number of few-shot examples (question-answer pairs). The template must iterate over the list at run time, so you never edit the file when the example count changes. What should you use inside the template?
Surround the entire prompt with triple backticks and mark it as a code block.
Define a dynamic_examples parameter in the project configuration YAML and reference it using <<dynamic_examples>> placeholders.
Store the examples in Azure Table Storage and reference the table name with the @examples directive.
Use Jinja2 control statements such as {% for %} to iterate over the passed-in examples variable.
Prompt templates in Azure AI Foundry are rendered by the Jinja2 engine. Jinja2 supports full control-flow syntax, including for-loops, which you can embed in the template by using {% for %} … {% endfor %}. Passing the list as a variable lets the loop repeat for every item, so the same template works with any number of few-shot examples. Other options, such as code blocks, the @examples directive, or custom placeholder syntax, are not interpreted by the renderer and therefore cannot create the repeated sections automatically.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Jinja2, and how does it relate to Azure AI Foundry?
Open an interactive chat with Bash
How does the `{% for %}` loop work in Jinja2 templates?
Open an interactive chat with Bash
Why can’t the other options, like triple backticks or `@examples`, work in this case?
Open an interactive chat with Bash
Microsoft Azure AI Engineer Associate AI-102
Implement generative AI solutions
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .