Automatic Media Synchronization
The Business Portals - Synchronize Media job queue updates portal images and videos automatically from Business Central. Its standard interval is 60 minutes. Users do not need to sign in to the manual media update page for each refresh.
A refresh uses the existing media selection, business mappings, and filters. When it finishes successfully, the portal starts serving the new images and videos together. If a refresh fails before publication, the portal continues serving the last successfully published media.
Info
Automatic synchronization requires Business Central and portal versions that support this feature. Ask your administrator or implementation partner to update both sides before enabling the job. NAV installations continue to use the existing manual media update page.
Before You Start
Your administrator or hosting partner must ensure that:
- Business Central can reach the portal's address. A publicly accessible address is required when using Business Central Online.
- The portal can save media files and has enough free storage.
- The same Media Sync key is configured in Business Central and on the receiving portal.
- The portal's media selection is configured as intended.
The Media Sync key is separate from the App Registration client secret. It can also be used with self-hosted portals and other Business Central authentication methods. For server configuration, see Troubleshooting Media Synchronization.
Choosing Which Portals Are Updated
Each run attempts:
- Portals with a populated Url in Business Portals - Portals.
- The URL of the Endpoint selected in Business Portals - Module Setup, if that endpoint has a URL.
To select a self-hosted portal, open Business Portals - Module Setup, find Endpoint under General, and select or create an endpoint with the portal's base address. For example, enter https://portal.example.com, without a page name, query string, or #! fragment. No additional media synchronization portal reference is required in Module Setup.
If the selected Endpoint and a listed portal resolve to the same normalized address, the job attempts that address once. Other configured portals are still processed if one portal fails.
Setting Up the Media Sync Key
- Open Business Portals - Module Setup in Business Central.
- Under Media Synchronization, check Media Sync Key Configured.
- If no key is configured, choose Generate Media Sync Key from the page actions.
- Copy the encrypted value shown in the message and keep it secure. It starts with
ENC:v1:and is shown only during generation. - For managed portals using App Registration, the action attempts to update the portal configuration automatically. Review the result message.
- For a self-hosted portal, give the encrypted value securely to the person responsible for its configuration. They must install it as described in the technical guide.
Warning
Generating another key replaces the current key. Every receiving portal must receive the replacement before synchronization can succeed again. Self-hosted portals require a manual configuration update. Treat the encrypted value as a secret; do not include it in support messages or screenshots.
If an automatic configuration update fails, correct the connection or publishing permissions and choose Update Media Sync Key on Portals to retry using the stored key. You do not need to generate another key just to retry delivery.
Module Setup and the Media Sync key are shared across companies. A key change therefore affects media synchronization jobs in other companies too.
Creating the Job Queue Entry
- Open the Business Portals Administrator Role Center in the company where you want the job to run.
- Find the Job Queue Entries section.
- Open its actions and choose Create Default Entries.
- Find Business Portals - Synchronize Media.
- Open the entry and check its schedule and status. Use Set Status to Ready when you want automatic processing to start.
| Setting | Standard Value |
|---|---|
| Description | Business Portals - Synchronize Media |
| Object Type to Run | Codeunit |
| Object ID to Run | 5492810 |
| Parameter String | SYNC_MEDIA |
| Number of Minutes Between Runs | 60 |
Create Default Entries creates missing entries in the current company. It preserves existing entries and their administrator settings. Each company can have its own entry; however, jobs in different companies can update the same configured portals. Coordinate the schedules to avoid unnecessary duplicate transfers.
For general scheduling instructions, see Business Portals Job Queue.
Checking the First Run
- Run the job once using the available Job Queue actions, or wait for its next scheduled execution.
- Open Business Portals - Log in the company where the job ran.
- Find entries with Source set to Portal media synchronization.
- Review the individual portal results and the summary, for example: 1 updated, 0 unsupported, 0 failed.
- Open the portal and check representative images and videos. Refresh the browser if it still shows cached content.
| Result | Meaning |
|---|---|
| Updated | The portal accepted a complete refresh. |
| Unsupported | The portal did not expose the media synchronization endpoint. Ask the hosting partner to check its installed version. |
| Failed | The refresh did not complete successfully from Business Central's perspective. Review the portal-specific message. |
Info
A Success entry in the standard Job Queue history does not prove that every portal was updated. Portal failures are recorded separately in Business Portals - Log so the recurring job can continue with its next run. See Working with the Log.
Changes, Deletions, and Manual Updates
Each successful refresh publishes a complete media selection, including when the selected media has not changed. Images or videos no longer included in Business Central's selection disappear from the current portal cache after a successful refresh. An empty, valid selection publishes empty media folders.
If the update fails, the previous media remains available and may include content that has since been changed or deleted in Business Central. The next scheduled run attempts a full refresh again. Browser caching can also temporarily show an older image after publication.
The existing manual update page, UpdateImages.aspx, remains available for both Business Central and NAV portals. Manual updates and automatic synchronization use the same publication mechanism. If they overlap, a competing refresh may need to be repeated; check the logs before retrying.
Storage and Cleanup
After upgrading the portal, existing images and videos remain available from their original folders until the first successful refresh. No automatic job needs to have run for those existing files to remain usable.
The portal retains the current media generation and one previous generation. Older generations become eligible for cleanup 15 minutes after being replaced. Original legacy media folders become eligible 15 minutes after the first successful publication. Failed upload staging becomes eligible after two hours without activity.
Cleanup happens during later synchronization requests or manual updates, at most once per minute. These are grace periods, not background deletion timers. For example, on a NAV portal with no automatic job, old media may remain until another manual update occurs.
Frequent manual runs can temporarily leave several media generations on disk. Cleanup does not impose a fixed storage limit. Ask your hosting partner to monitor free storage, especially for large video collections. See the technical storage guidance.
HTTP Connections
HTTPS is required by default. Leave Allow HTTP Media Sync disabled for normal use.
An administrator can enable it under Media Synchronization for an approved HTTP connection or a development tunnel that forwards to HTTP. HTTPS addresses continue to use HTTPS. Both Business Central and the portal must support this option.
Warning
HTTP does not encrypt the transferred media. Enable this option only when the person responsible for the network has approved it, and disable it after debugging when it is no longer needed.