<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Microsoft Dynamics 365 Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/microsoft-dynamics-365/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/microsoft-dynamics-365/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 11 Dec 2025 13:00:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>Microsoft Dynamics 365 Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/microsoft-dynamics-365/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to register App for Dynamics CRM 365 / CDS / Dataverse API (Azure AD / OAuth)</title>
		<link>https://zappysys.com/blog/register-app-dynamics-crm-365-cds-dataverse-api-azure-ad-oauth/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 29 Nov 2021 21:20:53 +0000</pubDate>
				<category><![CDATA[SSIS Dynamics CRM Connection]]></category>
		<category><![CDATA[SSIS Dynamics CRM Destination]]></category>
		<category><![CDATA[SSIS Dynamics CRM Source]]></category>
		<category><![CDATA[d365]]></category>
		<category><![CDATA[dynamics crm]]></category>
		<category><![CDATA[Microsoft Dynamics 365]]></category>
		<category><![CDATA[oauth]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=9444</guid>

					<description><![CDATA[<p>Introduction In this article, we will show you step by step approach on how to register an Azure AD (Active Directory) app to access Dynamics CRM 365 API (also same for CDS / Dataverse API). You might have heard that Microsoft is deprecating an older way of authenticating (i.e. User ID / Password-based WS-Trust Authentication) [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/register-app-dynamics-crm-365-cds-dataverse-api-azure-ad-oauth/">How to register App for Dynamics CRM 365 / CDS / Dataverse API (Azure AD / OAuth)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this article, we will show you step by step approach on how to register an Azure AD (Active Directory) app to access Dynamics CRM 365 API (also same for CDS / Dataverse API). You might have heard that <a href="https://zappysys.zendesk.com/hc/en-us/articles/5258505448347">Microsoft is deprecating</a> an older way of authenticating (i.e. User ID / Password-based <strong>WS-Trust</strong> Authentication) on <strong>April 2022</strong>. You must update your jobs / code to use OAuth 2.0 by April 2022 for any CRM related API calls.</p>
<p>In other words rather than User Id / password now you can use more secure way by using <strong>OAuth</strong> rather than WS-Trust.</p>
<p>Going forward Microsoft wants you to use OAuth Token rather than user name/password to call Dynamics CRM 365 API programmatically.</p>
<p><a href="https://docs.microsoft.com/en-us/power-platform/important-changes-coming#deprecation-of-office365-authentication-type-and-organizationserviceproxy-class-for-connecting-to-dataverse" target="_blank" rel="noopener">Here is the official link which describes the dates for WS-Trust sunset</a></p>
<h2>Register App for CRM / CDS / Dataverse in Azure / Active Directory</h2>
<p>The first step is to register your app in Azure Portal under Active Directory using the below steps.</p>
<ol>
<li>Ask your Active Directory Admin to login to Azure Portal and navigate to &gt; <a href="https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/Overview" target="_blank" rel="noopener"><strong>Active Directory</strong></a> Blade.<br />
OR<br />
You can access it by searching &#8220;<strong>Azure Active directory</strong>&#8221; like below.</p>
<div id="attachment_9445" style="width: 403px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/open-azure-active-directory.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-9445" class="size-full wp-image-9445" src="https://zappysys.com/blog/wp-content/uploads/2021/11/open-azure-active-directory.png" alt="Open Azure Active Directory" width="393" height="224" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/open-azure-active-directory.png 393w, https://zappysys.com/blog/wp-content/uploads/2021/11/open-azure-active-directory-300x171.png 300w" sizes="(max-width: 393px) 100vw, 393px" /></a><p id="caption-attachment-9445" class="wp-caption-text">Open Azure Active Directory</p></div></li>
<li>Now click on the <a href="https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps" target="_blank" rel="noopener"><strong>App Registrations</strong></a> icon and click <strong><strong>New App Registration<br />
</strong></strong></p>
<div id="attachment_9446" style="width: 535px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/open-azure-active-directory-new-app-registration.png"><img decoding="async" aria-describedby="caption-attachment-9446" class="size-full wp-image-9446" src="https://zappysys.com/blog/wp-content/uploads/2021/11/open-azure-active-directory-new-app-registration.png" alt="New App Registrations under Azure Active Directory" width="525" height="275" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/open-azure-active-directory-new-app-registration.png 525w, https://zappysys.com/blog/wp-content/uploads/2021/11/open-azure-active-directory-new-app-registration-300x157.png 300w" sizes="(max-width: 525px) 100vw, 525px" /></a><p id="caption-attachment-9446" class="wp-caption-text">New App Registrations under Azure Active Directory</p></div></li>
<li>Now next step is to give your <strong>App name</strong> to identify easily. Select App is used for your Org only option (Default) and last enter <strong>Redirect URL</strong> as below (This URL is used for 3-legged Authorization Code Grant only). We prefer you enter a URL which is OAuth friendly (If you don&#8217;t know one Use <pre class="crayon-plain-tag">https://zappysys.com/oauth</pre>  this is <strong>recommended</strong> URL if you working with ZappySys Products)
<div id="attachment_9447" style="width: 563px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/register-azure-active-directory-app-with-redirect-url.png"><img decoding="async" aria-describedby="caption-attachment-9447" class="size-full wp-image-9447" src="https://zappysys.com/blog/wp-content/uploads/2021/11/register-azure-active-directory-app-with-redirect-url.png" alt="Azure AD App Registration - Single / Multi Tenant with Redirect URl (i.e. Call back)" width="553" height="708" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/register-azure-active-directory-app-with-redirect-url.png 553w, https://zappysys.com/blog/wp-content/uploads/2021/11/register-azure-active-directory-app-with-redirect-url-234x300.png 234w" sizes="(max-width: 553px) 100vw, 553px" /></a><p id="caption-attachment-9447" class="wp-caption-text">Azure AD App Registration &#8211; Single / Multi-Tenant with Redirect URL (i.e. Call back)</p></div>
<p>&nbsp;</li>
<li>Now once App is created you can find the Application (Client) Id from overview page
<div id="attachment_10130" style="width: 633px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-find-application-client-id-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10130" class="wp-image-10130 size-full" src="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-find-application-client-id-1.png" alt="azure-ad-app-find-application-client-id" width="623" height="360" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-find-application-client-id-1.png 623w, https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-find-application-client-id-1-300x173.png 300w" sizes="(max-width: 623px) 100vw, 623px" /></a><p id="caption-attachment-10130" class="wp-caption-text">Azure AD App &#8211; Find Application / Client Id on overview page</p></div></li>
</ol>
<h2>Add API Permissions for the App</h2>
<p>Once App is created we need to Add Permission. Basically, we will set which style of APIs can be called by this App and what Actions can be performed.<br />
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">For Apps specific to CRM / CDS / Dataverse API, actual app permissions are controlled by User Roles. Check later in this article how to associate one or more Roles to this AD App so it can perform certation actions via API call</div></div>
<ol>
<li>To add API Permissions for this AD App click on <strong>API Permissions</strong> and then click on <strong>Add Permission</strong>
<div id="attachment_9449" style="width: 439px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-add-api-permission.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9449" class="size-full wp-image-9449" src="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-add-api-permission.png" alt="Add API Permissions for Azure AD App" width="429" height="517" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-add-api-permission.png 429w, https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-add-api-permission-249x300.png 249w" sizes="(max-width: 429px) 100vw, 429px" /></a><p id="caption-attachment-9449" class="wp-caption-text">Add API Permissions for Azure AD App</p></div></li>
<li>Find the Dynamics CRM icon and click on it
<div id="attachment_9450" style="width: 669px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/add-azure-ad-app-api-permission-dynamics-crm.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9450" class="size-full wp-image-9450" src="https://zappysys.com/blog/wp-content/uploads/2021/11/add-azure-ad-app-api-permission-dynamics-crm.png" alt="Add API Permission for Dynamics CRM API access (Azure AD App)" width="659" height="709" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/add-azure-ad-app-api-permission-dynamics-crm.png 659w, https://zappysys.com/blog/wp-content/uploads/2021/11/add-azure-ad-app-api-permission-dynamics-crm-279x300.png 279w" sizes="(max-width: 659px) 100vw, 659px" /></a><p id="caption-attachment-9450" class="wp-caption-text">Add API Permission for Dynamics CRM API access (Azure AD App)</p></div></li>
<li>Now you will see just one permission for Dynamics CRM (user_impersonation). As we said earlier for Dynamics CRM API security is controlled by User Roles in CRM Portal itself which will see in the next section. For now, just choose <strong>Delegated Permissions</strong>,  check <strong>user_impersonation</strong> and click <strong>Add Permissions</strong>
<div id="attachment_9451" style="width: 661px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/add-azure-ad-app-api-permission-dynamics-crm-step2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9451" class="size-full wp-image-9451" src="https://zappysys.com/blog/wp-content/uploads/2021/11/add-azure-ad-app-api-permission-dynamics-crm-step2.png" alt="Select API Permissions for Dynamics CRM App (Azure AD App)" width="651" height="608" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/add-azure-ad-app-api-permission-dynamics-crm-step2.png 651w, https://zappysys.com/blog/wp-content/uploads/2021/11/add-azure-ad-app-api-permission-dynamics-crm-step2-300x280.png 300w" sizes="(max-width: 651px) 100vw, 651px" /></a><p id="caption-attachment-9451" class="wp-caption-text">Select API Permissions for Dynamics CRM App (Azure AD App)</p></div></li>
<li>Now the last step in Adding API permissions is Grant Admin Consent. If you are logged in as an Azure AD User with the correct admin role then no worries else you have to ask your Azure AD admin to consent for you so this App can be used to read/write data from CRM.</li>
</ol>
<h2>Create Client Secret</h2>
<p>Once App is created next step is to generate a Client Secret. Perform the following steps to create a secret that you can use when you call API</p>
<ol>
<li>Click on Certificates and Secrets and then New Secret
<div id="attachment_9453" style="width: 1008px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-create-client-secret.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9453" class="size-full wp-image-9453" src="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-create-client-secret.png" alt="Azure AD App Create Client Secret / Set Name, Expiration Date" width="998" height="540" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-create-client-secret.png 998w, https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-create-client-secret-300x162.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-create-client-secret-768x416.png 768w" sizes="(max-width: 998px) 100vw, 998px" /></a><p id="caption-attachment-9453" class="wp-caption-text">Azure AD App Create Client Secret / Set Name, Expiration Date</p></div></li>
<li>Enter Name for Secret (You can give some friendly name if you create multiple secrets to control multiple processes). For example SecretForTesting, SecretForProduction etc.Select a longer expiration date (i.e. 24 months) if you don&#8217;t like to change secret often in production jobs else choose shorter expiration (i.e. 6 Months or Custom).</li>
<li>Once you Create a Secret make sure you copy it to a secure location. Once the page is closed it won&#8217;t appear again.
<div id="attachment_9454" style="width: 639px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-copy-client-secret-after-create.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9454" class="size-full wp-image-9454" src="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-copy-client-secret-after-create.png" alt="Copy Client Secret for Azure AD App" width="629" height="233" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-copy-client-secret-after-create.png 629w, https://zappysys.com/blog/wp-content/uploads/2021/11/azure-ad-app-copy-client-secret-after-create-300x111.png 300w" sizes="(max-width: 629px) 100vw, 629px" /></a><p id="caption-attachment-9454" class="wp-caption-text">Copy Client Secret for Azure AD App</p></div></li>
</ol>
<h2>Associate App User / Set Roles in CRM 365 / Dataverse Environment</h2>
<p>Once we have App Id and Client Secret we can go to CRM Portal to add our App as a valid CRM User. And the last step will be to attach some role(s) to App User (See Next section).</p>
<h3>Method-1 (New way)</h3>
<p>Here are the steps to configure User / Security Roles in New account. Below steps will give you access to Dataverse Entities via API Call. To see all Dataverse Entity you can log in to <a href="https://make.powerapps.com/" target="_blank" rel="noopener">https://make.powerapps.com/</a> and click <strong>Tables</strong></p>
<ol>
<li>Click on the below link to login to new portal to manage CRM /Dataverse environment<br />
<a href="https://admin.powerplatform.microsoft.com/environments" target="_blank" rel="noopener">https://admin.powerplatform.microsoft.com/environments</a></li>
<li>Create an Application User <a href="https://docs.microsoft.com/en-us/power-platform/admin/manage-application-users?WT.mc_id=ppac_inproduct_settings">using these steps</a> (When prompted choose the same App we created in the previous section)</li>
<li>Now Go to App Users Screen and Edit Security Roles using the below steps
<div id="attachment_9579" style="width: 698px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-view-environments.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9579" class="size-full wp-image-9579" src="https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-view-environments.png" alt="See available CRM 365 Online / Datavese Environments" width="688" height="345" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-view-environments.png 688w, https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-view-environments-300x150.png 300w" sizes="(max-width: 688px) 100vw, 688px" /></a><p id="caption-attachment-9579" class="wp-caption-text">See available CRM 365 Online / Datavese Environments</p></div>
<div id="attachment_9580" style="width: 955px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-view-app-users.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9580" class="size-full wp-image-9580" src="https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-view-app-users.png" alt="See available CRM 365 Online / Datavese Application Users" width="945" height="530" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-view-app-users.png 945w, https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-view-app-users-300x168.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-view-app-users-768x431.png 768w" sizes="(max-width: 945px) 100vw, 945px" /></a><p id="caption-attachment-9580" class="wp-caption-text">See available CRM 365 Online / Datavese Application Users</p></div>
<div id="attachment_9581" style="width: 1375px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-select-user-security-roles.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9581" class="size-full wp-image-9581" src="https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-select-user-security-roles.png" alt="Edit Security Roles for CRM 365 Online / Datavese Application Users" width="1365" height="581" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-select-user-security-roles.png 1365w, https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-select-user-security-roles-300x128.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-select-user-security-roles-768x327.png 768w, https://zappysys.com/blog/wp-content/uploads/2021/11/powerplatform-crm-365-online-dataverse-select-user-security-roles-1024x436.png 1024w" sizes="(max-width: 1365px) 100vw, 1365px" /></a><p id="caption-attachment-9581" class="wp-caption-text">Edit Security Roles for CRM 365 Online / Datavese Application Users</p></div></li>
</ol>
<h3>Method-2 (Legacy)</h3>
<p>If you prefer to use an older interface (and it&#8217;s still available to you) then you can use the below steps to perform the same thing we described in the previous section.</p>
<p>NOTE: Microsoft may soon retire the older interface and force to use the previous way only.</p>
<ol>
<li>To Add our Azure AD App as CRM Application user goto your CRM Portal. Click on <strong>Gear icon</strong> for Settings &gt; <strong>Advanced Settings</strong>
<div id="attachment_9456" style="width: 605px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-advanced-settings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9456" class="size-full wp-image-9456" src="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-advanced-settings.png" alt="Dynamics CRM Advanced Settings" width="595" height="344" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-advanced-settings.png 595w, https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-advanced-settings-300x173.png 300w" sizes="(max-width: 595px) 100vw, 595px" /></a><p id="caption-attachment-9456" class="wp-caption-text">Dynamics CRM Advanced Settings</p></div></li>
<li>Click on Settings dropdown &gt; <strong>Security</strong> (Under System Column)
<div id="attachment_9457" style="width: 826px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-advanced-security-settings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9457" class="size-full wp-image-9457" src="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-advanced-security-settings.png" alt="Dynamics CRM Security Settings (Under Advanced Settings - System)" width="816" height="438" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-advanced-security-settings.png 816w, https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-advanced-security-settings-300x161.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-advanced-security-settings-768x412.png 768w" sizes="(max-width: 816px) 100vw, 816px" /></a><p id="caption-attachment-9457" class="wp-caption-text">Dynamics CRM Security Settings (Under Advanced Settings &#8211; System)</p></div></li>
<li>On the security, screen click on the <strong><strong>Users icon<br />
</strong></strong></p>
<div id="attachment_9458" style="width: 396px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-manage-users.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9458" class="size-full wp-image-9458" src="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-manage-users.png" alt="Manage Dynamics CRM Users / Roles (Add, Edit, Delete)" width="386" height="269" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-manage-users.png 386w, https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-manage-users-300x209.png 300w" sizes="(max-width: 386px) 100vw, 386px" /></a><p id="caption-attachment-9458" class="wp-caption-text">Manage Dynamics CRM Users (Add, Edit, Delete)</p></div></li>
<li>Once User Screen shows up click on the User Type <strong>Dropdown</strong> and choose <strong>Application Users</strong> and click <strong>New</strong>
<div id="attachment_9455" style="width: 425px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-365-add-new-application-user.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9455" class="size-full wp-image-9455" src="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-365-add-new-application-user.png" alt="Add new Application User in Dynamics CRM" width="415" height="305" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-365-add-new-application-user.png 415w, https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-365-add-new-application-user-300x220.png 300w" sizes="(max-width: 415px) 100vw, 415px" /></a><p id="caption-attachment-9455" class="wp-caption-text">Add new Application User in Dynamics CRM</p></div></li>
<li>Once User screen shows up. Enter your <strong>Application Id</strong> (obtained from the Azure AD App &gt; Overview screen &#8211; app created earlier). <strong>Click Save</strong> and you will notice all other fields auto populates.
<div id="attachment_10132" style="width: 681px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/create-dynamics-crm-application-user-link-azure-ad-app-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10132" class="wp-image-10132 size-full" src="https://zappysys.com/blog/wp-content/uploads/2021/11/create-dynamics-crm-application-user-link-azure-ad-app-1.png" alt="create-dynamics-crm-application-user-link-azure-ad-app" width="671" height="835" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/create-dynamics-crm-application-user-link-azure-ad-app-1.png 671w, https://zappysys.com/blog/wp-content/uploads/2021/11/create-dynamics-crm-application-user-link-azure-ad-app-1-241x300.png 241w" sizes="(max-width: 671px) 100vw, 671px" /></a><p id="caption-attachment-10132" class="wp-caption-text">Adding Azure AD App as Dynamics CRM 365 &#8211; Application User</p></div></li>
<li>And the last step is to Attach some CRM Role to the new Application User.<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">For demo purposes we will choose &#8220;System Admin&#8221; but for production use, you should grant correct permission carefully. There are many inbuilt roles you can choose from.</div></div>
<div id="attachment_10133" style="width: 893px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-manage-application-user-roles-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10133" class="wp-image-10133 size-full" src="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-manage-application-user-roles-1.png" alt="dynamics-crm-manage-application-user-roles" width="883" height="766" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-manage-application-user-roles-1.png 883w, https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-manage-application-user-roles-1-300x260.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/11/dynamics-crm-manage-application-user-roles-1-768x666.png 768w" sizes="(max-width: 883px) 100vw, 883px" /></a><p id="caption-attachment-10133" class="wp-caption-text">Associate Security Role(s) for Dynamics CRM Application User</p></div></li>
</ol>
<h2></h2>
<h2>Find your Organization Id for CRM / Dataverse API calls</h2>
<p>Now find your Org Id before we can call CRM / Dataverse APIs in the next section.</p>
<p>To find your Org Id you can perform the following steps.</p>
<p><strong>Method-1 (New way &#8211; Dataverse Portal)</strong></p>
<ol>
<li>Go to <a href="https://admin.powerplatform.microsoft.com/" target="_blank" rel="noopener">https://admin.powerplatform.microsoft.com/</a></li>
<li>Click on the Environment you like to access</li>
<li>On the Details, page copy your Org Id from the Environment URL For example URL might look like below&#8230; You just need to copy the first part (Use this on CRM Connection &gt; Organization Field)<br />
<span style="text-decoration: underline;"><strong>org8640f7e7</strong></span>.crm.dynamics.com</p>
<div id="attachment_10134" style="width: 752px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/microsoft-dataverse-crm-api-get-organization-id-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10134" class="wp-image-10134 size-full" src="https://zappysys.com/blog/wp-content/uploads/2021/11/microsoft-dataverse-crm-api-get-organization-id-1.png" alt="microsoft-dataverse-crm-api-get-organization-id" width="742" height="424" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/microsoft-dataverse-crm-api-get-organization-id-1.png 742w, https://zappysys.com/blog/wp-content/uploads/2021/11/microsoft-dataverse-crm-api-get-organization-id-1-300x171.png 300w" sizes="(max-width: 742px) 100vw, 742px" /></a><p id="caption-attachment-10134" class="wp-caption-text">How to find Organization Id for Microsoft Dataverse / CDS / CRM 365 API calls</p></div></li>
</ol>
<p><strong>Method-2 (Old way)</strong></p>
<p>Another way to find your Organization Id is from CRM Portal</p>
<p>If you have multiple environments (i.e. Prod, Sandbox) then each environment might have its own unique URL)</p>
<ol>
<li>To find your API Service URL, Click on <strong>Gear Icon</strong></li>
<li>Choose <strong>Advanced Settings</strong></li>
<li>Click down arrow on <strong>Settings</strong></li>
<li>Click <strong>Customization</strong></li>
<li>Click <strong>Developer Resource</strong> Link</li>
<li>On this page now you can see various URLs. For examples used in this article, we need to get is <strong>Service Root URL</strong> for <strong><strong>Web API</strong></strong>
<div id="attachment_10125" style="width: 730px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10125" class="wp-image-10125 size-large" src="https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1-1024x626.png" alt="dynamics-crm-find-organization-url-soap-web-api" width="720" height="440" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1-1024x626.png 1024w, https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1-300x183.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1-768x469.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1.png 1028w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-10125" class="wp-caption-text">How to Find Organization Id / Web API URL / SOAP API Service URL (Unique Environment Instance URL)</p></div></li>
</ol>
<h2>Using Client ID (i.e. App Id) and Client Secret to Call Dynamics CRM 365 API / CDS / Dataverse</h2>
<p>That&#8217;s it now we are ready to use this App Id and Client Secret to make CRM API calls.</p>
<p>To confirm if it&#8217;s working you can create a Dynamics CRM Connection (using <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> ). Choose OAuth option on <a href="https://zappysys.com/blog/ssis-dynamics-crm-read-import-crm-365-onpremises/" target="_blank" rel="noopener">Dynamics CRM Connection</a></p>
<div id="attachment_9543" style="width: 899px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/11/dyanamics-crm-connection-using-oauth-clientid-connect-dataverse-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9543" class="size-full wp-image-9543" src="https://zappysys.com/blog/wp-content/uploads/2021/11/dyanamics-crm-connection-using-oauth-clientid-connect-dataverse-api.png" alt="Connect to Dynamics CRM / Dataverse / PowerApps API using OAuth (Client ID /Secret)" width="889" height="646" srcset="https://zappysys.com/blog/wp-content/uploads/2021/11/dyanamics-crm-connection-using-oauth-clientid-connect-dataverse-api.png 889w, https://zappysys.com/blog/wp-content/uploads/2021/11/dyanamics-crm-connection-using-oauth-clientid-connect-dataverse-api-300x218.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/11/dyanamics-crm-connection-using-oauth-clientid-connect-dataverse-api-768x558.png 768w" sizes="(max-width: 889px) 100vw, 889px" /></a><p id="caption-attachment-9543" class="wp-caption-text">Connect to Dynamics CRM / Dataverse / PowerApps API using OAuth (Client ID /Secret)</p></div>
<h2>Conclusion</h2>
<p>In this article, we saw how to Register Azure AD App to call various Microsoft APIs (for this article we focused mainly on Dynamics CRM 365 API only)</p>
<p>The post <a href="https://zappysys.com/blog/register-app-dynamics-crm-365-cds-dataverse-api-azure-ad-oauth/">How to register App for Dynamics CRM 365 / CDS / Dataverse API (Azure AD / OAuth)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read Microsoft Dynamics 365 OData API data in SSIS (CRM Web API)</title>
		<link>https://zappysys.com/blog/read-microsoft-dynamics-365-odata-api-data-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 25 May 2019 10:28:13 +0000</pubDate>
				<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[365]]></category>
		<category><![CDATA[CRM 365]]></category>
		<category><![CDATA[dynamics crm]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[Microsoft Dynamics 365]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[oauth2]]></category>
		<category><![CDATA[odata]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7004</guid>

					<description><![CDATA[<p>Introduction In our previous article, we talked about how to read from Dynamics CRM using easy to use SSIS Dynamics CRM Source connector. In this post, you will learn how to use SSIS JSON Source (for REST API) instead of CRM Source. Using SSIS JSON Source you can read virtually any REST API or JSON file data including Dynamics CRM [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-microsoft-dynamics-365-odata-api-data-ssis/">How to read Microsoft Dynamics 365 OData API data in SSIS (CRM Web API)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/dynamics-crm-365-logo-300x300.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-3577 size-thumbnail alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/05/dynamics-crm-365-logo-300x300-150x150.png" alt="" width="150" height="150" /></a>In our previous article, we talked about how to <a href="https://zappysys.com/blog/ssis-dynamics-crm-read-import-crm-365-onpremises/" target="_blank" rel="noopener">read from Dynamics CRM</a> using easy to use <a href="https://zappysys.com/products/ssis-powerpack/ssis-dynamics-crm-source-connector/" target="_blank" rel="noopener">SSIS Dynamics CRM Source connector</a>. In this post, you will learn how to use <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">SSIS JSON Source (for REST API)</a> instead of CRM Source. Using SSIS JSON Source you can read virtually any REST API or JSON file data including Dynamics CRM / Dataverse. For this article, our goal is to learn <strong>How to read Microsoft Dynamics 365 data using Web API (OData API) in SSIS.</strong> We will use drag and drop approach without any coding.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2><strong>Why use Web API (OAuth) for Dynamics 365 CRM?</strong></h2>
<p>Microsoft has announced depreciation of older CRM API (SOAP API with WS-Trust Authentication) which means they are no longer going to support the older style of authentication so no option but to switch to newer authentication / API.</p>
<p>In the older approach (SOAP API with WS-Trust Authentication) you must pass your User Name and Password to authenticate, also if MFA / 2FA (Multi-Factored Auth) is turned on by organization policy you cannot use your user id / password in API call. In new authentication (i.e. OAuth) you have to use Client Id and Client Secret only.</p>
<p>Now let&#8217;s look at the step by step approach to call Dynamics 365 REST API.</p>
<h2>Step-1 : Register Dynamics CRM / Dataverse App obtain App Id / Client Secret</h2>
<p>The very first step to access Microsoft Dynamics CRM 365 API is to obtain Application Id (also referred as Client Id)  and Client Secret. We will use this information later in this article (on OAuth connection UI).</p>
<ol>
<li><a href="https://zappysys.com/blog/register-app-dynamics-crm-365-cds-dataverse-api-azure-ad-oauth/" target="_blank" rel="noopener">Register Dynamics CRM / Dataverse App With Azure</a> and get the credential (App Id, Client Secret).</li>
</ol>
<h2></h2>
<h2>Step-2 : Read Microsoft Dynamics 365 API data in SSIS using JSON Source</h2>
<p>Let&#8217;s start with an example. We use SSIS JSON Source Task to make calls to Microsoft Dynamics 365 API, we will load Dynamics 365 Leads data to SQL Server.</p>
<p>Please refer to this link for more information: <a href="https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/about?view=dynamics-ce-odata-9" target="_blank" rel="noopener">Microsoft Dynamics 365 Web API Reference</a></p>
<h3>Find out API Url for your environment (organization url)</h3>
<p>Once we are done with the creation of the Azure AD app to obtain App Id /Secret out next step is to find out the base API URL for your organization / environment.</p>
<p>If you have multiple environments (i.e. Prod, Sandbox) then each environment might have its own unique URL)</p>
<ol>
<li>To find your API Service URL, Click on <strong>Gear Icon</strong></li>
<li>Choose <strong>Advanced Settings</strong></li>
<li>Click down arrow on <strong>Settings</strong></li>
<li>Click <strong>Customization</strong></li>
<li>Click <strong>Developer Resource</strong> Link</li>
<li>On this page now you can see various URLs. For examples used in this article, we need to get is <strong>Service Root URL</strong> for <strong>Web API</strong></li>
</ol>
<div id="attachment_10125" style="width: 730px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10125" class="wp-image-10125 size-large" src="https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1-1024x626.png" alt="dynamics-crm-find-organization-url-soap-web-api" width="720" height="440" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1-1024x626.png 1024w, https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1-300x183.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1-768x469.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/05/dynamics-crm-find-organization-url-soap-web-api-1.png 1028w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-10125" class="wp-caption-text">How to Find Organization Id / Web API URL / SOAP API Service URL (Unique Environment Instance URL)</p></div>
<p>&nbsp;</p>
<h3>Create SSIS Data Flow to read data from Dynamics CRM / Dataverse</h3>
<ol>
<li>
        First of All, Drag and drop Data Flow Task from SSIS Toolbox and double click it to edit.<img class="yoast-text-mark" /></p>
<p>        <div id="attachment_7934" style="width: 470px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7934" class="wp-image-7934 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-7934" class="wp-caption-text">Drag and Drop SSIS Data Flow Task from SSIS Toolbox</p></div>
    </li>
<li>
        Furthermore, Drag and Drop JSON Source(REST API and File) File Task from the SSIS Toolbox.<img class="yoast-text-mark" /></p>
<p>        <div id="attachment_3766" style="width: 604px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-json-source-for-getting-basic-profile-from-linkedin.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3766" class="size-full wp-image-3766" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-json-source-for-getting-basic-profile-from-linkedin.png" alt="Drag and Drop JSON Source Component" width="594" height="268" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-json-source-for-getting-basic-profile-from-linkedin.png 594w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-json-source-for-getting-basic-profile-from-linkedin-300x135.png 300w" sizes="(max-width: 594px) 100vw, 594px" /></a><p id="caption-attachment-3766" class="wp-caption-text">Drag and Drop JSON Source Component</p></div>
    </li>
</ol>
<h3></h3>
<h3>Create OAuth Connection for Dynamics CRM / Dataverse</h3>
<p>Now lets look at how to create and configure OAuth connection to call Web API for Dynamics CRM / Dataverse</p>
<ol>
<li>
        Check Use Credentials Option and select a new ZS-OAuth Connection from the drop-down.</p>
<p>        <div id="attachment_7689" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-check-use-credentials-select-connection.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7689" class="wp-image-7689 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-check-use-credentials-select-connection-768x593.png" alt="Check Use Credentials " width="720" height="556" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-check-use-credentials-select-connection-768x593.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-check-use-credentials-select-connection-300x232.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-check-use-credentials-select-connection.png 823w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7689" class="wp-caption-text">Check Use Credentials</p></div>
    </li>
<li>
        Once OAuth Connection UI opens up. Configure like below on General Tab.<br />
        Change OAuth Version to <strong>OAuth2</strong><br />
        Change Grant Type to <strong>Client Credentials</strong><br />
        Enter <strong>Client Id</strong> (Azure AD App Id) (Obtained in the Previous Section)<br />
        Enter <strong>Client Secret</strong> (Obtained in the Previous Section)<br />
        Enter <strong>Token URL</strong> (see below)</p>
<div id="attachment_10127" style="width: 616px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/azure-ad-app-oauth-client-credentials-grant-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10127" class="wp-image-10127 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/azure-ad-app-oauth-client-credentials-grant-1.png" alt="azure-ad-app-oauth-client-credentials-grant" width="606" height="351" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/azure-ad-app-oauth-client-credentials-grant-1.png 606w, https://zappysys.com/blog/wp-content/uploads/2019/05/azure-ad-app-oauth-client-credentials-grant-1-300x174.png 300w" sizes="(max-width: 606px) 100vw, 606px" /></a><p id="caption-attachment-10127" class="wp-caption-text">Configure OAuth Connection for Azure AD App &#8211; Client Credentials Grant (Tenant Specific Token EndPoints)</p></div>
<p>        <span style="text-decoration: underline;"><strong>For Client Credentials Grant</strong></span><br />
        Enter Token URL as <strong>https://login.microsoftonline.com/<span style="color: #0000ff;">&lt;your-tenant-id&gt;</span>/oauth2/token</strong><br />
        (You can find Tenant ID on the Overview page of your Azure AD App)</p>
<p>        <span style="text-decoration: underline;"><strong>For Default Grant (3-legged &#8211; requires User Login Prompt)</strong></span><br />
        Enter Auth URL as <strong>https://login.microsoftonline.com/common/oauth2/authorize</strong><br />
        Enter Token  URL as <strong><strong>https://login.microsoftonline.com/common/oauth2/token</strong></strong></p>
<p>        &nbsp;</p>
<div id="attachment_10128" style="width: 858px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/azure-ad-app-token-url-with-tenant-id-oauth-v1-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10128" class="wp-image-10128 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/05/azure-ad-app-token-url-with-tenant-id-oauth-v1-1.png" alt="azure-ad-app-token-url-with-tenant-id-oauth-v1" width="848" height="448" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/azure-ad-app-token-url-with-tenant-id-oauth-v1-1.png 848w, https://zappysys.com/blog/wp-content/uploads/2019/05/azure-ad-app-token-url-with-tenant-id-oauth-v1-1-300x158.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/azure-ad-app-token-url-with-tenant-id-oauth-v1-1-768x406.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/05/azure-ad-app-token-url-with-tenant-id-oauth-v1-1-720x380.png 720w" sizes="(max-width: 848px) 100vw, 848px" /></a><p id="caption-attachment-10128" class="wp-caption-text">Where to find Token Endpoint with Tenant ID in the URL (Azure AD App)</p></div>
<p>        &nbsp;
    </li>
<li>
        Now go to Advanced Tab and configure like belowEnter <strong>Extra Attribute for /auth</strong> as  <pre class="crayon-plain-tag">resource=https://&lt;your-instance-id&gt;.api.&lt;your-crm-region&gt;.dynamics.com</pre>
<p>        <div id="attachment_9471" style="width: 595px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/resource-dyanmics-crm-connection-for-cleint-cred-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9471" class="size-full wp-image-9471" src="https://zappysys.com/blog/wp-content/uploads/2019/05/resource-dyanmics-crm-connection-for-cleint-cred-token.png" alt="Client Credentials Grant for Dynamics CRM / Dataverse - API Access (Azure AD App / OAuth)" width="585" height="254" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/resource-dyanmics-crm-connection-for-cleint-cred-token.png 585w, https://zappysys.com/blog/wp-content/uploads/2019/05/resource-dyanmics-crm-connection-for-cleint-cred-token-300x130.png 300w" sizes="(max-width: 585px) 100vw, 585px" /></a><p id="caption-attachment-9471" class="wp-caption-text">Client Credentials Grant for Dynamics CRM / Dataverse &#8211; API Access (Azure AD App / OAuth)</p></div>
    </li>
<li>Click OK to Save connection.</li>
</ol>
<h3>Get all Accounts, Contacts, and Leads using Dynamics 365 API</h3>
<p>Now let&#8217;s configure API URL from where you like to read data.</p>
<p>For example, if you just use the root URL then it will list all possible entries</p>
<p>Root URL: <pre class="crayon-plain-tag">https://{{organization-uri}}/api/data/v9.1/</pre>
<ol>
<li>Double click on the Component to Edit the Configurations.</li>
<li>Change Data Format to <strong>OData</strong>.</li>
<li>
        In the Web URL Field, you can enter any valid URL for Web API. Please refer to this link of <a href="https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/account?view=dynamics-ce-odata-9" target="_blank" rel="noopener">Dynamics 365 Rest API</a> for more information.<strong>Example Data URLs</strong></p><pre class="crayon-plain-tag">https://{{organization-uri}}/api/data/v9.1/
https://{{organization-uri}}/api/data/v9.1/accounts
https://{{organization-uri}}/api/data/v9.1/contacts
https://{{organization-uri}}/api/data/v9.1/leads</pre><p>
        Here, replace <strong>{{organization-uri}} </strong>in URL to your Microsoft Dynamics 365 site domain name (Example <strong><span style="text-decoration: underline;">zappy6.api.crm.dynamics.com</span></strong> Dynamics 365 URL)<strong>.</strong></p>
<p>        <div id="attachment_7211" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-D365-API-set-url-json-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7211" class="wp-image-7211 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-D365-API-set-url-json-source-768x682.png" alt="Set URL in JSON Source" width="720" height="639" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-D365-API-set-url-json-source-768x682.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-D365-API-set-url-json-source-300x266.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-D365-API-set-url-json-source.png 826w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7211" class="wp-caption-text">Set URL in JSON Source</p></div>
    </li>
</ol>
<h3>Preview / Query Dynamics 365 Data</h3>
<ol>
<li>Now select Array filter as <pre class="crayon-plain-tag">$.value[*]</pre>  (Click <strong>Select Filter</strong> Button &#8211; Choose value node)</li>
<li>
        Click on the Preview button to get the data.</p>
<p>        <div id="attachment_7687" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-json-source-preview-dynamic-crm.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7687" class="wp-image-7687 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-json-source-preview-dynamic-crm-768x631.png" alt="Preview Data" width="720" height="592" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-json-source-preview-dynamic-crm-768x631.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-json-source-preview-dynamic-crm-300x246.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/ssis-json-source-preview-dynamic-crm.png 891w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7687" class="wp-caption-text">Preview Data</p></div>
    </li>
<li>Finally, click OK to save JSON Source settings.</li>
<li>That’s it we are ready to load Dynamics 365 API data to SQL Server.</li>
</ol>
<h3>Load Microsoft Dynamics 365 API data into SQL Server</h3>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>In this post you have seen how to Read Microsoft Dynamics 365 API data in SSIS. We used <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">JSON Source Component</a> to call Dynamics 365 REST API and load data into SQL server. You can <a href="https://zappysys.com/products/ssis-powerpack/">download SSIS PowerPack here</a> to try many other scenarios not discussed in this blog along with 70+ other components.</p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following links for more information about the use of Dynamics 365 REST API with our tools:</p>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">JSON Source</a>, you can also find <a href="https://youtu.be/t4fSghbSZLo" target="_blank" rel="noopener">Tutorial Video</a> here.</li>
<li><strong>Help File:</strong> Documentation of <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=json-source.htm" target="_blank" rel="noopener">SSIS Json Source</a></li>
<li><a href="https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/about?view=dynamics-ce-odata-9" target="_blank" rel="noopener">Microsoft Dynamics CRM Web API Reference</a></li>
<li><a href="https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/entitytypes?view=dynamics-ce-odata-9" target="_blank" rel="noopener">Dynamics 365 Web API EntityType Reference</a></li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/read-microsoft-dynamics-365-odata-api-data-ssis/">How to read Microsoft Dynamics 365 OData API data in SSIS (CRM Web API)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
