Skip to content

fix(t15): gate explicit account capability host behind opt-in flag#759

Closed
vtrika wants to merge 1 commit into
microsoft-foundry:mainfrom
vtrika:vtrika/backport-pr438-fix-t15-caphost
Closed

fix(t15): gate explicit account capability host behind opt-in flag#759
vtrika wants to merge 1 commit into
microsoft-foundry:mainfrom
vtrika:vtrika/backport-pr438-fix-t15-caphost

Conversation

@vtrika
Copy link
Copy Markdown
Contributor

@vtrika vtrika commented Jun 5, 2026

Template 15 (private-network-standard-agent-setup) was unconditionally provisioning the account-level capability host twice:

  1. Implicitly, server-side: when the account is created with networkInjections.scenario='agent', the platform auto-provisions a capability host named '@aml_aiagentservice'.
  2. Explicitly: add-account-capability-host.bicep then PUT a second caphost ('caphostacct') against the same account.

Only one capability host per account is allowed. The second PUT is rejected by agent-management, ARM keeps polling, and the deployment fails after the 1h resource-provisioning timeout.

This change makes the explicit caphost opt-in via a new boolean parameter 'createAccountCapabilityHost' (default false). The module is preserved for two legitimate scenarios:

When the flag is true, the module defaults the resource name to '@aml_aiagentservice' so the caphost matches the platform convention regardless of how it was created.

createCapHost.sh is removed: a user-named curl script that PUTs an account caphost competes with the implicit one in the default path and is fully superseded by the new flag.

Changes:

  • main.bicep: add 'createAccountCapabilityHost' bool (default false); conditionally invoke add-account-capability-host; keep it in the project caphost's dependsOn (no-op when condition is false).
  • modules-network-secured/add-account-capability-host.bicep: restored; default 'accountCapHost' is now '${accountName}@aml_aiagentservice'.
  • createCapHost.sh: deleted (replaced by the flag).
  • README.md: document the flag, the BYO/recovery scenarios, the platform convention for the implicit caphost name; fix deleteCaphost.sh casing; update module-structure listing.
  • azuredeploy.json: regenerated via 'az bicep build'.

Model: Claude Opus 4.7
Authored-by: vtrika
(cherry picked from commit 9f40464f68b4f47bc60a64fe44c67808d09ebf14)

Template 15 (private-network-standard-agent-setup) was unconditionally
provisioning the account-level capability host twice:

1. Implicitly, server-side: when the account is created with
   networkInjections.scenario='agent', the platform auto-provisions a
   capability host named '<account>@aml_aiagentservice'.
2. Explicitly: add-account-capability-host.bicep then PUT a second caphost
   ('caphostacct') against the same account.

Only one capability host per account is allowed. The second PUT is rejected
by agent-management, ARM keeps polling, and the deployment fails after the
1h resource-provisioning timeout.

This change makes the explicit caphost opt-in via a new boolean parameter
'createAccountCapabilityHost' (default false). The module is preserved for
two legitimate scenarios:

- BYO existing account that has no capability host yet (original use case
  of the module added in microsoft-foundry#261).
- Recovery: after running deleteCapHost.sh, redeploy with the flag set to
  recreate the capability host declaratively.

When the flag is true, the module defaults the resource name to
'<accountName>@aml_aiagentservice' so the caphost matches the platform
convention regardless of how it was created.

createCapHost.sh is removed: a user-named curl script that PUTs an account
caphost competes with the implicit one in the default path and is fully
superseded by the new flag.

Changes:
- main.bicep: add 'createAccountCapabilityHost' bool (default false);
  conditionally invoke add-account-capability-host; keep it in the project
  caphost's dependsOn (no-op when condition is false).
- modules-network-secured/add-account-capability-host.bicep: restored;
  default 'accountCapHost' is now '${accountName}@aml_aiagentservice'.
- createCapHost.sh: deleted (replaced by the flag).
- README.md: document the flag, the BYO/recovery scenarios, the platform
  convention for the implicit caphost name; fix deleteCaphost.sh casing;
  update module-structure listing.
- azuredeploy.json: regenerated via 'az bicep build'.

Model: Claude Opus 4.7
Authored-by: vtrika
(cherry picked from commit 9f40464f68b4f47bc60a64fe44c67808d09ebf14)
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

👋 Thanks for your interest in contributing, @vtrika!

This repository does not accept pull requests directly. If you'd like to report a bug, suggest an improvement, or propose a new sample, please open an issue instead.

If you are a Microsoft-internal contributor, please submit your PR through foundry-samples-pr instead.

See CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant