Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
** xref:int-manage-custom-metadata.adoc[]
** xref:int-debug-mule-apps.adoc[]
** xref:int-test-munit.adoc[]
** xref:int-configure-api-autodiscovery-local.adoc[]
** xref:int-autodiscovery-config.adoc[]
** xref:int-export-mule-project.adoc[]
** xref:int-import-mule-project.adoc[]
Expand Down
62 changes: 62 additions & 0 deletions modules/ROOT/pages/int-configure-api-autodiscovery-local.adoc
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]
Comment thread
Crispy-Salesforce marked this conversation as resolved.
----
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.
1 change: 1 addition & 0 deletions modules/ROOT/pages/int-developing-integrations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ After you xref:int-create-integrations.adoc[create your integration project],
you can optionally:

* xref:int-create-secure-configs.adoc[Define and secure properties for your Mule application].
* xref:int-configure-api-autodiscovery-local.adoc[Configure API Autodiscovery for local testing].
* xref:int-trigger-flows.adoc[Trigger flows in your development environment].
* xref:int-use-dw-to-transform-data.adoc[Use the DataWeave language].
* xref:int-debug-mule-apps.adoc[Debug Mule apps].
Expand Down