Microsoft Azure AI Engineer Associate AI-102 Practice Question
You published an Azure AI Foundry project that contains a prompt flow named "summarize_docs" and successfully validated it in the Foundry portal. You now want to invoke the flow from a Python application by using the Azure AI Foundry SDK with the following code snippet:
from azure.ai.foundry import FoundryClient
from azure.identity import DefaultAzureCredential
client = FoundryClient(
endpoint = os.environ["FOUNDRY_ENDPOINT"],
credential = DefaultAzureCredential()
)
flow = client.get_prompt_flow("summarize_docs")
result = flow.invoke({"input_text": content})
When the invoke call runs, it raises an HTTP 404 error that states that no online deployment exists for the flow.
In the Foundry portal, which action must you take before the code will work without modification?
Regenerate the Foundry workspace primary access key.
Deploy the "summarize_docs" flow to an online endpoint.
Promote the flow from the dev stage to the staging stage.
Export the project as an Azure Resource Manager (ARM) template and redeploy it.
The Azure AI Foundry SDK can invoke a prompt flow only after the flow is deployed as an online endpoint. Publishing or validating a flow makes it available for manual tests in the portal but does not provision the fully managed inference endpoint that the SDK targets. Selecting Deploy > Online in the portal (or calling the corresponding deploy_online method in the SDK) creates the endpoint and activates the REST and SDK surface so the invoke operation resolves. Other actions such as exporting the flow, promoting it to staging, or regenerating credentials do not create an endpoint and therefore would still result in a 404 error.
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 an online endpoint in Azure AI Foundry?
Open an interactive chat with Bash
How do you deploy a prompt flow as an online endpoint in Azure AI Foundry?
Open an interactive chat with Bash
What is the purpose of the `DefaultAzureCredential` in the code snippet?
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 .