D365 Retail Server Health Check in 7 Steps
During one of my project implementations, we faced a challenge of our product “EdgeAX-CommerceLink” not functioning with the retail server of Dynamics 365/AX7. Usually, a retail server does not connect with an application when server health is not normal. In this blog, we will look at how to make a health check of the retail server when all other configurations fail to work.
Here is a URL for retail server health check; you can update the base URL w.r.t your environment.
How to Ensure a Normal Health of Retail Server
Here are some steps applicable to non-production lower environment where you restore the production database .bacpac.
- Database Change Tracking
- Channel Database
Production database .bacpac change tracking is disabled by default so enable it during production database .bacpac restoration in lower environment.
Change tracking enablement script:
ALTER DATABASE AXDB
SET CHANGE_TRACKING = ON
(CHANGE_RETENTION = 2 DAYS, AUTO_CLEANUP = ON);
declare @pkTables as table (name nvarchar(1000));
insert into @pkTables (name)
select distinct tc.TABLE_NAME as name
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc
join INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu ON tc.CONSTRAINT_NAME = ccu.Constraint_name
where tc.CONSTRAINT_TYPE = 'Primary Key'
-- Keep track of how many tables we are dealing with
declare @enabled int
declare @alreadyEnabled int
set @enabled = 0
set @alreadyEnabled = 0
select count(*) as tablesWithPrimaryKeys from @pkTables
-- For each table name in primary key tables
declare @tableName nvarchar(1000)
while exists (select * from @pkTables)
-- Set the current table name
select top 1 @tableName = name from @pkTables order by name asc
-- Enable change tracking for this table
select sys.schemas.name as schemaName, sys.tables.name as tableName from sys.change_tracking_tables
join sys.tables on sys.tables.object_id = sys.change_tracking_tables.object_id
join sys.schemas on sys.schemas.schema_id = sys.tables.schema_id
where sys.tables.name = @tableName
set @alreadyEnabled = @alreadyEnabled + 1
exec('alter table ' + @tableName + ' enable change_tracking')
set @enabled = @enabled + 1
-- Delete the current table name
delete @pkTables where name = @tableName
-- enabled + alreadyEnabled must equal tablesWithPrimaryKeys
select @enabled as tablesEnabled, @alreadyEnabled as tablesAlreadyEnabled
Once you restore the database, update the channel database connection string as the database contains an old production connection string. Get user password from LCS and update connection string accordingly.
- Current batch status must be waiting but not in failed/error.
Update channel profiles URL’s prefix with your environment base URL prefix (vwaxsit01).
Menu navigation, base URL prefix & URL to update:
- Language must be “En-Us” or any other used in your configurations.
- Service host address must be updated with base URL prefix (vwaxsit01).
Online channel must be configured properly 100%.
- Language must be ‘En-US’.
- Online channel should be in “published status” instead of “in progress”.
Complete the missing configurations and click “configuration status” which must be completed and in “approved” status. Mark all tasks as “approved” and press “update”
Since there is no option available for online channel publishing, I customized that feature. Refer to the script below for the “PUBLISH” button.
Set [PUBLISHSTATUS] = 3,
[PUBLISHSTATUSMESSAGE] = 'Published Successfully'
Where [ONLINECHANNEL] = 5637145328
Configure at least one retail store with complete configurations to ensure a normal server health.
- Retail store language must be “En-US”.
- Update your retail store hardware station URLs as per your base URL/prefix.
Once done, retail store configuration status must be “completed and approved”. Select all tasks as approved and click update.
- Refer to section 4. Real time service profiles, connection – you can see “user identifier” here.
- This account must exist with D365/AX7 users with
- Status – Enabled
- Company –Legal entity that you have configured. (VWO in this case).
To verify retail server health after completing steps above, enter this URL in browser. (Update the base URL as per your environment)
Disclaimer: The views expressed here are solely those of the author in his private capacity and do not in any way represent the views of Systems Limited, or any other entity related to Systems Limited.