Using the Retail Reprovisioning tool for Dynamics 365 for Operations

When you do any kind of copying between environments in Dynamics there are some settings which are copied that are actually wrong for the destination environment. To fix these you need to run a tool called Retail Reprovisioning tool (also called Environment retargeting tool)

At the beginning this was only supposed to be run for environments actively using the Retail Components. The recommendation at the moment (2017-11-29) is to run it for every environment since al of the actually contains Retail components.

1. To make sure that you have the latest version of the tool go to LCS – Asset Library. Go to Software Deployable Packages – Import  and Select the latest Environment Reprovisioning tool.

2. The next step is different depending on which type of environment you are using.

If you are using a 2-tier environment; go to the environment, select Maintain and  Apply Updates. Select the Environment Reprovisioning tool and click Apply. Continue to Step 5

If you are using a Dev environment you are not able to deploy using LCS and you will have to deploy from command line according steps 3 – 4

3. Unblock the downloaded file by Right-clicking the file and going to Properties – General Unblock for the fil

4. Extract the file to a temporary directory

Install using these command lines:

AXUpdateInstaller.exe list

Fix the DefaultTopologyData.xml and make it look like this:

<?xml version=”1.0″ encoding=”utf-8″?>
<TopologyData xmlns:xsd=”
http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>
   <Name>AX topology</Name>
   <MachineList>
     <Machine>
       <Name>localhost</Name>
       <ServiceModelList>
         <string>RetailServer</string>
         <string>ALMService</string>
         <string>AOSService</string>
         <string>BIService</string>
         <string>DevToolsService</string>
         <string>DIXFService</string>
         <string>DocumentRoutingAgent</string>
         <string>MROneBox</string>
         <string>PayrollTaxModule</string>
         <string>PerfSDK</string>
         <string>ReportingService</string>
         <string>RetailCloudPos</string>
         <string>RetailHQConfiguration</string>
         <string>RetailSDK</string>
         <string>RetailSelfService</string>
         <string>RetailStorefront</string>
         <string>SCMSelfService</string>
         <!– DefaultTopologyData are only for dev vhd, which we only support AOS update–>
         <!– Create a new topology data for your Cloud AX topology–>
       </ServiceModelList>
     </Machine>
   </MachineList>
   <BackupScript>
     <FileName />
     <Automated>false</Automated>
     <Description>Please backup your environment now, set this step to complete once you finished backup</Description>
   </BackupScript>
</TopologyData>

Generate The Runbook
AXUpdateInstaller.exe generate -runbookid=[runbookID] -topologyfile=[topologyFile] -servicemodelfile=[serviceModelFile] -runbookfile=[runbookFile]
AXUpdateInstaller.exe import -runbookfile=[runbookFile]

Verify the runbook

AXUpdateInstaller.exe list

Execute the runbook

AXUpdateInstaller.exe execute -runbookid=[runbookID]

Post Steps:

5. After the retargeting tool is run you need to run these four steps

a. Open the “Retail Parameters” form, and press the “Initialize” link under the “General” tab. Answer “Yes” to the prompt. This will provide any new Retail seed data.

clip_image001

b. Open the “Initialize Retail Scheduler” form, and run it with “delete existing configuration” set to “Yes“.

c. Restart the “Microsoft Dynamics AX Batch Service” on all AOS VMs. This will update any cached connection credentials that may be used when running a CDX data sync. (done by DSE if PROD => you need to raise a ticket)

d. Navigate to the “Channel Database” form and run a CDX 9999 sync (full sync). This should succeed if everything is properly configured for Retail.

6. Sometimes there is issues with some columns in some tables in the channel database looses their setting for full text indexing (this seems to be an effect of the BacPac procedure when sopying to and from an Azure Environment), this results in not being able to search in for instance MPOS. To verify this you can use this script:

SELECT
SCHEMA_NAME(t.schema_id) as TableSchema,
       t.name AS TableName,
       c.name AS CatalogName ,
       i.name AS UniqueIdxName,
       cl.name AS ColumnName,
COLUMNPROPERTY(t.object_id, cl.name, ‘IsFulltextIndexed’) as IsFullTextEnabledOnTable,
          fi.is_enabled AS isEnabledOnColumn
FROM
sys.tables t
INNER JOIN
sys.fulltext_indexes fi
ON
    t.[object_id] = fi.[object_id]
INNER JOIN
sys.fulltext_index_columns ic
ON
    ic.[object_id] = t.[object_id]
INNER JOIN sys.columns cl ON
        ic.column_id = cl.column_id
AND ic.[object_id] = cl.[object_id]
INNER JOIN
sys.fulltext_catalogs c
ON
    fi.fulltext_catalog_id = c.fulltext_catalog_id
INNER JOIN
sys.indexes i
ON
        fi.unique_index_id = i.index_id
AND fi.[object_id] = i.[object_id]
where c.name like ‘COMMERCEFULLTEXTCATALOG’
order by Tablename ASC

look for the ones having a ‘0’ in any column and fix them by runing:

ALTER FULLTEXT INDEX
ON [ax].tablename
ENABLE

ALTER FULLTEXT INDEX
ON [ax].tablename
SET CHANGE_TRACKING=MANUAL;
GO

ALTER FULLTEXT INDEX ON [ax].tablename START FULL POPULATION;
GO

ALTER FULLTEXT INDEX
ON [ax].tablename
SET CHANGE_TRACKING=AUTO;
GO

Links:
https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/deployment/install-deployable-package

Retail servicing data is not present in the RetailServer web.config when running Retail Retargeting tool

Thi is an issyue we have noticed on especially new environments that we have refreshed with a database from an existing Retail Enable environment. After refreshing the database we need to run the retargeting tool to make sure that all settings are corrected.

When the tool is run it fails at step 3 and when we look in the Step3RetargetRetailServer-logfile we find this:

12/6/2017 9:35:52 AM:     – Trying to get information of the website – AOSService …
Unexpected error. Microsoft.Dynamics.ApplicationPlatform.Environment.Settings.ConfigurationKeyNotFoundException: No setting keys found for prefix ‘CertificateHandler’.
    at Microsoft.Dynamics.ApplicationPlatform.Environment.Settings.BaseConfigSetting.GetSettingsForPrefix(String prefix)
    at ConfigEncryptor.Program.Main(String[] args).
12/6/2017 9:35:52 AM:
PSMessageDetails      :
Exception             : System.Management.Automation.RuntimeException: Retail servicing data is not present in the
                         RetailServer web.config, please contact DSE team.
TargetObject          : Retail servicing data is not present in the RetailServer web.config, please contact DSE team.
CategoryInfo          : OperationStopped: (Retail servicin…ntact DSE team.:String) [], RuntimeException
FullyQualifiedErrorId : Retail servicing data is not present in the RetailServer web.config, please contact DSE team.
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at <ScriptBlock>, F:\DeployablePackages\a2f41617-591e-45c9-bce4-1934c1b17ca6\RetailServer\scrip
                         ts\RetargetRetailServer.ps1: line 299
                         at <ScriptBlock>, <No file>: line 3
                         at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
12/6/2017 9:35:52 AM: Executed:
F:\DeployablePackages\a2f41617-591e-45c9-bce4-1934c1b17ca6\RetailServer\scripts\RetargetRetailServer.ps1
Exiting with error code .

This error is due to missing information in the Web.Config file for Retail. Fortunately there is a fairly easy fix… there is a script in the Retail Retargeting tool called Update-RetailServicingInformation.ps1 which populates the web.config file with the correct information. The parameters you will need to provide is the database name which you can find in SQL Server Management Studio and the SQL Server name. The server name for OneBox Environments is Localhost. For Tie-2 and up you will need to provide the Azure SQL name which you can find in LCS, don´t forget to add database.windows.net to make it a FQDN

/Johan

Running out of space on a Dynamics 365 for Operations Vm in Azure–Part 1

When setting up environments for Dynamics 365 for Operation in Azure you are using a tool called LCS (Life Cycle Services). This allows you to set up VMs in different sizes and once the are up it does not allow you to change them. When using the VMs they tend to, sooner or later, fill up and run out of disk space. There are two main ways to fix this… clean up or make the disk bigger (this will be handled in another article which I will link here). In this article we will look at things you can clean up.

1. Remove files in C:\TEMP
Note: Do NOT remove the C:\DIXF folder… that will make DIXF fail. If you remove it, by mistake, you will have to recreate it and manually set permissions on it.

