17 November 2017

Deploy Package in Dynamics 365 Operations manually using AX update installer and runbook

In this blog article, we will see how we can deploy package in Dynamics 365 Operations. This Package can be any latest update, hotfix or deployment package you have created.
Prerequisites:
LCS login
VM Instance
Steps:
1. Download, Extract and Unblock Package
2. Update topology configuration data
3. Generate a runbook from the topology
4. Execute runbook
Download, Extract and Unblock Package
a. Login to LCS and download the Zip file of Deployable Package.
b. After downloading, go to downloaded Zip file properties and select unblock.
c. Extract the Zip file to a non–user folder.
Update topology configuration data
a. Go to extracted folder and open the file “DefaultTopologyData.xml”
b. Populate the file with VM name.
i. Go to This PC -> Properties. Find the name of the machine.
ii. Update the VM name with the machine name in the file.
c. Populate the file with installed components
i. Open a command prompt as an administrator.
ii. Run the command from extracted folder path to see a list of all installed components on the computer.
iii. Update the file with a list of components.

3. Generate a runbook from the topology
a. Run the command to generate a runbook.
AXUpdateInstaller.exe generate -runbookid=[runbookID] -topologyfile=[topologyFile] -servicemodelfile=[serviceModelFile] -runbookfile=[runbookFile]
Example:

b. Runbook will contain instructions in sequential steps to deploy the package.
4. Execute Runbook
a. Import the runbook.
AXUpdateInstaller.exe import -runbookfile=[runbookFile]
Example:

b. Verify the runbook.

c. Execute the runbook.
AXUpdateInstaller.exe execute -runbookid=[runbookID]
Example:

d. Export the runbook.
Export the runbook for future reference, you can use it to refer the steps, time to execute each step and logs for each step.
UpdateInstaller.exe export -runbookid=[runbookID] -runbookfile=[runbookFile]
Example:

how to restore the *.bacpac databse in MS SQL Server - import the bacpak file in MS SQL Server

Import the database

When you import the database, we recommend that you:
•Retain a copy of the existing AxDB database, to allow you to revert to it later if needed.
•Import the new database with a new name, for example AxDB_fromProd.

Copy the *.bacpac file to the local machine from which you will import to ensure the best performance. Open a command prompt as Administrator and run the following commands.

Syntax:
SqlPackage.exe /a:import /sf:D:\Exportedbacpac\my.bacpac /tsn:localhost /tdn: /p:CommandTimeout=1200
Example:
SqlPackage.exe /a:import /sf:J:\Test_DB\Test110617.bacpac /tsn:D365Test /tdn:AxDBTest /p:CommandTimeout=1200

The following list provides an explanation of the parameters:
•tsn (target server name): The name of the SQL Server that you will import to.
•tdn (target database name): The name of the database that you will import to. The database should not already exist.
•sf (source file): The path and file name to import from.


Note

During import, the user name and password are not required because SQL Server will default to Windows authentication for the currently logged on user.

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...