Monday, January 13, 2020

How to Create a Cognitive Services APIs account in the Azure portal | Step by step setup

Steps to Create a Cognitive Services APIs account in the Azure portal4.pngSetting details
Step 1:-  First we need to create an azure account (free of cost|trial of 30 days), which i’m sure you can sign up for from here.
Once you created your account, sign into it from http://portal.azure.com/.
It’ll look somewhat like this:-
1
Step 2:- Click new and search “cognitive services”
2
Click Create
3.png
Step 3:- Select details as below:
Select pricing tier as free(1st one)
Select Resource group as “create new” or select use existing if you already have one and click create.
Step 4:- Once created, it’ll be visible under all resources. Click on it to open it:
5.png
Step 5:- Copy API url and key details of your API
6
7.png
In above 5 steps, your azure cognitive service api setup is completed.
Copied url and accountid/key will be used going forward in creating a connection to azure cognitive service.

Helper Code of Dynamics CRM 365 in C#

Code to connect CRM Organization (C#):


ClientCredentials clientCredentials = new ClientCredentials();

clientCredentials.UserName.UserName = "<Username>";

clientCredentials.UserName.Password = "<Password>";

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

IOrganizationService organizationService = new OrganizationServiceProxy(new Uri("<CRM Organisation Service URL>"),

null, clientCredentials, null);





Thursday, October 10, 2019

Retrieve Cases associated with Contacts and Accounts in one go

I was working on some work and got a requirement to get Cases of linked with Account and Contact. 

In a normal scenario, we can always do two Calls like 


Cases where CustomerID = Account GUID and Cases where CustomerID = Contact GUID


Somehow, I didn't like this approach of making two calls. Spending sometime helped to reduce a call and I was able to retrieve Cases related to Account and Contact in one call.


Here is the FetchXML I have used and uitype plays a major role here.
           


 
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
                                      <entity name='incident'>
                                        <attribute name='title' />
                                        <attribute name='ticketnumber' />
                                        <attribute name='createdon' />
                                        <attribute name='incidentid' />
                                        <attribute name='caseorigincode' />
                                        <order attribute='title' descending='false' />
                                        <filter type='and'>
                                          <condition attribute='customerid' operator='in'>
                                            <value uitype='account'>{ACCOUNT-GUID}</value>
                                            <value uitype='contact'>{Contact-GUID}</value>
                                          </condition>
                                        </filter>
                                     </entity>
                                    </fetch>

Get files of last hour in Azure Data Factory

  Case I have a Data Factory pipeline that should run each hour and collect all new files added to the data lake since the last run. What is...