-
Notifications
You must be signed in to change notification settings - Fork 11
W-22217959-Add-API-autodiscovery-in-local-testing-CP #637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Crispy-Salesforce
merged 3 commits into
MS2026-05-ACB-1-19
from
W-22217959-Add-API-autodiscovery-in-local-testing-CP
May 14, 2026
+64
−0
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
modules/ROOT/pages/int-configure-api-autodiscovery-local.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| = Configure API Autodiscovery for Local Testing | ||
| :page-deployment-options: cloud-ide, desktop-ide | ||
|
|
||
| include::reuse::partial$beta-banner.adoc[tag="anypoint-code-builder"] | ||
|
|
||
| Configure *API Autodiscovery* to connect your local Mule application to an API instance in xref:api-manager::latest-overview-concept.adoc[API Manager]. This setup enables local policy testing before you deploy the application. | ||
|
|
||
| == Before You Begin | ||
|
|
||
| Ensure you have: | ||
|
|
||
| * An active API instance in API Manager | ||
| * The xref:access-management::environments.adoc#to-view-the-client-id-and-client-secret-for-an-environment[client ID and client secret from Access Management] | ||
|
|
||
| == Get the API ID | ||
|
|
||
| . In Anypoint Platform, open *API Manager*. | ||
| . In *API Administration*, select your API instance. | ||
| . On the API summary page, copy the *API Instance ID*. | ||
|
|
||
| == Add the Autodiscovery Element | ||
|
|
||
| In your Mule app, add the autodiscovery element in your flow definitions. Use a property reference for `apiId` so you can load the value through configuration: | ||
|
|
||
| [source,xml] | ||
| ---- | ||
| <api-gateway:autodiscovery apiId="${api.instance.id}" flowRef="<YOUR_MAIN_FLOW_NAME>" /> | ||
| ---- | ||
|
|
||
| == Configure Local Credentials | ||
|
|
||
| For local execution in Anypoint Code Builder, provide your environment credentials through `config.yaml` or through Mule runtime arguments in VS Code settings. Avoid hardcoding secrets in Mule XML files. | ||
|
|
||
| Set these properties: | ||
|
|
||
| * `anypoint.platform.client_id` | ||
| * `anypoint.platform.client_secret` | ||
|
|
||
| Example `config.yaml`: | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| api.instance.id: "<YOUR_API_ID>" | ||
| anypoint.platform.client_id: "<YOUR_ENV_CLIENT_ID>" | ||
| anypoint.platform.client_secret: "<YOUR_ENV_CLIENT_SECRET>" | ||
| ---- | ||
|
|
||
| Example Mule runtime arguments: | ||
|
|
||
| [source,text] | ||
| ---- | ||
| -M-Danypoint.platform.client_id=<YOUR_ENV_CLIENT_ID> -M-Danypoint.platform.client_secret=<YOUR_ENV_CLIENT_SECRET> | ||
| ---- | ||
|
|
||
| To add these values in Anypoint Code Builder: | ||
|
|
||
| . Open the *Settings* tab. | ||
| include::reuse::partial$acb-reusable-steps.adoc[tags="mule-settings-nav-options"] | ||
| . In the *Settings* tab, find *Mule › Runtime: Default Arguments*. | ||
| . Append the client ID and client secret arguments to the end of the existing arguments. | ||
|
|
||
| Append the placeholder values with your client ID and client secret. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.