2. You can also clean out files in C:\MonAgentData\SingleAgent\Tables\. To do this you first have to stop the Monitoring Agent Service.

Bye for today

Links
https://devserra.wordpress.com/2016/03/03/ax7-release-hd-space-on-your-ctp8-vm/

Detailed Version Information in LCS

When contacting Microsoft Support about Dynamics 365 for Operations they often ask you for the version information for an environment. We have been having an issue with seeing it for our Cloud Hosted Environments… it simply was not there:

SNAGHTML9e3aa91

I finally found a way to fix this and it is Very Simple (onece you know it)

Go to the adress bar in your browser… At here end of your URL you will find:

&IsDiagnosticsEnabledEnvironment=false

change it to:

&IsDiagnosticsEnabledEnvironment=true

and presto!!!

SNAGHTML9e78d61

/Johan

Error importing Electronic Reporting Configurations

Hi…

Today we are looking at an issue that one of my colleagues had. This is actually an Application issue but I am writing it up for future reference.

When we are importing Electronic Reporting configuration in Dynamics 365 for Operation we get the following error:

clip_image001

Since it is a bit intermittent and works for some configurations we have suspected a timeout… we were on the right track… When speaking to Microsoft Support we got the tip to change a parameter in the configuration for Electronic Reporting to allow more multiple parallel threads for loading data:

image

Go to Organization administration – Workspaces – Electronic reporting – Electronic Reporting parameters and change Number of parallel threads to load data to 15 (the default is 5)

BR

Johan

Error in Environment Reprovisioning tool

I have been working with an upgrade of Dynamics 365 for Operations now for a while and found an issue when it comes to Environment Reprovisioning tool, also known as Retail Retargeting Tool. This is a tool used to fix the retail conponents in an environment after you have done a database copy to the environment from another environment. We did this as part of the upgrade to Platfor Update 10.

When we ran the tool from the command prompt in the environemnt we gor the following error:

