Backup Azure SQL database

In working with Dynamics 365 for operations one is exposed to Azure SQL. Azur SAL works a bit differently than the “regular old” SQL and one of those areas is backup.

To backup a database in Azure SQL I use one of two methods:

1. Create a copy of the table in the same SQL Server

CREATE DATABASE [sourcedb] AS COPY OF [destinationdb]

This operation is performed asynchronously and you will need to verify that the job is done before you continue. This can be done with this command:

SELECT * FROM sys.dm_database_copies

Note: you need to have selected the master database when you run the backup. Otherwise you will not be able get an exclusive lock on the database and you will get the following error: Msg 42019

To find what is locking the database you can use:

SELECT * FROM sys.dm_exec_sessions
KILL [session ID]

2. Use SqlPackage to create an export in the form of a BacPac file

cd C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin
SqlPackage.exe /a:export /ssn:<server>.database.windows.net /sdn:<SourceDB> /tf:<filedestination> /p:CommandTimeout=1200 /p:VerifyFullTextDocumentTypesSupported=false /sp:<sql password> /su:<sql user>


/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

En Liten Podd Om It – Avsnitt 136 – Det går bara att vika runt den en gång

Hejsan Hoppsan…

Mats flyttar och då passarvi på att ta in en vikarie… vi lyckas dock inte helt med inkvoteringen men det blev ganska bra ändå

I avsnittet pratar vi om Googles Event, Apples lösenord och Sonos nya högtalare…

 

Nu kör vi

Johan och Björn

DynamicsPodden – Avsnitt 8 – AI och Machine Learning

Hej

 

Efter ett långt härligt sommarlog är vi äntligen tillbaka. Vi startar storartat med ett avsnitt om framtiden… nämligen AI och machine learning och en massa annat kul. Vad är det. vad kan man ha det till och hur kommer man igång. För att reda ut frågetecknen har lånat in vår kollega Arnold Andersson

/DynamicsPodden

En Liten Podd Om It – Avsnitt 135 – Vi skall inte ha någon Youtube App till Windows Phone

Hejsan Hoppsan…

Veckan efter Microsoft Ignite och vi river av ett nytt avsnitt podd… denna vecka men små söta robotar, gamla bittra Windows Phone användare och en hel bunt med exploits…

 

Nu kör vi

Mats & Johan

The Nerd Herd – Avsnitt 102 – Ami Casto

Hej…  Nu har det varit sommar och vi har varit lediga… väldigt länge. Vi börjar säsongen med en intervju med Ami Casto från Adaptiva. Vi pratar Windows 10 deployment, konferenser, SCCM och omstartade datorer. /TNH   Hi…  The summer is over and we have had time off… a lot. We start the season with an interview with Ami Casto from Adaptiva. We talk about Windows 10 deployment, SCCM, conferences, and rebooted computers. /TNH
Source: The Nerd Herd

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