Total Pageviews

Search This Blog

Showing posts with label Tips and Tricks. Show all posts
Showing posts with label Tips and Tricks. Show all posts

Saturday, October 17, 2020

D365 FO Tips - How To retrieve Tier 2 Sandbox VM Size and other details using Azure REST Metadata API

 Greetings Friends!

Thought to share an interesting find. For a customer of mine, I was trying to find out the VM Size for a Tier-2 Sandbox UAT VM


As you all are aware, Microsoft is slowly restricting and discontinuing direct RDP access to any of your VMs.


However, I still have access to few of my customers UAT VM who went LIVE around in 2016-2017 who were one of the early adopters of AX7


Ok, to get into the details, I used this powershell script within my Sandbox Tier 2 VM. Note, you need to have RDP Access to run this script. This uses Azure Instance Metadata Service described by Microsoft over here - https://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service


"The Azure Instance Metadata Service (IMDS) provides information about currently running virtual machine instances and can be used to manage and configure your virtual machines. This information includes the SKU, storage, network configurations, and upcoming maintenance events"

Now, into action -  

You can log on to your Sandbox VM using the normal useraccount from LCS and then open PS Window and chuck this in:

Invoke-RestMethod -Headers @{"Metadata"="true"} -URI http://169.254.169.254/metadata/instance/compute?api-version=2020-06-01 -Method get

Output:








As you can see from the above output, you get all your details like Resource Name, SubscriptionId, VMSize all these details for a Microsoft managed VM

Another variant of this script below, is a json formatted string as shown next:

Invoke-RestMethod -Headers @{"Metadata"="true"} -Method GET -Uri http://169.254.169.254/metadata/instance?api-version=2020-06-01 | ConvertTo-Json


Now, coming to the most interesting part, Microsoft recommends to deploy cloud hosted VM using D13V2 but i'm wondering why they are using a lower spec VM Family for a Tier-2 Sandbox UAT Environment which is like a critical environment as you do your UAT testing


If you are interested to know the difference of these VM sizes, you can head off to the Azure Compute Price VM link, i just summarized a table for your reference

Tier

VM Family

Cores

Memory

Max Disks

Max IOPS

Temp Storage(GiB)

Tier 2 - UAT

B8ms – General Purpose

8

32

16

4320

64

Tier 1 – Cloud Hosted Dev VM

D13V2- Memory Optimized

8

56

32

32x500

400

So friends, I'm still intrigued as why B8MS and I triple checked in 3 other client environments where in I have still RDP Access to UAT and all of them show the same results


Maybe Microsoft has multiple Tier 2 VMs for UAT and they are doing some kind of load balancing in the background, but still it's interesting to know when the customer purchases the D365 FO Subscription, it's told we get solid VM specs!


Your thoughts, readers?



Friday, May 26, 2017

How to configure ARM(Azure Resource Manager) before deploying your Dynamics 365 for Operations environment

Greetings!
Since August 2016 - Platform 2 Update, for deploying any new Dynamics 365 for Operations environment, configuring ARM is a pre-requisite. Through this article, I want to share my experience and few tips/troubleshooting steps which I had come across while configuring ARM
What is ARM?
ARM (Azure Resource Manager) groups the resources required for your Dynamics 365 for Operations instance in the cloud-based Azure OS.
Resources can be your:
a. Dynamics 365 for Operations Virtual Machines (DEMO, SANDBOX, DEVTEST)
b. Storage Accounts
c. Virtual networks
d. Databases
e. 3rd party Services
Azure Resource Manager enables you to work with the resources in your solution as a group. 
We can use a template for deployment and that template can work for different environments such as testing, staging, and production. 
Let's now talk about how to configure ARM before deploying a new Dynamics 365 for operations environment.
So, once you are in your LCS (LifeCycle Services) page, before deploying your environment, you will need to set up Azure subscription, so click on Microsoft Azure Settings
Once you click on Microsoft Azure Settings, you will see the below page where you need to Authorize the tenant administrator of the organization, access to Dynamics 365 for operations application. For this, you will need to click the Authorize Link under the Organizational list group.

A new window gets opened as shown below where you have to enable Dynamics Deployment Services.
On pressing the Accept button, this grants access for Dynamics Deployment Services into your Azure Active Directory. Go back to the previous page and under Organization list settings and click again on Authorize. Refresh the browser and you will see the Authorization status as Authorization complete, as shown below:
Tip - At times, I have seen you have to click on the Authorize button multiple times to get the status as "Authorization complete"
Go back to Azure Connectors and click - Add
Enter any name and your Azure Subscription ID
Enable Configure to use Azure Resource Manager (ARM) and change the Azure subscription AAD Tenant Domain
Tip - You have to select Dynamics Deployment Services - Contributor and then click on Next button, failing to do so will not perform the validation
For the next step, that is to provide authorization, you will need to either:
a. Download and upload the Management Certificate, OR
b. Go to Access Control Panel (IAM) in your Azure portal and ensure that the tenant which you are using is added as part of contributor role in AAD
For Option a, that is uploading the management certificate, you will need to log into your Classic Azure Portal, to upload the certificate
For Option b, you can do this by launching the New Azure portal and then add the tenant user to the subscription as a Contributor.
Go to More Services > Subscriptions, then select your subscription, and click on Access Control (IAM), then press the (Add) button
Once the above steps are completed, when you go back to your Azure settings page in LCS, Make sure, that ARM enabled is checked for your subscription. Now, you are ready to setup your Azure region and proceed with deploying the environment

