1
Implement an agentic solution
medium
Refer to the exhibit. You deploy this ARM template to create an agent in Microsoft Foundry. The agent uses an Azure Function as an action. The deployment succeeds but when the agent calls the function, it gets a 401 Unauthorized error. What is the most likely cause?
Exhibit
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Agents/agent",
"apiVersion": "2025-01-01-preview",
"name": "MyAgent",
"properties": {
"displayName": "MyAgent",
"model": {
"provider": "AzureOpenAI",
"name": "gpt-4o-mini",
"version": "2024-07-18"
},
"actions": [
{
"type": "openApi",
"id": "weatherApi",
"authentication": {
"type": "ApiKey",
"keyName": "x-functions-key",
"keyValue": "[listKeys(resourceId('Microsoft.Web/sites/functions', 'MyFunctionApp'), '2022-03-01').functionKeys.default]"
},
"parameters": {
"url": "https://myfunctionapp.azurewebsites.net/api/weather"
}
}
]
}
}
]
}