Deploying to Azure with Static Web Apps
This deployment example refers to Azure Static Web Apps.
Before you get started, you need to have:
In your Custom Application config, provide the Custom Application ID you got when you configured the Custom Application in the Merchant Center.
Moreover, you need to provide the production URL from your Azure project. You can keep the standard Azure Static Web Apps URL
https://<project>.1.azurestaticapps.net or provide your custom domain.
Using environment variables
In case you want to avoid hardcoding certain values, for example the Application ID, or the Project key, you can use variable placeholders in your Custom Application config.
Connect Azure with GitHub Actions
The easiest way to deploy to Azure is to use Static Web Apps deployment service. This service enables first-class GitHub integration.
Follow the steps in the Azure Static Web App creator to create a new project and select
GitHub as the deployment source.
Make sure to grant Azure access to your repository in the following step.
Configuring build settings
In the Static Web App setup process you need to configure the following things:
- Select your organization, repository and branch.
- In the Build details section select
Customas the build preset.
- Provide the following build settings:
- App location:
- Output location:
- App location:
Configuring rewrite rules
A Custom Application is a Single-Page Application that uses client-side routing. Therefore, we need to instruct Azure to rewrite all requests to serve the
For this purpose, create
staticwebapp.config.json file in the root directory of your project with the following content:
Test your deployment
In the Merchant Center you can now follow the steps to install the Custom Application and access it in your Projects.