-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Summary
Users who configure the CLI for external hosting ("needDeployment": false) do not set a location field in a365.config.json because it is not required for their setup. However, both a365 setup blueprint and a365 cleanup make calls to the Agent 365 endpoint registration API which requires Location in the request body. When location is absent from the config, these commands fail with a confusing server error.
Steps to Reproduce
Configure a365.config.json with "needDeployment": false and a messagingEndpoint (no location field):
{
"needDeployment": false,
"messagingEndpoint": "https://your-agent.example.com/api/messages",
...
}
Run a365 setup blueprint or a365 cleanup
Observed Behavior
ERROR: Failed to delete bot endpoint. Status: BadRequest
ERROR: Error response: {"errors":{"Location":["Location is required"]}}
WARNING: Failed to delete messaging endpoint
Expected Behavior
A clear, actionable error message telling the user to add a location field to their config, rather than a raw API validation error.
Root Cause
location is only validated as required when needDeployment: true (Azure hosting). For needDeployment: false, it is optional in the config schema. However, SetupHelpers.RegisterBlueprintMessagingEndpointAsync and BotConfigurator.DeleteEndpointWithAgentBlueprintAsync both pass location to the endpoint registration API unconditionally, with no guard for the empty case, causing a 400 BadRequest from the server.
Workaround
Add a location field to a365.config.json with the Azure region that was (or will be) used for endpoint registration:
"location": "eastus"
Affected Commands
a365 setup blueprint
a365 setup (full)
a365 cleanup
a365 cleanup blueprint
a365 cleanup blueprint --endpoint-only