The step completed
Executing step: 3
GlobalUpdate script for service model: RetailServer on machine: localhost
Run RetargetRetailServer.ps1
RetargetRetailServer.ps1 failed.
The step failed
The step: 3 is in failed state, you can use rerunstep command to debug the step explicitly
at Microsoft.Dynamics.AX.AXUpdateInstallerBase.RunbookExecutor.executeRunbookStepList(RunbookData runbookData, List`1 runbookStepList, String updatePackageFilePath, Boolean silent, String stepID, ExecuteStepMode executeStepMode, Boolean versionCheck, Boolean restore, Parameters parameters)
at Microsoft.Dynamics.AX.AXUpdateInstallerBase.RunbookExecutor.executeRunbook(RunbookData runbookData, String updatePackageFilePath, Boolean silent, String stepID, ExecuteStepMode executeStepMode, Boolean versionCheck, Boolean restore, Parameters parameters)
at Microsoft.Dynamics.AX.AXUpdateInstallerBase.AXUpdateInstallerBase.execute(String runbookID, Boolean silent, String updatePackageFilePath, IRunbookExecutor runbookExecutor, Boolean versionCheck, Boolean restore)
at Microsoft.Dynamics.AX.AXUpdateInstaller.Program.InstallUpdate(String[] args)
at Microsoft.Dynamics.AX.AXUpdateInstaller.Program.Main(String[] args)

So this error was not that obvious to me… So I took a look at the loggs for the Deployable package which are located in the RunbookWorkingFolder (located in the folder where you extracted the package). There I found this:

Exception : System.Management.Automation.RuntimeException: The servicing data of this box has not been migrated yet, please rerun this tool with axlocaladmin
TargetObject : The servicing data of this box has not been migrated yet, please rerun this tool with axlocaladmin

This made me think… The older environments always had an account called axlocaladmin but the newer ones does not. After some digging around in the script called RetargetRetailServer.ps1 I found this (on line 302) :

if($env:UserName -ne ‘axlocaladmin’)
{
$errorMessage = “The servicing data of this box has not been migrated yet, please rerun this tool with axlocaladmin”
Log-TimedMessage $errorMessage
throw $errorMessage
}

I simply changed it to:

if($env:UserName -ne ‘adminXXXXXXXXXX’)
{
$errorMessage = “The servicing data of this box has not been migrated yet, please rerun this tool with axlocaladmin”
Log-TimedMessage $errorMessage
throw $errorMessage
}

where adminXXXXXXXXXX is the account name for my user and the i re-ran:

AXUpdateInstaller.exe execute -runbookid=env-reprovision -rerunstep=3

And presto… it worked 🙂

Note that this is the reprovisioning tool from 8/30/2017, I have not looked at any other verisons.

/Johan

Issues after Database copy

Yesterday we did a database refresh between two of our Non-Production OneBox environments an this morning I got an email. The users where having problem viewing invoices in All Sales Orders. The error they got looked like this:

“Something went wrong while generating the report. Please try again”

That was not extremely helpful so I started looking around and found information on how to get a detailed log:

1. Click on Environment monitoring.
2. Click on Raw logs
3. In the query name field, select “All events for activity”
4. Copy 78ca1c74-3c56-4f6b-8c18-a4034876780d in the activity ID
5. Click on shows options and set Row limit to 5000.
6. Click on search.
7. Scroll down towards the end to see exception message.

And that got me (not very useful):

at [aoskernel.dll]Microsoft.Dynamics.Ax.MSIL.Interop.GetManagedCallStack(basic_string<wchar_t\,std::char_traits\,std::allocator >* ) at [aoskernel.dll]Microsoft.Dynamics.Ax.Services.AOSAppDomainHelper.callGetManagedCallStack(basic_string<wchar_t\,std::char_traits\,std::allocator >* ) at callGetManagedCallStack(basic_string<wchar_t\,std::char_traits\,std::allocator >* ) at cqlClass.callEx(cqlClass* , Char* , interpret* ) at cqlClass.callEx(cqlClass* , Char* , interpret* ) at [aoskernel.dll]Microsoft.Dynamics.Ax.MSIL.cqlClassIL.Call(IntPtr c, String methodName, Object[] parameters, Type[] types, Object[] varargs, Type[] varargsTypes) at [Microsoft.Dynamics.AX.Server.Core.dll]Microsoft.Dynamics.Ax.Xpp.XppObjectBase.Call(String methodName, Object[] parameters, Type[] types, Object[] varargs) at [Microsoft.Dynamics.AX.Xpp.Support.dll]Dynamics.AX.Application.xInfo.add(Exception exception1, String text1, String text2) at [Dynamics.AX.ApplicationPlatform.dll]Dynamics.AX.Application.Info.`add(Exception _exception, String _txt, String _helpUrl, XppObjectBase _sysInfoAction, Boolean buildprefix, String _label, Boolean @_helpUrl_IsDefaultSet, Boolean @_sysInfoAction_IsDefaultSet, Boolean @buildprefix_IsDefaultSet, Boolean @_label_IsDefaultSet) in xppSource://Source/ApplicationPlatform\AxClass_Info.xpp:line 335 at [Dynamics.AX.ApplicationPlatform.dll]Dynamics.AX.Application.Info.InfoCoCHelper.`add(Info instance, Exception arg0, String arg1, String arg2, XppObjectBase arg3, Boolean arg4, String arg5, Boolean , Boolean , Boolean , Boolean ) at [Dynamics.AX.ApplicationPlatform.dll]Dynamics.AX.Application.Info.add(Exception _exception, String _txt, String _helpUrl, XppObjectBase _sysInfoAction, Boolean buildprefix, String _label, Boolean @_helpUrl_IsDefaultSet, Boolean @_sysInfoAction_IsDefaultSet, Boolean @buildprefix_IsDefaultSet, Boolean @_label_IsDefaultSet) at [Dynamics.AX.ApplicationPlatform.dll]Dynamics.AX.Application.Info.add(Exception _exception, String _txt) at [Dynamics.AX.ApplicationFoundation.dll]Dynamics.AX.Application.SrsReportViewerControl.`displayErrorMessage(String message) in xppSource://Source/ApplicationFoundation\AxClass_SrsReportViewerControl.xpp:line 870 at [Dynamics.AX.ApplicationFoundation.dll]Dynamics.AX.Application.SrsReportViewerControl.SrsReportViewerControlCoCHelper.`displayErrorMessage(SrsReportViewerControl instance, String arg0) at [Dynamics.AX.ApplicationFoundation.dll]Dynamics.AX.Application.SrsReportViewerControl.displayErrorMessage(String message) at SrsReportViewerControl::displayErrorMessage(Object , Object[] , Boolean& ) at [Microsoft.Dynamics.AX.Xpp.Support.dll]Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeInstanceCall(Object instance, String MethodName, Object[] parameters) at callILClassMethod(interpret* ip, Char* method, UInt32 chdl, cqlClass* c) at [aoskernel.dll]Microsoft.Dynamics.Client.ServerForm.Interactions.InteractionHandler.InvokeCommand(CommandInteraction interaction, CommandCallbackInteraction& result) at [aoskernel.dll]Microsoft.Dynamics.Client.ServerForm.Interactions.InteractionHandler.HandleCommandInteraction(CommandInteraction interaction, List`1 outboundInteractions) at [aoskernel.dll]Microsoft.Dynamics.Client.ServerForm.Interactions.InteractionHandler.HandleInteractions(IInteractionChannel interactionChannel) at [aoskernel.dll]Microsoft.Dynamics.Client.ServerForm.Interactions.InteractionManager.ProcessMessages(Object stateinfo) at [mscorlib.dll]System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at [mscorlib.dll]System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at [mscorlib.dll]System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at [mscorlib.dll]System.Threading.ThreadPoolWorkQueue.Dispatch()</wchar_t\,std::char_traits</wchar_t\,std::char_traits</wchar_t\,std::char_traits

So I started to look around a little and found the System administration – Setup – Server Configuration and noticed that there were 2 servers… in a OneBox Environment…

                     SNAGHTMLa4c1c3d

The migration server was still there and it seemed that it was trying to have that one generate the report. When I removed the extra server it started working

/Johan

Database Syncing

Hi…

Today we are doing a DB upgrade in Dynamics 365 for Operations. One of the steps in the process includes installing a hotfix which in turn triggers a database sync. The Sync failed so I tried to find a way to run it manually and since the environment is a TEST environment it does not have Visual Studio. Powershell to the rescue:

I:\AosService\WebRoot\bin\Microsoft.Dynamics.AX.Deployment.Setup.exe -bindir "I:\AosService\PackagesLocalDirectory" -metadatadir "I:\AosService\PackagesLocalDirectory" -sqluser "axdbadmin" -sqlserver "Demo-00000000" -sql database "AxDB" -setupmode "sync" -syncmode "fullall" -isazuresql "true"

Links:
https://community.dynamics.com/ax/b/axilitynet/archive/2016/01/28/ax7-database-synchronization-w-o-visual-studio

The Real-Time Service call Failed when trying to use CloudPoS

One of my colleagues contacted me today about an issue. When he was logged into the Dynamics 365 for Operations  Cloud POS and he tried to perform a “Real-Time Operation” such as resetting a password he got this error:

4BF47ABA

To reproduce it I tried to do the same, and low and behold it worked… we used the same PoS worker and we had the same Roles in Dynamics…

While he was doing some more testing i logged in to the Dynamics Server using RDP to see if there was anything in the Event viewer… Found something!

Real-time Service client library call for API ‘InvokeMethod’ method ‘UpdateStaffPassword’, language ‘sv-SE’, and company ‘usrt’ failed. Exception: ‘System.ServiceModel.FaultException`1[Microsoft.Dynamics.Retail.TransactionServices.ClientProxy.Fault]: Fault was thrown by the service for request c7f48632-52a9-447e-ba42-9d7cb4c800ba. Exception details:
Type: Microsoft.Dynamics.Ax.Xpp.ErrorException

Message: The language sv-SE is not supported by Microsoft Dynamics 365 for Operations
. For a list of supported languages, see Microsoft Dynamics 365 for Operations Online. (Fault Detail is equal to Microsoft.Dynamics.Retail.TransactionServices.ClientProxy.Fault).’.

The language sv-SE is not supported by Dynamics 365 for Operations… that’s better… now I know where to look. My browser was using english and my colleague was using swedish. We changed it to look like this by switching the order and moving English to the top…

image

… it worked !!!

That is all for today

/Johan