Friday, May 19, 2017

Patch up your Dynamics 365 for Operations Servers: Immediate Maintenance required in response to WannaCrypt ransomware

Greetings!
I got half a dozen email since yesterday from Microsoft as I have few Dynamics AX 2012 R3 and few Dynamics 365 for Operations VM running under different subscriptions.
As most of you are aware by now about WannaCrypt virus, Microsoft suggests to patch our Dynamics 365 for Operations VM's at the earliest. Below is an extract of the email form Microsoft
Note: If you do not have any Microsoft Dynamics 365 for Operations or Microsoft Dynamics AX 2012 environments deployed in your own Azure subscriptions, you can ignore this mail.
In response to the recent global WannaCrypt ransomware attack, we recommend all Azure customers that have Dynamics 365 for Operations or Dynamics AX 2012 environments deployed in your own Azure subscriptions, to take the steps called out in the WannaCrypt Attacks: Guidance for Azure Customers blog post. This applies to environments in your subscription like demo and dev environments. Environments managed by Microsoft are already being proactively handled by us. 
Please take the above steps immediately to run a secure infrastructure and to protect your organization from attacks like these today and in the future.
Sincerely, 
The Microsoft Dynamics 365 for Operations service team

Monday, May 15, 2017

How to setup and configure Dynamics 365 for Operations Mobile Workspaces

Greetings!

This is an update to my previous post - https://daxdilip.blogspot.com.au/2017/03/dynamics-365-for-operations-tip-mobile.html, where I shared a workaround on how to view the out of box mobile workspaces from System Administration > Parameters form and publish them.

This workaround is no longer needed as in this post, i will explain the steps on how to achieve the same using standard process:

Overview 

As you are aware, that wiki is being deprecated, and now Microsoft is moving to a new docs site for D365FO help, so keep an eye on Dynamics 365 for Operations Mobile Workspaces as this is the page where Microsoft will publish their upcoming mobile workspaces


At the moment, we have the following workspaces for mobile



Most of the above workspaces are linked to a Hotfix which can be downloaded from LCS

Previously on wiki, We had Inventory on hand and sales order workspaces, but looks like they are not ported to the new Dynamics docs site. 

In this post, I will walk through an example of setting up mobile workspaces for sales order and inventory on hand.

Step 1:

Go to LCS > Project > Issue Search and search for the below KB or just click on this link
KB 4013633



























Step 2

Download KB 4013633 (an X++ update or metadata hotfix). This contains four mobile workspaces for supply chain management. 

Step 3

Once you download the hotfix, extract it to your VM where you want to install the hotfix. Since this is a metadata hotfix, this needs to be treated bit differently, as it can't be installed from Asset Library.


Step 4

Log in to your VM and then use the SCDPBundleInstall command

SCDPBundleInstall.exe -install -packagepath=c:\temp\HotfixPackageBundle.axscdppkg -metadatastorepath= J:\AOSService\PackagesLocalDirectory

Tip - Note in some of the later VM's you will find the SCDPBundleInstall in the Bin directory inside PackagesLocalDirectory i.e. J:\AOSService\PackagesLocalDirectory\Bin







Step 5

Once the bundle installation is successful, next step is to go to Visual Studio and create a deployable package as shown below:












Step 7

Once the deployable package is created, go to Asset Library and add the deployable package in software deployable package Asset type







Step 8

Now, you should be able to go to your environment where you want to apply the deployable package and then click on Apply Updates from maintain environment and select the deployable package and start deploying.















The environment will go into Servicing state and no one will be able to use the environment at this point. This may take 1 to 2 hours to get deployed.

Once the package is deployed, you can now go to System Administration > Parameters > Mobile parameters and pubilsh the default mobile workspaces and start using them

Monday, April 10, 2017

How to get to the LCS Downloadable Tools Page

Quick tip - 

Recently, I was looking to download the security tools from LCS and I was not able to find the downloadable tools under the main menu of LCS

Had to type in the below url to get to the downloads page



Thursday, January 5, 2017

Dynamics 365 for Operations - Troubleshooting HTTP 500 HttpCompileException Error


Dear Friends,

Hope you had a great start to the New Year! :-)

I'm excited and pumped up as I unlearn and learn more about Dynamics 365 for Operations. Recently, on one of my D365 Dev VM, I encountered the below HTTP 500 error after a successful VS Build.

No longer, I was able to browse the url. 

Error:

Troubleshooting:

Initially, I thought it was related to my custom model, so I deleted that from the packages directory, did an iisreset, stopped and started D365 services, SQL Services, restarted the whole box, but no luck.


Event Log Details:

Next, I dig a little bit into the event log, to find more about the errors logged there and i found this below message log - error CS1002 expected;




