Managed Runtime Administration
Managed Runtime makes it easy to manage your organizations, projects, environments, and bundles associated with your PWA Kit storefront. This guide describes the growing list of administration tasks that are possible in the web-based Runtime Admin tool. (All of the administration tasks described in this guide, and many more, can also be done using the Managed Runtime API.)
Before you continue, make sure that you have access to Managed Runtime and Runtime Admin. To provision Managed Runtime, contact your Success Manager. For Runtime Admin, contact your Commerce Cloud administrator and ask them to add either one of the following roles to your account using Account Manager: Managed Runtime User or Managed Runtime Admin.
Projects help you manage multiple environments within an organization. Every PWA Kit project needs a corresponding project within Managed Runtime for deploying and hosting the storefront code on Salesforce’s public cloud infrastructure.
To create a project in Runtime Admin:
- Log in to Runtime Admin.
- Click New Project.
- Enter a name for the project.
- Click Create Project.
When you first create a project, your site isn’t accessible on the web until after the necessary cloud infrastructure is deployed. This deployment process can take up to 40 minutes.
The instructions for the rest of the administration tasks in this guide all assume that you’re starting from a project Overview page in Runtime Admin.
To find an existing project and open its Overview page:
- Log in to Runtime Admin.
- Select an organization from the organization menu (top left), if necessary.
- Click the name of the project. (To see the project, you must be assigned one of the project roles described previously.)
To quickly switch between projects, use the project menu at the top of the page.
The Project Settings page is where you can do the following tasks:
- Look up the project ID and ensure that it matches a PWA Kit configuration.
- Edit the project ID.
- View and edit the project’s name and URL.
- Delete the project.
- Manage deployment notifications. (See next section.)
To access the Project Settings page:
- Go to a project’s Overview page.
- Click Project Settings from the left navigation.
To edit the settings, click Edit, make your edits, and click Update. To discard your edits, click Cancel.
To delete a project, click Delete, enter the project name to confirm, and click Yes, Delete. To keep the project, click No, Keep.
You can choose to be notified by email whenever any of the following deployment events happen:
- Start Deployment
- Successful Deployment
- Failed Deployment
To add a notification:
- Go to a project’s Overview page.
- Click Project Settings from the left navigation.
- Click Add Notification.
- Select one or more environments to be notified about.
- Select one or more deployment events.
- Enter email addresses for all notification recipients.
- Click Add Notification.
To edit a notification:
- Go to a project’s Overview page.
- Click Project Settings from the left navigation.
- Click the ... button next to the notification.
- Click Edit.
- Change any of the notification settings.
- Click Update Notification.
To remove a notification:
- Go to a project’s Overview page.
- Click Project Settings from the left navigation.
- Click the ... button next to the notification.
- Click Remove.
- Click Yes, Remove.
Environments are used to separate your production storefront from other storefronts that are deployed for other purposes, such as development or testing. To learn more about environments and other related concepts, see the Managed Runtime Overview.
To create an environment in Runtime Admin:
-
Go to a project’s Overview page.
-
Click New Environment
-
Enter a name for the environment.
-
Select a region for deploying to Salesforce’s public cloud infrastructure.
-
If the environment is a production environment:
- Mark it as production. If you have reached your limit of production environments, contact Support. For more information, see Production Environments.
- Add one or more site IDs to associate with the environment.
-
Select a Commerce Cloud instance to connect to the environment.
-
Click Complete Setup.
- The default region for new environments is US East (N. Virginia) because it’s located closest to on-demand sandboxes, which are commonly associated with development and testing environments.
- If you previously created an environment, you can Edit Environment Settings to connect it to a Commerce Cloud instance and one or more site IDs.
- There is no difference in the resources provided to a production or non-production environment. All environments automatically scale to handle traffic in the same way. For details, see Production Environments.
All supported regions have a paired backup region for failovers. You're responsible for ensuring that your application runs correctly in the selected primary and backup regions:
Primary Region | Backup Region |
---|---|
us-east-1 - US East (N. Virginia) |
us-east-2 - US East (Ohio) |
us-east-2 - US East (Ohio) |
us-east-1 - US East (N. Virginia) |
us-west-1 - US West (N. California) |
us-west-2 - US West (Oregon) |
us-west-2 - US West (Oregon) |
us-west-1 - US West (N. California) |
ca-central-1 - Canada (Central) |
us-east-2 - US East (Ohio) |
sa-east-1 - South America (São Paulo) |
us-east-1 - US East (Northern Virginia) |
ap-south-1 - Asia Pacific (Mumbai) |
ap-southeast-1 - Asia Pacific (Singapore) |
ap-southeast-1 - Asia Pacific (Singapore) |
ap-northeast-2 - Asia Pacific (Seoul) |
ap-southeast-2 - Asia Pacific (Sydney) |
ap-southeast-1 - Asia Pacific (Singapore) |
ap-southeast-3 - Asia Pacific (Jakarta) |
ap-southeast-1 - Asia Pacific (Singapore) |
ap-northeast-2 - Asia Pacific (Seoul) |
ap-southeast-1 - Asia Pacific (Singapore) |
ap-northeast-1 - Asia Pacific (Tokyo) |
ap-northeast-3 - Asia Pacific (Osaka) |
ap-northeast-3 - Asia Pacific (Osaka) |
ap-northeast-1 - Asia Pacific (Tokyo) |
eu-west-1 - EU (Ireland) |
eu-west-3 - EU (Paris) |
eu-west-2 - EU (London) |
eu-west-1 - EU (Ireland) |
eu-west-3 - EU (Paris) |
eu-central-1 - EU (Frankfurt) |
eu-central-1 - EU (Frankfurt) |
eu-west-3 - EU (Paris) |
eu-central-2 - EU (Zurich) |
eu-central-1 - EU (Frankfurt) |
eu-south-1 - EU (Milan) |
eu-central-1 - EU (Frankfurt) |
me-central-1 - Middle East (United Arab Emirates) |
eu-west-2 - EU (London) |
il-central-1 - Israel (Tel Aviv) |
eu-west-2 - EU (London) |
For any site that uses PWA Kit and Managed Runtime, you can only designate one bundle at a time as deployed for each environment.
- Go to a project’s Overview page.
- Click the name of the environment you want to deploy to. For example: production.
- Under the heading Bundles, click the Deploy button next to the bundle you want to deploy.
- Click Confirm Deploy.
- Wait until the deployment is complete.
When the deployment has successfully completed, the bundle appears underneath the heading Deployed Bundle. (For your first deployment to a new environment, the process can take up to an hour to complete.)
The Environment Settings page is where you can do many administration tasks in one place, including:
- Rename an environment or environment ID.
- Change the deployment region.
- Enable or disable server-side cookies. See Personalize with Cookies.
- Enable or disable Source Maps.
- Allow traffic with specific IP addresses or a trusted access control header to access an environment. See Access Control Headers.
- Configure proxies for an environment. See Proxying Requests for more information.
- Mark an environment as production.
- Add, edit, or remove site IDs associated with an environment.
- Add or edit an environment’s connection to a Commerce Cloud instance.
- Delete an environment.
To access the Environment Settings page:
- Go to a project’s Overview page
- Click the name of the environment whose settings you want to edit.
- Click Environment Settings from the left navigation.
To make edits, click the Edit button next to either the General settings or the Advanced settings. After making your edits, click Update to save your changes or click Cancel to discard your changes.
Access control headers allow you to restrict access to an environment so that only trusted traffic coming from your content delivery network (CDN) or development team is allowed. Restricting access is important to ensure that bots don't go around your CDN perimeter security settings and to ensure that search crawlers don’t index content from the wrong domain or environment.
If Allowed IP addresses are also set, requests with either a valid IP address or an access control header are allowed through.
Set access control headers by using the Advanced Environment Settings or the projects_target_access_control_header_create API.
Incoming requests are allowed only if an x-sfdc-access-control
request header is present with a valid value.
Each header value:
- Must be at least 9 characters long
- Can contain up to 128 characters
- Can be a combination of alphanumeric characters and - and _ characters
You’re responsible for ensuring that the access control header value is securely stored and shared only with trusted individuals. We strongly recommend rotating the access control header on a regular basis.
To rotate an access control header:
- Add an access control header value to the Managed Runtime environment by using the Advanced Environment Settings or the projects_target_access_control_header_create API.
- Wait for the Environment redeploy to complete successfully. Verify requests to the environment with the new header value succeed with a command such as:
- Update your CDN or browser to send the
x-sfdc-access-control
request header with the updated value. - Test that traffic is being allowed through as expected.
- Remove the original access control header value by using the Advanced Environment Settings or the projects_target_access_control_header_create API.
See Also
A redirect allows you to forward a request from the requested URL to a different URL. Redirects can help avoid disruptions to the user experience caused by changes to your storefront. For example, consider a seasonal campaign page for spring. When the spring campaign ends and is replaced with a summer campaign, you can redirect from the spring URL to the summer URL.
Redirects is a powerful feature that can have significant security consequences on your storefront, including redirecting to malicious URLs or assets. Please be careful when assigning roles to your users that give them Redirect access.
Before creating a redirect in a production environment, we recommend that you create it in a staging environment first.
You can also create one or more redirects using the projects_target_redirect_create API endpoint.
To create a redirect using Runtime Admin:
- Go to a project’s Overview page.
- Click the name of the environment where you want to create the redirect.
- Click URL Redirects from the left navigation.
- Click Create Redirect.
- In the Redirect From field, enter a relative URL path. For example, to redirect visitors from the URL
www.example.com/winter
, enter/winter
. - In the Redirect To field, enter a relative URL path.
- If needed, enable forwarding of query parameters and the wildcard path. (More information on forwarding settings in a moment.)
- From the Redirect Type dropdown menu, select a redirect type based on the HTTP status code. (More information on status codes in a moment.)
- Click Create Redirect.
Let’s look at the options for creating a redirect in more detail.
The value that you enter in the Redirect From field must always be a relative path. The Redirect To field can be either a relative path or a full URL. For example, imagine that we want to redirect visitors from www.example.com/spring
to www.example.com/summer
. The Redirect From field must be /spring
. The Redirect To field can be either /summer
or www.example.com/summer
.
You can add an asterisk character (*
) to the end of the Redirect From URL to indicate a wildcard. A wildcard matches any (0 or more) characters in the URL. For example, a redirect from /a/*
would match /a/
, /a/b
, and /a/b/c
.
A wildcard character can only be used at the end of the Redirect From URL.
Standard redirects are processed first by Managed Runtime, followed by redirects with wildcards.
Most redirects use the Permanent 301 status code, but you can also select Temporary 302. If you’re unsure which HTTP status code to use, consult this status code explainer from MOZ.com.
Some requests contain query string parameters that you also want to include in the redirected request. For example, the relative path /spring-landing-page
can be appended with a query string for analytics tracking, such as /spring-landing-page?gclid=123
.
To enable query parameter forwarding, go to the Forward section of the form and select Query Parameters. Otherwise, query string parameters from the source URL aren’t included in the redirect URL.
What happens when both the Redirect From and Redirect To URLs both have query strings and forwarding is enabled? In this case, the redirect URL includes a combination of the two query strings. The query parameters from the Redirect To URL are appended to the query string in the request. For example, imagine your application receives a request for the relative path /spring?year=2019
. If you’ve chosen to redirect /spring
to /summer?year=2020
, the redirect URL is /summer?year=2019&year=2020
when forwarding is enabled.
You can automatically include any path that comes after the wildcard portion of the Redirect From URL in the Redirect To URL. For example: if /a/*
matches /a/b/c
in the Redirect From URL, and the Redirect To URL is /z/
, the redirect URL is /z/b/c
.
To enable wildcard path forwarding, go to the Forward section of the form and select Wildcard Path.
We recommend that you always create redirects in a staging environment and clone them into production after testing them.
You can copy all the redirects from one environment to another using the clone redirects feature.
You can also clone redirects using the projects_target_redirect_clone_create API endpoint.
To clone redirects using Runtime Admin:
- Go to a project’s Overview page.
- Click the name of the environment that contains the redirects that you want to clone.
- Click URL Redirects from the left navigation.
- Click Clone Redirects. The Clone Redirects form appears. The current environment is listed under From Environment (the source).
- Under To Environment, select the environment that you want to clone the redirects into (the destination).
- Click Clone n Redirects. (Where n is the number of redirects to be cloned.)
When you clone redirects, you’re replacing all the redirects in the destination environment with all the redirects from the source environment.
You can also edit a redirect using the projects_target_redirect_partial_update API endpoint.
To edit the settings for an existing redirect using Runtime Admin:
- Go to a project’s Overview page.
- Click the name of the environment that contains the redirect that you want to edit.
- Click URL Redirects from the left navigation.
- Click the ellipsis button (...) next to the redirect.
- Click Edit.
- Update the settings.
- Click Update Redirect.
You can also delete a redirect using the projects_target_redirect_destroy API endpoint.
To delete a redirect using Runtime Admin:
- Go to a project’s Overview page.
- Click the name of the environment that contains the redirect that you want to delete.
- Click URL Redirects from the left navigation.
- Click the ellipsis button (...) next to the redirect.
- Click Delete.
- Click Yes, Delete Redirect.
If a redirect isn’t working as expected, try these troubleshooting steps:
- Clear your browser cache because redirects are cached.
- Verify that you’re viewing the settings for the correct environment.
- Edit the redirect and verify that the correct values are entered in the Redirect From and Redirect To fields.
Redirects have the following technical limitations:
- Each environment can have a maximum of 10,000 redirects.
- Each environment has its own set of redirects. It is your responsibility to keep them in sync using cloning.
- The redirects feature supports simple redirects from one path to another. For complex redirects with conditionals use Express.js' redirects support in
ssr.js
. - Redirects created with the Runtime Admin tool or the Managed Runtime API are not run on local development environments.
- Redirects are not triggered by page transitions in the PWA Kit application; they can only be triggered by an HTTP request.
- To load a redirect in the context of a storefront, use the managed endpoint
/mobify/redirect/$path
.
Here’s how to manage your users.
To add a user to a project:
- Go to a project’s Overview page.
- Click Users & Permissions from the left navigation.
- Click New User.
- Enter the user’s email address. (Make sure that the user is part of your organization and has either one of the following roles in Account Manager: Managed Runtime User or Managed Runtime Admin.)
- Select a role.
- Click Add User.
To change a user’s role:
- Go to a project’s Overview page.
- Click Users & Permissions from the left navigation.
- Click the ... button next to the user’s name.
- Click Edit.
- Select a role.
- Click the popup menu that appears.
- Select a new role.
- Click Save.
For a list of user abilities associated with each role, see the Managed Runtime Overview.
To remove a user from a project:
- Go to a project’s Overview page.
- Click Users & Permissions from the left navigation.
- Click the ... button next to the user’s name.
- Click Remove.
- Click Yes, Remove User.