June 07, 2024

[Solved] Dynamics 365FO DB restore error Line 1 The permission 'KILL DATABASE CONNECTION' is not supported in this version of SQL Server.

Important Note: Microsoft frequently updates SqlPackage. Therefore, it’s crucial to download the latest version of SqlPackage each time you intend to use any of its commands. Download the latest SQLPackage.

Error Details: The error message for BacPac DB restore is as follows:

Dynamics 365FO DB restore error Line 1 The permission ‘KILL DATABASE CONNECTION’ is not supported in this version of SQL Server. Alternatively, use the server level ‘ALTER ANY CONNECTION’ permission.





Dynamics 365FO DB restore error Line 1 The permission 'KILL DATABASE CONNECTION' is not supported in this version of SQL Server. Alternatively, use the server level 'ALTER ANY CONNECTION' permission.

Recommended solution: 

Step 1: Navigate to the folder where your BACPAC file is saved and change the file extension from .bacpac to .zip.

Step 2: Open the zip file and copy the model.xml file to a different location. Open the copied file in a text editor such as Notepad, VS Code, or Visual Studio. (Avoid editing the file directly in the zip folder or the original file).



Model file may not load in notepad, I would prefer to open this into VS code, Visual Studio itslef or Notepad ++, 


Step 3: In the copied model.xml file, find and delete the entire Element tag that contains “Grant.KillDatabaseConnection”. Save the modified file as ModelCopy1.xml.




Step 4: Copy the modified file (ModelCopy1.xml) and paste it into the SqlPackage folder. (Download the latest version of SQLPackage)


Step 5: Change the file extension of the zip file back to .bacpac (reverse of Step 1).

Step 6: Go to the downloaded SQLPackage folder and execute the following command:

SqlPackage.exe /a:import /sf:J:\MSSQL_BACKUP\PreProdDB.bacpac /tsn:localhost /tdn:AxDB_PreProd2005 /p:CommandTimeout=1200 /TargetUser:"axdbadmin" /TargetPassword:"<DbPassword>" /TargetTrustServerCertificate:True /mfp:"ModelCopy.xml
DB import should be successful this time. 

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

May 24, 2024

Covert timestamp (1716336000000) to ISO format (2020-08-20T23:00:00Z)

To convert a timestamp in milliseconds to a date format like 2020-08-20T23:00:00Z in X++, you can use the DateTimeUtil class to convert the timestamp to a DateTime value, and then format it as needed. Here’s an example of how you might do it:

static void ConvertTimestampToDate(Args _args)
{
    // Your timestamp in milliseconds
    int64 timestamp = 1716336000000;

    // Convert the timestamp to DateTime
    DateTime dateTime = DateTimeUtil::addMilliseconds(DateTimeUtil::utcNow(), timestamp - DateTimeUtil::getSystemDateTime());

    // Convert DateTime to desired format
    str formattedDate = DateTimeUtil::toStr(dateTime, DateTimeUtil::TimeZone::UTC);

    // Print the formatted date
    print formattedDate;
    pause;
}

This code snippet assumes that the timestamp 1716336000000 is the number of milliseconds since the Unix epoch (January 1, 1970). The DateTimeUtil::addMilliseconds method is used to add the timestamp to the Unix epoch to get the correct DateTime. Then, DateTimeUtil::toStr is used to convert the DateTime to a string in the ISO 8601 format, which matches the format you provided (2020-08-20T23:00:00Z). Please adjust the logic if your timestamp is based on a different epoch or requires different handling.

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

May 20, 2024

QuickFix: Error 1064 An Exception occurred in the service when handling the control request


Windows could not start the Microsft Dynamics 365 Unified Operations: Batch Management Service service on Local Computer: Error 1064




Solution: Check event logs and you may get exact error, in my case I was trying to update some ISV and somehow, there was package refence was missing in other custom model which was causing this error.

Also try this , this also helps to fix this issue, 



-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

May 15, 2024

Lets understand D365FO service updates

Today, we’re going to discuss some important updates from Microsoft that you should be aware of. Let’s dive in!

Service Updates

Microsoft’s service updates are continuous and touchless, providing new features and functionality. These updates eliminate the need for expensive upgrades every few years and maintain backward compatibility, so there’s no need to merge your code.

Here are some major updates on how you upgrade your system after 10.0.37 and the beginning of 10.0.39:

  • Customers can choose to pause one update at a time.
  • The number of service updates released annually is being reduced from seven to four. Customers can take up to four service updates per year and are required to take a minimum of two per year.
  • In case of multiple sandboxes, customers have to define which is the designated UAT sandbox to be used for production upgrade. A sandbox auto-update occurs seven days before the production update.
  • Microsoft is releasing four service updates annually, in February, April, July, and October.
  • In LCS, there are two auto-update dates. If customers did not upgrade their system, Microsoft will auto upgrade them based on settings in LCS. Beginning version 10.0.39, the service update auto-update window is divided into two windows that are separated by approximately a four-week gap.

The First Release Program

The First Release program is open to all customers. Customers who join it are the first, select group of customers to take the service update all the way to production. Microsoft manages the deployment of this service update to a UAT sandbox environment and then auto-deploys the update to production seven days later. Customers who participate in this program gain the benefit of having dedicated Microsoft engineers closely monitor the environments for any issues after updates are applied.

Regulatory Updates

A regulatory update is a new feature, or a change to an existing feature, that’s required by law, usually for a specific country or region. A regulatory update is always required by a specific law enforcement date (LED) and should be enabled by that date or earlier.

Expected Downtime During an Auto-update

The expected downtime for a successful update is approximately 15 minutes. However, Microsoft asks for three hours of downtime in case issues occur while the update is being applied.

PQUs

PQUs are cumulative builds of hotfixes that are delivered with near-zero downtime. PQUs follow a push model, where updates are applied to a Microsoft Dynamics Lifecycle Services environment in the background and have minimal impact on customers. Every PQU is deployed region by region, by following a “safe deployment process” that tracks issues that are found within each region during deployment. The safe deployment process helps identify and fix issues before the PQU is deployed to more regions. PQUs are 100-percent automated and contain important bug fixes that are ready after the service update is generally available.

That’s all for today! Stay tuned for more updates and don’t forget to follow us on Facebook to keep in rhythm with us.

Best, Harry