Web Replication Using Azure Storage
In this article
Web replication using Azure Storage is limited to distributing data from one “control” distribution location, normally HO, to any number of locations.
This is an addition to web replications that utilize Azure Storage Account to distribute data packets from Head Office (the source) to stores or POS terminals (the destination). The process to set up what data to send and to which location is the same as before. You set up a Scheduler Job and a Scheduler Subjob to define the date and the source location and the destinations.
The jobs are triggered to run at scheduled intervals. When the jobs run, they create a package with the requested data, the package is then sent from the source to each destination location by the web replication module.
There is now an option to use Azure Storage Account to share packages with the destination location instead of pushing the packages into each destination location by OData requests. This will free the source location (HO) from doing the actual update at the destination location, which is the most resource consuming effort in the web replication process. By sharing the package in Azure Storage Account, the source location will only read the data and send it to Azure Storage Account, the destination locations will get the package from Azure Storage Account and update the data in the destination location.
Note: Any limitations that may have existed for the web replication are still in place - see Web Replication Limitations.
What's new in this process?
The source location keeps track of all data packages in the Azure Storage Account and keeps track of what destination locations should receive each package and what destinations have successfully received the package. The source location publishes a web request that destination locations call to get information about the next package to receive to confirm that a package has been received and the data has been updated at the destination location.
Process overview
Setting up this method involves three kinds of Scheduler jobs, on two sides (HO and the POS):
| Where | Job | Codeunit |
|---|---|---|
| Source (typically HO) | Replication job (for example OFFLINE_POS_INIT or OFFLINE_POS_UPDATE), with Use Web Replication enabled | 99008923 LSC Data Distribution WS |
| Source (typically HO) | WEBREPLICATION (web replication module job) | 99009521 LSC Web Repl. Functions |
| Destination (POSs) | AZSREPLUPDATE (or a background session that runs when the POS is running) | 10000773 LSC Web Repl. AzS Utility |
For setup instructions, see Setup in Head Office, Create Packages in Head Office and Setup on the Offline POS .
With Azure Storage replication, the data reaches the POS in two separate steps: HO first uploads the package to the Azure Storage container, and the POS later fetches it and applies it. Because of this, there is a delay between the stages. The table below shows what to expect at each stage, and where to look. Unless stated otherwise, the pages are at HO.
| Stage | Job | What happens and what to expect | Where to look |
|---|---|---|---|
| 1. Request created | Replication job (99008923) at HO | Creates the request in the Web Replication Request Queue. The Data Packet Created field is False. | Web Replication Request Queue |
| 2. Package uploaded | WEBREPLICATION (99009521) at HO | Processes the request, creates the data packet and uploads it to the Azure Storage container. A record is created in the Web Repl. Azure Storage Packet Queue. Use this page to check which files have been uploaded to the container and are waiting to be processed by the destination location(s). The request is closed (moved to the Web Replication Request Log) once the upload succeeds. | Web Replication Azure Storage Packet Queue |
| 3. Package waiting for a POS | WEBREPLICATION (99009521) at HO, in the same run | For each data package, an entry is created for each destination location that should receive it. The entry stays until the POS has fetched the package and confirmed the receipt. | Web Replication Azure Storage Distribution Queue |
| 4. Package fetched and applied | AZSREPLUPDATE (10000773) or background session, at the POS | The POS asks HO for the next package, downloads it from Azure Storage, updates its data, and confirms the receipt to HO. | At the POS: the job, or Background Sessions on the POS Terminal card |
| 5. Receipt confirmed | (The POS confirmation call) | HO records that the POS received and processed the package. | Azure Storage Distribution Log (opened from the Packet Queue page) |
A package that the POS has not fetched yet is expected to be in the Distribution Queue. This is not an error. To compare this flow with the other web replication methods, see Comparison of the methods.
Troubleshooting
| What you see | Likely cause | What to check |
|---|---|---|
| The request stays in the Request Queue, and no package appears in the Packet Queue | The WEBREPLICATION job (codeunit 99009521) is not running, or the upload to Azure Storage fails. | Check the WEBREPLICATION job and the Web Replication Azure Storage Setup page (account name, account key and container). Check that the storage account can be reached from HO. |
| A package is in the Packet Queue, but there is no Distribution Queue entry for the POS | The POS distribution location does not take part in the Azure Storage replication. | On the POS Distribution Location Card, check that Web Replication Method is set to Azure Storage. |
| The POS does not get the packages | The POS cannot reach HO, or the update is not running on the POS. | On the POS, check the Azure Storage Control Location in the Scheduler Setup, the Web Server FastTab of that location, and run Test Web Connection. Check that the AZSREPLUPDATE job or the background session is running. At HO, check that codeunit 10000772 is published as an OData V4 web service with the service name WebReplAzSODataMgt. |
| The HO does not recognize the POS asking for packages | The Local Distribution Location in the POS Retail Setup does not match the distribution location at HO. | Check that the Local Distribution Location on the POS is the same code as the distribution location defined at HO. |
| Errors accessing the storage container | The account key is wrong or was rotated, or the storage account blocks the connection. | Check the account key and the network settings of the Azure Storage account. See How to: Set Up an Azure Storage Account. |
| The packet pages are empty on the POS | These pages are only filled in at HO. | Open the pages at HO. |
| Azure Storage keeps growing | Old packages are not removed automatically. | See How to: Azure Storage Housekeeping. |