Finding your Azure Tenant Id

If you’re connecting with the Dynamics Web API in a Function or Service, you need to know your Azure Tenant Id.  If you don’t have a custom domain, this is relatively simple, but if you do have a custom domain, it can be slightly obscured and/or completely hidden from what you are doing.

To find you Tenant Id, simply go to the Azure Active Directory, scroll down to Custom Domains and look for the domain that looks something like xxxxxxxx.onmicrosoft.com.

aad.PNG

That will be thetenant id that you will want to connect with, not your custom domain name.

Read More


Debugging Azure Functions Locally

If you’re storing configuration keys in Azure Functions, there is this really cool facility called Application Settings where you can create all these keys and access them when your function runs.

HOWEVER, when running your Azure Function locally, these keys do not automatically download and you need to add them into your local.settings.json file for them to be consumed.

After you have done this, next you need to make sure that this file is set to “Copy if newer” because if it isn’t you’ll never get to consume those values.

I ran into the above very innocently by trying to troubleshoot the granddaddy of all problems – why my AzureWebJobsStorage parameter was empty and I was not able to download what I needed from my Azure portal into it.

Amateur Tip: If this value

Read More


Database Errors on Restore into v9

If you’re getting ready to perform an on-premise update by importing new organizations into your existing tenant you might start to get some cryptic database errors on constraints.

The constraints themselves vary, mine was in reference to cndx_PrimaryKey_DiscountType, others I’ve seen were in relation to opportunities.

Whatever the error, you will need to install the 0.3 update to address and fix the issue so you can import the tenant.

When you install the server, this update is not applied by “Getting updates”.

The link to the patch is located here – https://support.microsoft.com/en-us/help/4490599/service-update-0-3-for-microsoft-dynamics-365-9-0 – once done, your upgrade and import will succeed.

Read More


Keys to Architecture Diagramming

I’m not a big fan on spending an inordinate amount of time on diagramming solutions or concepts down to the nth detail primarily because that level of detail will always, always, always change and you will be left with outdated diagrams that when someone goes to look at what they are will be confused.

I am a big fan of drawing out ideas on the whiteboard though (big fan) and do realize that these diagrams have their place in getting people on board to adopt a solution.

Hence, keys to putting together an Architecture Diagram that people will get behind.

  1. Make it Simple – if your diagram is overly complex with icons all over the place, simplify it, break it into multiple diagrams.  If you can’t understand it and describe what is going

    Read More


Understanding SQL Grouping and Date Formats

No matter how many times you do it, you always find yourself having to go back and look up silly information on how to do things in something you haven’t done in awhile.

Case in point, I had to do some SQL magic on some data and had completely forgotten how to do proper groupings and summation of data by weeks and months – so here it is for all your future references.

Retrieving Results for a Month

This is easier than doing things by week and is easily done by using a derived table to get an initial result set and then using the outer query to present everything nicely.

 SELECT MONTH, COUNT(TOTAL) AS TOTAL, FORMAT(SUM(TOTAL),'C') AS SUM
FROM (
SELECT FORMAT(DO.SomeDateField,'MMM') + '-' + CAST(FORMAT(DATEADD(YEAR, 1, DA.SomeDateField), 'yy') AS VARCHAR(40)) AS MONTH,
MONTH(DA.SomeDateField) AS CALENDAR_MONTH_ORDER,
CAST(YEAR(DA.SomeDateField)															

Read More