Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Latest commit

 

History

History
47 lines (35 loc) · 2.57 KB

advanced-steps.md

File metadata and controls

47 lines (35 loc) · 2.57 KB

Advanced steps

This article takes you beyond initial Adyen or Stripe deployment and integration with API Management.

Running the build script

To modify the infrastructure templates, you'll run a build script to generate a new Azure Resource Manager template output for deployment.

  1. Run the build.ps1 PowerShell script at the root of the repo.

  2. The build script generates deployment scripts for all Azure resources required to support the demo project.

  3. The build script executes the following steps:

    • Installs the Bicep CLI into the build folder.
    • Transpiles the main.bicep template into a single main.json Azure Resource Manager template in the output folder.

Running the billing portal app locally

To modify the billing portal app and run the app locally:

  1. Install NodeJS (version 14.16.1 or later).
  2. Deploy an instance of the API Management infrastructure, following the instructions in either:
  3. Make a copy of .env.sample in /app, rename to .env, and fill in the variables as per your environment.
  4. Use a tunneling app such as ngrok to create a public URL forwarding port 8080. If using ngrok:
    • Download ngrok.
    • Unzip the executable.
    • From the command line, run the ngrok executable to start an HTTP tunnel, using port 8080: ./ngrok http 8080.
    • Continue with the following steps, replacing <public-forwarded-url> with the output URL (for example, https://<unique-value>.ngrok.io).
  5. Update the API Management delegation URL via the Azure portal to point to <public-forwarded-url>/apim-delegation.
    • For Stripe, update the Stripe webhook endpoint URL to <public-forwarded-url>/webhook/stripe.
    • For Adyen, update the allowed origins to include <public-forwarded-url>.
  6. Run npm run dev from the /app folder to start the app.
  7. If you're running from VS Code, enable debugging by:
    • Opening the command palette.
    • Selecting Debug: Toggle Auto Attach.
    • Setting to Smart.

Re-building the docker image

If you make code changes to the custom billing portal app, you will need to:

  1. Re-build the docker image from app/Dockerfile.
  2. Publish the docker image to a publicly accessible container registry.
  3. When deploying, set the value of the appServiceContainerImage parameter to the URL for your published container image.