Skip to content

Commit 964ef72

Browse files
Vivek BhadauriaCopilot
andcommitted
fix(agents/postdeploy): make postdeploy non-fatal after successful deploy
The postdeploy event handler runs AFTER the agent is already deployed and active. Failures in this step (AZURE_TENANT_ID missing, agent version lookup 404, RBAC assignment errors) should not cause azd up to report EXIT 1 when the deploy actually succeeded. Wrap the postdeploy handler to catch all errors and emit a warning to stderr instead of returning the error to azd (which treats it as a deployment failure). Discovered via iterative quickstart assessment: - Iter1: AZURE_TENANT_ID not set → EXIT 1 - Iter3: duplicate service → version lookup 404 → EXIT 1 Both cases had working agents despite the error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent be06a46 commit 964ef72

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • cli/azd/extensions/azure.ai.agents/internal/cmd

cli/azd/extensions/azure.ai.agents/internal/cmd/listen.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ func configureExtensionHost(host *azdext.ExtensionHost) {
4949
return predeployHandler(ctx, azdClient, args)
5050
}).
5151
WithProjectEventHandler("postdeploy", func(ctx context.Context, args *azdext.ProjectEventArgs) error {
52-
return postdeployHandler(ctx, azdClient, args)
52+
if err := postdeployHandler(ctx, azdClient, args); err != nil {
53+
// Postdeploy runs AFTER the agent is successfully deployed.
54+
// Failures here (RBAC assignment, version lookup) are non-fatal
55+
// — the agent is already live. Warn and continue.
56+
_, _ = fmt.Fprintf(os.Stderr, "\n⚠ Post-deploy step failed (non-fatal): %v\n"+
57+
" Your agent deployed successfully. This step handles optional RBAC setup.\n\n", err)
58+
}
59+
return nil
5360
}).
5461
WithProjectEventHandler("postdown", func(ctx context.Context, args *azdext.ProjectEventArgs) error {
5562
return postdownHandler(ctx, azdClient, args)

0 commit comments

Comments
 (0)