09 October 2025

💡 How to Import a Bacpac File into a Cloud-Hosted D365 F&O Environment

When working with a newly deployed cloud-hosted Dynamics 365 Finance & Operations (D365 F&O) environment, you might want to populate it with data from a .bacpac file—typically exported from a sandbox or UAT environment.

There are several ways to do this, and unfortunately, quite a few things can go wrong along the way. My preferred method is using the d365fo.tools PowerShell module, which simplifies the process of repairing and importing .bacpac files.

🛠 Step 1: Install d365fo.tools

Start by installing the required PowerShell modules:

Install-PackageProvider nuget -Scope AllUsers -Force -Confirm:$false

Install-Module -Name d365fo.tools -AllowClobber -Scope AllUsers -Force -Confirm:$false

Invoke-D365InstallSqlPackage

⚠️ Troubleshooting Installation Issues

If you encounter the following error:

PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'd365fo.tools'. Try Get-PSRepository to see all available registered module repositories.

You’ll need to register the default repository manually:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Register-PSRepository -Default -Verbose

Verify the repository registration:

Get-PSRepository

🔧 Step 2: Repair the Bacpac File (if needed)

Sometimes the .bacpac file needs to be repaired before it can be imported:

Repair-D365BacpacModelFile -Path "D:\UAT.bacpac" -Verbose

📥 Step 3: Import the Bacpac File

Once repaired (or if the original file is fine), import it into your environment:

Import-D365Bacpac -ImportModeTier1 -BacpacFile "D:\UAT.bacpac" -NewDatabaseName "AXDB_import" -Verbose

🔄 Step 4: Switch Databases and Sync

After importing, you’ll need to stop the environment, switch the active database, perform a DB sync, and restart everything:

Stop-D365Environment -All

Switch-D365ActiveDatabase -SourceDatabaseName AXDB_import

Invoke-D365DBSync -ShowOriginalProgress

Start-D365Environment -All

07 October 2024

truncate tables with a suffix

While working with D365 F&O I often have to delete test data from several tables with a prefix or suffix. The following SQL script helps a lot to generate the truncate commands for these tables. For example to empty all staging tables from a BYOD.


DECLARE @suffix NVARCHAR(50) = 'staging'; 


SELECT TABLE_SCHEMA, TABLE_NAME, 'truncate table ' + TABLE_NAME as SQLCommand

FROM INFORMATION_SCHEMA.TABLES

WHERE TABLE_NAME LIKE '%' + @suffix;

03 April 2023

LCS Shared asset library - different content per geo location

 I just tried to download a software deployablte package from the shared asset library. 

Unfortunately it was not available. That was quite confusing at first. But than I realized that I'm using lcs in geo location Europe lately: https://eu.lcs.dynamics.com/V2/SharedAssetLibrary

The asset library for Europe contains just (67) software deployable packages:



Switching geo location to US solved the problem. There I do see more assets (136). 


Has anyone ever noticed this. I'm using the same tenant.

I tried other geo locations and all do have different amount of software deployable packages.

@Microsoft: Please keep them in sync 

28 March 2023

Microsoft Teams 2.0 ;)

Finally Microsoft Teams is supporting multi tenant activity in the windows app. 

What’s New in Microsoft Teams at Enterprise Connect 2023 - Microsoft Community Hub












15 December 2022

Download large db backups from LCS asset library

If you have to download a large database backup from LCS asset library this might be a real pain. It is slow and unstable if you just download it with your browser.

 You should always use azcopy: Copy or move data to Azure Storage by using AzCopy v10 | Microsoft Learn

In LCS just click on the "Generate SAS link" this will copy the download link into the clipboard. Open a command prompt and run

azcopy "SASlink" t:\yourLocalFolder





05 April 2022

D365 VHD for 10.0.24 is finally available

 For all of you looking for a new D365 VHD Microsoft has just released the VHD with version 10.0.24




19 October 2021

Call Dynamics AX2012 AIF Webservice from Postman

Lately I was forced to call a Dynamics AX2012 webservice from Postman. The service is deployed as an HTTP service inbound port in AX on the IIS instance.

First of all I had to authenticate against AX to get around "IIS 8.5 Detailed Error - 401.1 - Unauthorized" - there are some posts in the WWW suggesting to use Fiddler as a supporting tool for the authentication. In my case I was able to use NTLM authentication from postman:


Even though this is still beta it is working quite well for me. 

After that I did some tests with GET and POST. In the header it is important to set

Content-Type = text/xml; charset=UTF-8
SOAPAction = http://tempuri.org/AXService/ProcessWhatever

In the POST scenario I was facing "400 Bad request". This is quite chalanging cause it just means that there is something wrong within the Body. In my case I finally wrote a working XMLwhich looks something like this:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:CallContext xmlns:h="http://schemas.microsoft.com/dynamics/2010/01/datacontracts"
               xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<h:Company>ABC</h:Company>
<h:Language i:nil="true"/>
<h:LogonAsUser i:nil="true"/>
<h:MessageId i:nil="true"/>
<h:PartitionKey i:nil="true"/>
<h:PropertyBag i:nil="true" 
                            xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
</h:CallContext>
</s:Header>
<s:Body>
<ABCServiceRequest xmlns="http://tempuri.org">
<data>123</data>
</ABCServiceRequest >
</s:Body>
</s:Envelope>

The last error I saw was "500 internal server error" - Unexpected character encountered while parsing value. This was due to a wrong value within the body of the XML.

After all that was solved I now can try the AX interface through postman and I'm happy to see "200 Ok" and the response from the service

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
        <ABCServiceRequest xmlns="http://tempuri.org">
            <response>processed :) </response>
        </ABCServiceRequest >
    </s:Body>
</s:Envelope>