Next, I opened the cs file in VS and found for some reason the opening brace in Application_PreSendRequestHeaders was commented which was just weird, Don't know how it could have happened. 

Fix was to remove the comment and then save the Global.asax.cs file and that got me back to business.




Happy Operating D 365 :-) Have fun.

Monday, May 30, 2016

Troubleshooting Illegal data conversion from original field synchronization Errors Dynamics AX 2012

Hi All,

Recently, I encountered this synchronization error in AX 2012

Error:

I got this error on opening Customer form after I did a update of my local AX with a copy from UAT AX.

Error:

Illegal data conversion from original field CustTable.ServiceRegionsDN to CustTable.ServiceOrderDN: unable to convert data types to anything but character field type (14 to 49)

Note: ServiceRegionsDN and ServiceOrderDN are custom VAR fields.

Solution:

Note - Please be careful while doing any SQL update from database. I did this in my local sandbox, Not recommended to do it in Production AX.

Check the field id in AOT and compare it with SQLDictionary table in SQL with the following query

select * from sqldictionary where TABLEID in (select TABLEID from sqldictionary where name = 'CustTable')
and name = 'ServiceRegionsDN '

Update SQLDictoniary table with the correct fieldid
update SQLDICTIONARY set fieldid = 60080 where TABLEID in 
(select TABLEID from sqldictionary where name = 'CustTable'
)
and name = 'ServiceRegionsDN '

Reference - https://blogs.msdn.microsoft.com/axsupport/2012/09/19/troubleshooting-aot-synchronization-errors/


Dynamics AX 7 Update 1 Released

Dear All,

Just letting you know Microsoft has released Update 1 for AX 7. You can read more about this release and What's New Over here - https://ax.help.dynamics.com/en/wiki/whats-new-or-changed-in-dynamics-ax-7/

The steps for deploying this update from LCS onto your environments are listed in the release notes over here - https://blogs.msdn.microsoft.com/lcs/2016/05/27/may-2016-release-notes/


Wednesday, January 20, 2016

How to Troubleshoot AOS Crash using Crash and Dump Analysis Tool from LCS

Friends,

This post is about my recent experience on how I went with troubleshooting the frequent AOS Crashes we encountered in one of the client's environment.

Pattern of AX Crash:

We have 4 AOS Servers, 2 of them dedicated to clients and rest of the 2 to share the load for Batches and SSRS Reports.

We had frequent crashes on the 2 AOS's which served the clients. 

How we knew it was a crash ?

Because when the crash happened, all of a sudden both the AOS Services goes into stopped mode - meaning they are no longer running and the users complain they can't connect to AX. It's very frustrating for the users as their application goes down when they are in the middle of something.

Some of the errors seen on the event logs were:

Displaying image005.png






LCS Crash Analysis comes to Rescue:

I came to know there's a cool utility available in LCS known as Crash Dump Analysis. Upon doing some search, I hit upon this interesting blog from MSDN which shows the steps to get started with Crash Analysis

Basically, Crash Dump Analysis is a tool which will help you to evaluate the reason for AOS crash.

The input needed for this tool is a mini dump file which is generated when the AOS crashes. We can think of this similar to a Windows mini dump file which gets generated when Windows OS crashes.

There are many tools available out there to generate the dump file and out of those, I tried WER

WER (Windows Error Reporting) 

WER is built into Windows 2008/2008 R2 can be configured to automatically create and store memory dumps from an AOS crash 

The configuration happens by making some Registry modifications, more concrete creating the following Registry Key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\Ax32Serv.exe
In this new Registry Key several Registry Values have to be added as well (DumpFolder, DumpCount, DumpType, CustomDumpFlags).

Please note: 
Do NOT set the DumpType to 1 or 2, but set the DumpType to 0 and set CustomDumpFlags to 7015 decimal (0x1B67 hexadecimal). Invalid settings will generate dumps without the required information.

Below is a snapshot of how the registry looks after I made the change.










There's another good tool Debug Diagnostic Tool (v2) which can also be used to capture dump files. For more detailed insights, please refer to the instructions in this blog

I chose WER as there is no installation needed. It's just enabling some registry keys and it generates the crash dump file. Once a dmp zip file is generated, it serves as the input to your LCS Crash and Dump analysis tool.













A detailed step by step process to upload the dump file is shown here

Some tips when uploading the dmp file:

a. The dmp file needs to be in a zip format before it gets uploaded for analysis
b. I have observed when uploading large files one needs to keep an eye on the browser connection dropout. I just keep the browser active by clicking on the browser address bar


Once the file is uploaded and the analysis is done, it produces a html report. 

The report came with the following recommendations:

a. Recommended Kernel upgrade to CU9 - High risk (340 days old)
b. Recommended hotfixes to be applied related to AOS Crash
c.  Exception - Memory Access violation

In our case, the main reason for the crash was caused due to a Memory Access Violation and this was due to a custom SSRS report run by an user. We fixed that report and now no longer the crash occurs.

So, to conclude, next time when you come across an AOS Crash, it's highly recommended to try out the LCS Crash analysis tool to get to the root of the problem and fix it. Hope this post helps you in getting used to the Crash Analysis tool.