diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 31355c51a..222f80a6a 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -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[] diff --git a/modules/ROOT/pages/int-configure-api-autodiscovery-local.adoc b/modules/ROOT/pages/int-configure-api-autodiscovery-local.adoc new file mode 100644 index 000000000..dd67c8ee1 --- /dev/null +++ b/modules/ROOT/pages/int-configure-api-autodiscovery-local.adoc @@ -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] +---- + +---- + +== 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: "" +anypoint.platform.client_id: "" +anypoint.platform.client_secret: "" +---- + +Example Mule runtime arguments: + +[source,text] +---- +-M-Danypoint.platform.client_id= -M-Danypoint.platform.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. diff --git a/modules/ROOT/pages/int-developing-integrations.adoc b/modules/ROOT/pages/int-developing-integrations.adoc index 4a38db901..bba22e608 100644 --- a/modules/ROOT/pages/int-developing-integrations.adoc +++ b/modules/ROOT/pages/int-developing-integrations.adoc @@ -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].