Sponsored & Brought to you by
Integrating with Dynamics CRMMichael StephensonAzure Integration MVP
https://twitter.com/michael_stephen
https://www.linkedin.com/in/michaelstephensonuk1
2
Michael Stephenson• Coaching & Consultancy
• Azure Trainer• Cloud Architect• Integration Architect
• Loads of real world Azure projects
• #IntegrationMonday
• Blog - http://microsoftintegration.guru/blog/
• Twitter - @michael_stephen
Agenda• CRM Integration Basics• BizTalk • WCF/REST/API Facade• Bulk Downloads
• Service Bus• Azure Functions• Logic Apps• Flow
6
What about?• On Premise vs Cloud• Azure Active Directory vs Active Directory Federation Services
Connecting to CRMCRM SDK- Connection string- Url
Web API- ADAL + Auth Header- Url
8
• Bearer Token required• Odata endpoint• Great if you like to write lots of javascript code ;-)
CRM Web API
9
• Query Language for CRM• Lets you do cross entity joins • SQL (ish) syntax
Fetch XML & Query Expression
11
Compare?
WCF• Generate WCF Schemas• Security
• Windows – OOB• Azure AD – Custom Behavior
• Message Types• Not strongly typed
• Excellent Articles• http://tinyurl.com/h4axh74• http://tinyurl.com/jq2k74d
Web API• Expected to be future proof• Complex url manipulation• Documentation not mature• Samples overly complex• Difficult to get up and running• JSON support• No swagger• Azure AD custom behavior required -
http://tinyurl.com/zf7spge
12
The key challengeThese are mapping simple data!!!
Reference – Janardhan Bikkahttp://social.technet.microsoft.com/wiki/contents/articles/32258.biztalk-server-2013-r2-integration-with-ms-dynamics-crm-2015.aspx
14
OverviewWhat is it Benefits- Light weight service between BizTalk and
CRM- Can host in IIS or Azure- Encapsulates the complexity around CRM- Supports
- RPC- Push data
- Simplify implementation- Lower maintenance- No nasty messages- No nasty maps
16
OverviewHow do I extract data to produce batch files for legacy systems with Data from CRM
Technical Challenges• CRM Paging – > 5000
records• Transforming data• Work around untyped data
17
Real-world Example- Streamed download of 20,000+ records- Transform to complex fixed length file- Complex mappings- Daily downloads of data for legacy systems
20
Overview Triggers:- Entity Update- Entity Create- Entity Delete- + moreChannels:- SB Messaging- Event Hub- REST- Relay (one way/2 way)
Message:- Execution Context (.net
binary)- XML- JSON
Security- ACS- SAS
22
Real-world Problem
- Digital Portal – 50,000 users- CRM – 2,000 back office users
CRM will be scaled to support 2000 users, what happens when 50,000 portal users start requesting Knowledgebase Articles?
23
Real-world Solution- Digital Portal – 50,000 users- CRM – 2,000 back office users
Portal performance increased by querying data from Azure rather than direct on CRM
Portal can also used advanced search features in Azure Search
25
Overview Azure Functions are great for background tasks
- Reference CRM SDK from NuGet via project.json
- Use normal .net coding
- Scheduled/Triggered/Ondemand
- SaaS Tables (coming soon)
Use Case:Refresh the share price for each company every hour
30
• Easy to get up and running for basic scenario• More complex (real world) has functionality gaps still• Limit of 5000 rows can block you• No upsert operation Logic app gets complicated
Thoughts
36
ExampleEmpower Business user to automate their day
The business user wants alerts based on Share Price
38
• Citizen Integrator will probably need IT help with CRM API’s• OData queries etc
• Lots of opportunities• Would like to restrict their access in Flow• How do I stop business user loading rows to entity?
Thoughts
40
• CRM Workflow Web Hooks• Host listener on Azure App Service• Can I use Logic Apps?
• SSIS • Kingsway 3rd Party Provider
• Data Factory• OData connectivity – might be possible
Other CRM Integration Options
42
• Option Sets
• Lookups & Related Entities• Eg: Turning a system event into a business document
• Paging Queries• Paging token + Page size + Page key
• Status Code & State Code
• Cross System Correlation
What else do I need to think about?
Thank You
Twitter: #integrationmonday Website: http://www.integrationusergroup.com/