SlideShare a Scribd company logo
1 of 37
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 112/20/2017 Nelson Johnson Extending CRM with Azure www.broadpoint.net 1
Extending the Dynamics 365
World With Microsoft Azure
By Nelson Johnson
Solution Architect
BroadPoint Technologies
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 2
Target Audience
• Interest in Cloud Architecture
• IT Managers
• Developers
• System Architect
• Azure curious
• On-prem CRM and considering moving to Dynamics 365 (D365)
• Direct integration with SQL
• Dealing with D365 Limitations
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 3
Introduction
Reasons to extend D365 to Azure
High level concepts
Services that fit your needs
Choices in Azure Architecture
Share our Best Practices
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 4
Who is Nelson Johnson?
• Started programming 1977…in high school…on a mainframe
• Became full time software consultant in 1982
• BS in MIS and Decision Science from George Mason University
• Worked at DARPA creating web apps in 1996
• Working with CRM since version 3
• Solution Architect for BroadPoint Technologies, LLC
• Email: njohnson@broadpoint.net
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 5
Why would you want to extend D365 to Azure?
• Inconsistent workload demands
• Consolidate business logic
• Scheduled jobs are not easily managed within D365
• SQL stored procedures are not an option
• Limitations of FetchXML, Rollup fields
• Offload processing
• Plugins, workflows, and API in D365 have a timeout limit of 2 minutes
• Chain of plugins or workflows are getting too long
• Need to create or update a large number of records
• Waiting for external services to respond
• SQL timeout
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 6
Introduction
Reasons to extend D365 to Azure
High level concepts
Services that fit your needs
Choices in Azure Architecture
Share our Best Practices
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 7
Tools for extending to Azure
• Integration
• Endpoint Config in D365
• Service Bus / REST API
• Scheduled Tasks
• Storage
• SQL Server Replication
• Azure Cosmos DB
• Azure Tables
• Compute
• Azure Functions
• Azure Web Jobs
• Azure Service Fabric
• Azure Worker Role
• Logic Apps
• Worker Roles (see Best Practices)
• Service Plan
• Controls CPU, Memory
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 8
What is Service Bus?
• A first-in-first-out message queue
• Separates events from actions
• Enforces decoupled architecture
• Increases options for re-usuable
business logic
• Lock & complete
• High availability
• Scalable
• Nearly free
• Handles failures
Source: https://docs.microsoft.com/en-us/azure/service-bus-
messaging/service-bus-java-how-to-use-topics-subscriptions
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 9
How does D365 integrate with Azure?
Register Step
Create EventServiceBus
Entity
Endpoint Endpoint
ServiceBus
ServiceBus
Manager
Batch
Workflow
Register Step
Create EventServiceBus
Entity
Endpoint
Dues Billing
Workflow
LOB Service
Configure with Plugin
Registration
Create using
Azure UIConfig with CRM Solution Your code
Service Fabric
WebJobs
Functions
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 10
Service Bus vs Webhooks (D365 CE 9)
• Service bus is always up – Web hooks only work when the service
is working
• SB has low latency
• SB can ingest 1000’s of messages per second
• 1000 concurrent connections
• Publish/subscribe supports a decoupled architecture
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 11
How do you connect an entity to the Service bus?
• Plugin Registration Tool – no code needed!
• Endpoint
• Step
DeveloperSidebar
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 12
Introduction
Reasons to extend D365 to Azure
High level concepts
Services that fit your needs
Choices in Azure Architecture
Share our Best Practices
Service Fabric, WebJobs, Functions, Logic Apps
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 13
How low will you go?
Source: https://blogs.technet.microsoft.com/kevinremde/2011/04/03/saas-paas-and-iaas-oh-my-cloudy-april-part-3/
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 14
Azure Compute
• Light – Azure Functions, Logic Apps
• Mid-size – Azure Webjobs
• Heavy – Service Fabric
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 15
Azure Functions
Pros Cons Deployment
Consumption plan – ideal for
intermittent services
Dynamic Scaling
More triggers than WebJobs
Integration with more services
than WebJobs
Complements Azure Logic Apps
Control – what is that?
Up to 10 minute Timeout
unless you pay for a service
plan
Local Dev and Debug
Version Control
Deploy directly from VS
Continuous
Integration/deployment
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 16
Logic Apps
Pros Cons Deployment
Can schedule jobs
Can query and update D365 data
Can interface with Service Bus
Can connect to over 165 other services
Configuration through JSON – no code
Price based on # of executions
“Server-less”
Weekly Updates
No code – anything more than
simple tasks requires a
Function
UI to develop is inside Azure –
not easy to figure out
Documentation is sparse
Programing skill level
Limited triggers:
Min trigger schedule
15 seconds
60 seconds
Version control built in to web UI
Visual Studio – Publish
ARM template deployment
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 17
Azure App Service WebJobs
Pros Cons Deployment
PaaS – Managed VM, High
availability
Multiple apps on single service plan
Easier (than SF) for developer to
start developing apps
Can run continuously or triggered
Scales with App Service plan – setup
manually
You pay for it while it is
deployed
Timeout limit
No remote desktop
Local Dev and Debug
Version Control
Deploy directly from VS
Continuous
Integration/deployment
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 18
Azure Service Fabric
Pros Cons Deployment
Best for Microservices
Control over how workloads
are run
Load-balancing, scaling,
failover, replication, stateful
VM Scale Sets in clusters
Self-hostable
Fault Analysis Service
Learning curve
Code changes will be necessary
to forklift code. Re-architect is
better approach.
Expensive initially because a
production system uses 5 VM’s
- Value increases as you add
more services
No remote debugging
Local Dev and Debug
Deploy directly from VS
PowerShell and CLI
deployment
Deploy many services at one
time
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 19
Wrap up - Which one is best?
• Azure Functions
• Just getting started and want to experiment
• Specialized integration
• Extending Azure Logic Apps
• Azure Logic Apps
• Glue for mashups
• Azure WebJobs
• Already have a website and want to piggy-back on that service plan
• Credit card processing
• Azure Service Fabric
• Re-architecting a legacy environment
• Require high level of control and resilience
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 20
Introduction
Reasons to extend D365 to Azure
High level concepts
Services that fit your needs
Azure Architecture
Share our Best Practices
Microservice
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 21
Design Considerations
• Must read: Azure Architecture Center(https://docs.microsoft.com/en-us/azure/architecture/)
• Application Architecture Guide
• Reference Architectures
• Cloud Design Patterns (32 of them)
• Best Practices
• Performance Antipatterns
• Design Checklists
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 22
Microservice Architecture Design Patterns
Increase the velocity
of application
releases by
decomposing the
application into small
autonomous services
that can be deployed
independently
Source: https://azure.microsoft.com/en-us/blog/design-patterns-for-microservices/
D365
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 23
BASE - Design Patterns for Eventual Consistency
• Use Event Sourcing and CQRS Pattern
• Data Consistency
• Decouple recording the transaction from updating
• Reconciliation between services is easier
• Retry Pattern
• Best for transient faults like timeouts
• Service Bus provides this (to a degree)
• Idempotent methods
• Same result if called multiple times
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 24
Potential for Inconsistent Data
• Two transactions are created
to update the same account
• They both get the starting
balance
• They both are adding a
different amount to the
balance
• Last one “wins”
Competing Updates
Process 1 CRM Process 2
Time
Fetch Current
Balance
Calculate new
Balance
Update Balance
Fetch Current
Balance
Calculate new
Balance
Update Balance
Balance=100
Balance=110
$10 transaction
$20 transaction
Balance=120
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 25
Event Sourcing and CQRS to the rescue!
• Two transactions are created
to update the same account
• They both append their update
to a journal
• They both send a message to
another process to update the
balance
• The balance is calculated
twice, but it is accurate
Decoupled Updates
Process 1 CRM Process 2 Process 3
Time
Write transaction
to journal
Update Balance
Event
Update Balance
Write transaction
to journal
Update Balance
Event
Update Balance
Balance=100
Balance=130
$10 transaction
$20 transaction
Balance=130
Journal=100
Journal=10
Journal=20
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 26
Plan for Failure!
• Compensating
transaction Pattern
• Un-do in reverse order
• Create Exception
entity to manage
resolution
• Provide a view of
exceptions in the
dashboard
• Provide error with
steps to resolve it
Source: https://docs.microsoft.com/en-
us/azure/architecture/patterns/compensating-transaction
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 27
Introduction
Reasons to extend D365 to Azure
High level concepts
Services that fit your needs
Azure Architecture
Share our Best Practices
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 28
Cloud Service Lessons Learned
• “Classic” service – not part of ARM deployments
• It was an easy starting point
• No timeouts or code size limits
• You should employ Async Tasks
• Doesn’t run under CSP license
• Runs all the time like a VM
• No options to use KeyVault
• No options for dynamic configuration of Web.config/App.config
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 29
Best Practices
• Test Location and latency
• Check which datacenter your CRM instances is located
https://<instance>.crm.dynamics.com/home/home_debug.aspx
Server Name First Two Letters Region
BL East US
BN North Central US
BY West US
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 30
Best Practices
• Time Zone
• Integration account in customers timezone
• Work with localized datetime fields using UTC
• Service Plan
• Stress test with the smallest one and work up
• Azure Resource Manager
• Group by Resource (compute, service plan, storage, service bus)
• Tags: Owner, Environment, LoB Function(s), Tier, Project
• Test Driven Development
• Minimize “chatter” using API Transactions, ExecuteMultiple
• Monitor your usage
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 31
Best Practices
• Do not include the Service Endpoints in the D365 Solution file
that gets promoted to production
• Have your subscribing service validate that the message is
coming from the right domain
• SB message has the sending domain – compare it to the D365
connection
• Use one service bus “namespace” per D365 instance
• Configure to use many queues or topics
• Use a non-interactive account in D365
• Reduce license cost
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 32
Use EntityCollection() for Transactions
• EntityCollection()
• Relationship()
• EntityCollection Entities.Add()
• <entity>.RelatedEntities.Add() (early bound)
• Create(<entity>)
DeveloperSidebar
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 33
Transaction code sample
Code Description
Guid duesHeaderId = Guid.NewGuid(); Create a new ID so that we can create a reference in each detail
record
EntityCollection duesHeaderDetailCollection = new
EntityCollection();
Create a collection that will hold all the child records
Relationship duesHeaderDetailRelationship = new
Relationship("bpt_bpt_duesheader_bpt_duesdetail");
Define the relationship that links the entities together
duesHeader.bpt_DuesHeaderId = duesHeaderId; Assign the PK of the header record
duesHeader.bpt_MemberId = Contact.ToEntityReference(); Assign some values to the header - this is the member
Xrm.bpt_duesdetail duesDetail = new Xrm.bpt_duesdetail(); Create an instance of the child entity record
duesDetail.bpt_DuesBillId = new CrmEntityReference(
Xrm.bpt_DuesHeader.EntityLogicalName, duesHeaderId);
Populate the entityreference from the child back to the parent
record
duesHeaderDetailCollection.Entities.Add(duesDetail); Add the child record to the parent
duesHeader.RelatedEntities.Add(duesHeaderDetailRelationship,
duesHeaderDetailCollection);
Complete the relationship by adding the child collection to the
parent entity
service.Create(duesHeader); Call the service to create both records at the same time
DeveloperSidebar
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 34
Resources:
• Platform feature comparison: https://docs.microsoft.com/en-us/azure/app-service/choose-
web-site-cloud-service-vm
• Azure Architecture: https://docs.microsoft.com/en-us/azure/architecture/
• Azure Functions Tools for Visual Studio: https://docs.microsoft.com/en-us/azure/azure-
functions/functions-develop-vs
• Write and test functions locally:
https://blogs.msdn.microsoft.com/webdev/2016/12/01/visual-studio-tools-for-azure-functions/
• Azure Functions forum: https://social.msdn.microsoft.com/Forums/azure/en-
US/home?forum=AzureFunctions&filter=alltypes&sort=firstpostdesc
• Continuous Deployment: https://docs.microsoft.com/en-us/azure/azure-functions/functions-
continuous-deployment
• Subscription Governance: https://docs.microsoft.com/en-us/azure/azure-resource-
manager/resource-manager-subscription-governance
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 35
Resources (cont):
• Design Patterns for Microservices: https://azure.microsoft.com/en-us/blog/design-
patterns-for-microservices/
• WebJobs Extensible Triggers: https://azure.microsoft.com/en-us/blog/extensible-triggers-
and-binders-with-azure-webjobs-sdk-1-1-0-alpha1/
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 36www.broadpoint.net
Q&A
12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 37www.broadpoint.net
Thank You!
Nelson Johnson
njohnson@broadpoint.net
301-634-2442

More Related Content

What's hot

Windows Azure Platform + PHP - Jonathan Wong
Windows Azure Platform + PHP - Jonathan WongWindows Azure Platform + PHP - Jonathan Wong
Windows Azure Platform + PHP - Jonathan WongSpiffy
 
Microsoft Windows Azure - Glympse Retail Gains Productivity & Agility Case Study
Microsoft Windows Azure - Glympse Retail Gains Productivity & Agility Case StudyMicrosoft Windows Azure - Glympse Retail Gains Productivity & Agility Case Study
Microsoft Windows Azure - Glympse Retail Gains Productivity & Agility Case StudyMicrosoft Private Cloud
 
Azure in Developer Perspective
Azure in Developer PerspectiveAzure in Developer Perspective
Azure in Developer Perspectiverizaon
 
Scaling up to 30 m users
Scaling up to 30 m usersScaling up to 30 m users
Scaling up to 30 m usersYoav Avrahami
 
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmapsChris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmapsChris O'Brien
 
NoSQL Migration Technical Pitch Deck
NoSQL Migration Technical Pitch DeckNoSQL Migration Technical Pitch Deck
NoSQL Migration Technical Pitch DeckNicholas Vossburg
 
2014.11.14 Data Opportunities with Azure
2014.11.14 Data Opportunities with Azure2014.11.14 Data Opportunities with Azure
2014.11.14 Data Opportunities with AzureMarco Parenzan
 
DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersYoav Avrahami
 
Patterns for Enterprise Integration Success
Patterns for Enterprise Integration Success Patterns for Enterprise Integration Success
Patterns for Enterprise Integration Success WSO2
 
Scaling wix to over 50 m users
Scaling wix to over 50 m usersScaling wix to over 50 m users
Scaling wix to over 50 m usersYoav Avrahami
 
Scaling wix with microservices architecture jax london-2015
Scaling wix with microservices architecture jax london-2015Scaling wix with microservices architecture jax london-2015
Scaling wix with microservices architecture jax london-2015Aviran Mordo
 
Microsoft Cloud Services Architecture
Microsoft Cloud Services ArchitectureMicrosoft Cloud Services Architecture
Microsoft Cloud Services ArchitectureDavid Chou
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabasesAdi Challa
 
Azure businessoverview daliborkacmar
Azure businessoverview daliborkacmarAzure businessoverview daliborkacmar
Azure businessoverview daliborkacmarKenticoCMS
 

What's hot (19)

Windows Azure Platform + PHP - Jonathan Wong
Windows Azure Platform + PHP - Jonathan WongWindows Azure Platform + PHP - Jonathan Wong
Windows Azure Platform + PHP - Jonathan Wong
 
Jumpstart Azure
Jumpstart AzureJumpstart Azure
Jumpstart Azure
 
Migrating Apps To Azure
Migrating Apps To AzureMigrating Apps To Azure
Migrating Apps To Azure
 
Microsoft Windows Azure - Glympse Retail Gains Productivity & Agility Case Study
Microsoft Windows Azure - Glympse Retail Gains Productivity & Agility Case StudyMicrosoft Windows Azure - Glympse Retail Gains Productivity & Agility Case Study
Microsoft Windows Azure - Glympse Retail Gains Productivity & Agility Case Study
 
Cosmos DB Tech Pitch
Cosmos DB Tech PitchCosmos DB Tech Pitch
Cosmos DB Tech Pitch
 
Azure in Developer Perspective
Azure in Developer PerspectiveAzure in Developer Perspective
Azure in Developer Perspective
 
Scaling up to 30 m users
Scaling up to 30 m usersScaling up to 30 m users
Scaling up to 30 m users
 
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmapsChris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
 
NoSQL Migration Technical Pitch Deck
NoSQL Migration Technical Pitch DeckNoSQL Migration Technical Pitch Deck
NoSQL Migration Technical Pitch Deck
 
Virtual Desktops: Why is this So Hot
Virtual Desktops: Why is this So HotVirtual Desktops: Why is this So Hot
Virtual Desktops: Why is this So Hot
 
2014.11.14 Data Opportunities with Azure
2014.11.14 Data Opportunities with Azure2014.11.14 Data Opportunities with Azure
2014.11.14 Data Opportunities with Azure
 
DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M users
 
Patterns for Enterprise Integration Success
Patterns for Enterprise Integration Success Patterns for Enterprise Integration Success
Patterns for Enterprise Integration Success
 
Scaling wix to over 50 m users
Scaling wix to over 50 m usersScaling wix to over 50 m users
Scaling wix to over 50 m users
 
Scaling wix with microservices architecture jax london-2015
Scaling wix with microservices architecture jax london-2015Scaling wix with microservices architecture jax london-2015
Scaling wix with microservices architecture jax london-2015
 
Microsoft Cloud Services Architecture
Microsoft Cloud Services ArchitectureMicrosoft Cloud Services Architecture
Microsoft Cloud Services Architecture
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
 
Azure businessoverview daliborkacmar
Azure businessoverview daliborkacmarAzure businessoverview daliborkacmar
Azure businessoverview daliborkacmar
 
Redington Value Journal - July 2017
Redington Value Journal - July 2017Redington Value Journal - July 2017
Redington Value Journal - July 2017
 

Similar to Extending D365 with Azure

Designing Microservices
Designing MicroservicesDesigning Microservices
Designing MicroservicesDavid Chou
 
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part20812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2Raul Chong
 
RightScale Webinar: Get Your App To Azure
RightScale Webinar:  Get Your App To AzureRightScale Webinar:  Get Your App To Azure
RightScale Webinar: Get Your App To AzureRightScale
 
Deploy, Scale and Manage your Microsoft Investments with AWS
Deploy, Scale and Manage your Microsoft Investments with AWS Deploy, Scale and Manage your Microsoft Investments with AWS
Deploy, Scale and Manage your Microsoft Investments with AWS Amazon Web Services
 
Deploy, Scale and Manage your Microsoft Investments with AWS
Deploy, Scale and Manage your Microsoft Investments with AWSDeploy, Scale and Manage your Microsoft Investments with AWS
Deploy, Scale and Manage your Microsoft Investments with AWSAmazon Web Services
 
DAS Slides: Data Architect vs. Data Engineer vs. Data Modeler
DAS Slides: Data Architect vs. Data Engineer vs. Data ModelerDAS Slides: Data Architect vs. Data Engineer vs. Data Modeler
DAS Slides: Data Architect vs. Data Engineer vs. Data ModelerDATAVERSITY
 
SPFestDc AZR204 Microsoft Graph and SharePoint Framework under steroids with ...
SPFestDc AZR204 Microsoft Graph and SharePoint Framework under steroids with ...SPFestDc AZR204 Microsoft Graph and SharePoint Framework under steroids with ...
SPFestDc AZR204 Microsoft Graph and SharePoint Framework under steroids with ...Vincent Biret
 
Cloud Native Apps
Cloud Native AppsCloud Native Apps
Cloud Native AppsDavid Chou
 
Final_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdfFinal_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdfMongoDB
 
MongoDB Evening Austin, TX 2017
MongoDB Evening Austin, TX 2017MongoDB Evening Austin, TX 2017
MongoDB Evening Austin, TX 2017MongoDB
 
Get Started with Microsoft Azure.pptx
Get Started with Microsoft Azure.pptxGet Started with Microsoft Azure.pptx
Get Started with Microsoft Azure.pptxAnjaliMishra647628
 
Azure_Business_Opportunity
Azure_Business_OpportunityAzure_Business_Opportunity
Azure_Business_OpportunityNojan Emad
 
Slides: Enterprise Architecture vs. Data Architecture
Slides: Enterprise Architecture vs. Data ArchitectureSlides: Enterprise Architecture vs. Data Architecture
Slides: Enterprise Architecture vs. Data ArchitectureDATAVERSITY
 
Azure businessoverview daliborkacma
Azure businessoverview daliborkacma Azure businessoverview daliborkacma
Azure businessoverview daliborkacma Rateb Abu Hawieleh
 
Cloud Computing101 Azure, updated june 2017
Cloud Computing101 Azure, updated june 2017Cloud Computing101 Azure, updated june 2017
Cloud Computing101 Azure, updated june 2017Fernando Mejía
 
AWS e-Zest Cloud Event 2013 - AWS for Enterprises
AWS e-Zest Cloud Event 2013 - AWS for EnterprisesAWS e-Zest Cloud Event 2013 - AWS for Enterprises
AWS e-Zest Cloud Event 2013 - AWS for Enterprisese-Zest Solutions
 

Similar to Extending D365 with Azure (20)

Designing Microservices
Designing MicroservicesDesigning Microservices
Designing Microservices
 
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part20812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
 
IBM - Introduction to Cloudant
IBM - Introduction to CloudantIBM - Introduction to Cloudant
IBM - Introduction to Cloudant
 
RightScale Webinar: Get Your App To Azure
RightScale Webinar:  Get Your App To AzureRightScale Webinar:  Get Your App To Azure
RightScale Webinar: Get Your App To Azure
 
Deploy, Scale and Manage your Microsoft Investments with AWS
Deploy, Scale and Manage your Microsoft Investments with AWS Deploy, Scale and Manage your Microsoft Investments with AWS
Deploy, Scale and Manage your Microsoft Investments with AWS
 
Deploy, Scale and Manage your Microsoft Investments with AWS
Deploy, Scale and Manage your Microsoft Investments with AWSDeploy, Scale and Manage your Microsoft Investments with AWS
Deploy, Scale and Manage your Microsoft Investments with AWS
 
DAS Slides: Data Architect vs. Data Engineer vs. Data Modeler
DAS Slides: Data Architect vs. Data Engineer vs. Data ModelerDAS Slides: Data Architect vs. Data Engineer vs. Data Modeler
DAS Slides: Data Architect vs. Data Engineer vs. Data Modeler
 
SPFestDc AZR204 Microsoft Graph and SharePoint Framework under steroids with ...
SPFestDc AZR204 Microsoft Graph and SharePoint Framework under steroids with ...SPFestDc AZR204 Microsoft Graph and SharePoint Framework under steroids with ...
SPFestDc AZR204 Microsoft Graph and SharePoint Framework under steroids with ...
 
Cloud Native Apps
Cloud Native AppsCloud Native Apps
Cloud Native Apps
 
Final_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdfFinal_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdf
 
MongoDB Evening Austin, TX 2017
MongoDB Evening Austin, TX 2017MongoDB Evening Austin, TX 2017
MongoDB Evening Austin, TX 2017
 
Get Started with Microsoft Azure.pptx
Get Started with Microsoft Azure.pptxGet Started with Microsoft Azure.pptx
Get Started with Microsoft Azure.pptx
 
Azure_Business_Opportunity
Azure_Business_OpportunityAzure_Business_Opportunity
Azure_Business_Opportunity
 
Slides: Enterprise Architecture vs. Data Architecture
Slides: Enterprise Architecture vs. Data ArchitectureSlides: Enterprise Architecture vs. Data Architecture
Slides: Enterprise Architecture vs. Data Architecture
 
Azure businessoverview (1)
Azure businessoverview  (1)Azure businessoverview  (1)
Azure businessoverview (1)
 
Azure business overview
Azure business overviewAzure business overview
Azure business overview
 
Azure businessoverview daliborkacma
Azure businessoverview daliborkacma Azure businessoverview daliborkacma
Azure businessoverview daliborkacma
 
Cloud Computing101 Azure, updated june 2017
Cloud Computing101 Azure, updated june 2017Cloud Computing101 Azure, updated june 2017
Cloud Computing101 Azure, updated june 2017
 
Exploring sql server 2016
Exploring sql server 2016Exploring sql server 2016
Exploring sql server 2016
 
AWS e-Zest Cloud Event 2013 - AWS for Enterprises
AWS e-Zest Cloud Event 2013 - AWS for EnterprisesAWS e-Zest Cloud Event 2013 - AWS for Enterprises
AWS e-Zest Cloud Event 2013 - AWS for Enterprises
 

Recently uploaded

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 

Recently uploaded (20)

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 

Extending D365 with Azure

  • 1. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 112/20/2017 Nelson Johnson Extending CRM with Azure www.broadpoint.net 1 Extending the Dynamics 365 World With Microsoft Azure By Nelson Johnson Solution Architect BroadPoint Technologies
  • 2. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 2 Target Audience • Interest in Cloud Architecture • IT Managers • Developers • System Architect • Azure curious • On-prem CRM and considering moving to Dynamics 365 (D365) • Direct integration with SQL • Dealing with D365 Limitations
  • 3. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 3 Introduction Reasons to extend D365 to Azure High level concepts Services that fit your needs Choices in Azure Architecture Share our Best Practices
  • 4. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 4 Who is Nelson Johnson? • Started programming 1977…in high school…on a mainframe • Became full time software consultant in 1982 • BS in MIS and Decision Science from George Mason University • Worked at DARPA creating web apps in 1996 • Working with CRM since version 3 • Solution Architect for BroadPoint Technologies, LLC • Email: njohnson@broadpoint.net
  • 5. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 5 Why would you want to extend D365 to Azure? • Inconsistent workload demands • Consolidate business logic • Scheduled jobs are not easily managed within D365 • SQL stored procedures are not an option • Limitations of FetchXML, Rollup fields • Offload processing • Plugins, workflows, and API in D365 have a timeout limit of 2 minutes • Chain of plugins or workflows are getting too long • Need to create or update a large number of records • Waiting for external services to respond • SQL timeout
  • 6. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 6 Introduction Reasons to extend D365 to Azure High level concepts Services that fit your needs Choices in Azure Architecture Share our Best Practices
  • 7. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 7 Tools for extending to Azure • Integration • Endpoint Config in D365 • Service Bus / REST API • Scheduled Tasks • Storage • SQL Server Replication • Azure Cosmos DB • Azure Tables • Compute • Azure Functions • Azure Web Jobs • Azure Service Fabric • Azure Worker Role • Logic Apps • Worker Roles (see Best Practices) • Service Plan • Controls CPU, Memory
  • 8. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 8 What is Service Bus? • A first-in-first-out message queue • Separates events from actions • Enforces decoupled architecture • Increases options for re-usuable business logic • Lock & complete • High availability • Scalable • Nearly free • Handles failures Source: https://docs.microsoft.com/en-us/azure/service-bus- messaging/service-bus-java-how-to-use-topics-subscriptions
  • 9. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 9 How does D365 integrate with Azure? Register Step Create EventServiceBus Entity Endpoint Endpoint ServiceBus ServiceBus Manager Batch Workflow Register Step Create EventServiceBus Entity Endpoint Dues Billing Workflow LOB Service Configure with Plugin Registration Create using Azure UIConfig with CRM Solution Your code Service Fabric WebJobs Functions
  • 10. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 10 Service Bus vs Webhooks (D365 CE 9) • Service bus is always up – Web hooks only work when the service is working • SB has low latency • SB can ingest 1000’s of messages per second • 1000 concurrent connections • Publish/subscribe supports a decoupled architecture
  • 11. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 11 How do you connect an entity to the Service bus? • Plugin Registration Tool – no code needed! • Endpoint • Step DeveloperSidebar
  • 12. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 12 Introduction Reasons to extend D365 to Azure High level concepts Services that fit your needs Choices in Azure Architecture Share our Best Practices Service Fabric, WebJobs, Functions, Logic Apps
  • 13. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 13 How low will you go? Source: https://blogs.technet.microsoft.com/kevinremde/2011/04/03/saas-paas-and-iaas-oh-my-cloudy-april-part-3/
  • 14. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 14 Azure Compute • Light – Azure Functions, Logic Apps • Mid-size – Azure Webjobs • Heavy – Service Fabric
  • 15. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 15 Azure Functions Pros Cons Deployment Consumption plan – ideal for intermittent services Dynamic Scaling More triggers than WebJobs Integration with more services than WebJobs Complements Azure Logic Apps Control – what is that? Up to 10 minute Timeout unless you pay for a service plan Local Dev and Debug Version Control Deploy directly from VS Continuous Integration/deployment
  • 16. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 16 Logic Apps Pros Cons Deployment Can schedule jobs Can query and update D365 data Can interface with Service Bus Can connect to over 165 other services Configuration through JSON – no code Price based on # of executions “Server-less” Weekly Updates No code – anything more than simple tasks requires a Function UI to develop is inside Azure – not easy to figure out Documentation is sparse Programing skill level Limited triggers: Min trigger schedule 15 seconds 60 seconds Version control built in to web UI Visual Studio – Publish ARM template deployment
  • 17. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 17 Azure App Service WebJobs Pros Cons Deployment PaaS – Managed VM, High availability Multiple apps on single service plan Easier (than SF) for developer to start developing apps Can run continuously or triggered Scales with App Service plan – setup manually You pay for it while it is deployed Timeout limit No remote desktop Local Dev and Debug Version Control Deploy directly from VS Continuous Integration/deployment
  • 18. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 18 Azure Service Fabric Pros Cons Deployment Best for Microservices Control over how workloads are run Load-balancing, scaling, failover, replication, stateful VM Scale Sets in clusters Self-hostable Fault Analysis Service Learning curve Code changes will be necessary to forklift code. Re-architect is better approach. Expensive initially because a production system uses 5 VM’s - Value increases as you add more services No remote debugging Local Dev and Debug Deploy directly from VS PowerShell and CLI deployment Deploy many services at one time
  • 19. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 19 Wrap up - Which one is best? • Azure Functions • Just getting started and want to experiment • Specialized integration • Extending Azure Logic Apps • Azure Logic Apps • Glue for mashups • Azure WebJobs • Already have a website and want to piggy-back on that service plan • Credit card processing • Azure Service Fabric • Re-architecting a legacy environment • Require high level of control and resilience
  • 20. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 20 Introduction Reasons to extend D365 to Azure High level concepts Services that fit your needs Azure Architecture Share our Best Practices Microservice
  • 21. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 21 Design Considerations • Must read: Azure Architecture Center(https://docs.microsoft.com/en-us/azure/architecture/) • Application Architecture Guide • Reference Architectures • Cloud Design Patterns (32 of them) • Best Practices • Performance Antipatterns • Design Checklists
  • 22. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 22 Microservice Architecture Design Patterns Increase the velocity of application releases by decomposing the application into small autonomous services that can be deployed independently Source: https://azure.microsoft.com/en-us/blog/design-patterns-for-microservices/ D365
  • 23. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 23 BASE - Design Patterns for Eventual Consistency • Use Event Sourcing and CQRS Pattern • Data Consistency • Decouple recording the transaction from updating • Reconciliation between services is easier • Retry Pattern • Best for transient faults like timeouts • Service Bus provides this (to a degree) • Idempotent methods • Same result if called multiple times
  • 24. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 24 Potential for Inconsistent Data • Two transactions are created to update the same account • They both get the starting balance • They both are adding a different amount to the balance • Last one “wins” Competing Updates Process 1 CRM Process 2 Time Fetch Current Balance Calculate new Balance Update Balance Fetch Current Balance Calculate new Balance Update Balance Balance=100 Balance=110 $10 transaction $20 transaction Balance=120
  • 25. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 25 Event Sourcing and CQRS to the rescue! • Two transactions are created to update the same account • They both append their update to a journal • They both send a message to another process to update the balance • The balance is calculated twice, but it is accurate Decoupled Updates Process 1 CRM Process 2 Process 3 Time Write transaction to journal Update Balance Event Update Balance Write transaction to journal Update Balance Event Update Balance Balance=100 Balance=130 $10 transaction $20 transaction Balance=130 Journal=100 Journal=10 Journal=20
  • 26. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 26 Plan for Failure! • Compensating transaction Pattern • Un-do in reverse order • Create Exception entity to manage resolution • Provide a view of exceptions in the dashboard • Provide error with steps to resolve it Source: https://docs.microsoft.com/en- us/azure/architecture/patterns/compensating-transaction
  • 27. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 27 Introduction Reasons to extend D365 to Azure High level concepts Services that fit your needs Azure Architecture Share our Best Practices
  • 28. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 28 Cloud Service Lessons Learned • “Classic” service – not part of ARM deployments • It was an easy starting point • No timeouts or code size limits • You should employ Async Tasks • Doesn’t run under CSP license • Runs all the time like a VM • No options to use KeyVault • No options for dynamic configuration of Web.config/App.config
  • 29. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 29 Best Practices • Test Location and latency • Check which datacenter your CRM instances is located https://<instance>.crm.dynamics.com/home/home_debug.aspx Server Name First Two Letters Region BL East US BN North Central US BY West US
  • 30. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 30 Best Practices • Time Zone • Integration account in customers timezone • Work with localized datetime fields using UTC • Service Plan • Stress test with the smallest one and work up • Azure Resource Manager • Group by Resource (compute, service plan, storage, service bus) • Tags: Owner, Environment, LoB Function(s), Tier, Project • Test Driven Development • Minimize “chatter” using API Transactions, ExecuteMultiple • Monitor your usage
  • 31. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 31 Best Practices • Do not include the Service Endpoints in the D365 Solution file that gets promoted to production • Have your subscribing service validate that the message is coming from the right domain • SB message has the sending domain – compare it to the D365 connection • Use one service bus “namespace” per D365 instance • Configure to use many queues or topics • Use a non-interactive account in D365 • Reduce license cost
  • 32. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 32 Use EntityCollection() for Transactions • EntityCollection() • Relationship() • EntityCollection Entities.Add() • <entity>.RelatedEntities.Add() (early bound) • Create(<entity>) DeveloperSidebar
  • 33. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 33 Transaction code sample Code Description Guid duesHeaderId = Guid.NewGuid(); Create a new ID so that we can create a reference in each detail record EntityCollection duesHeaderDetailCollection = new EntityCollection(); Create a collection that will hold all the child records Relationship duesHeaderDetailRelationship = new Relationship("bpt_bpt_duesheader_bpt_duesdetail"); Define the relationship that links the entities together duesHeader.bpt_DuesHeaderId = duesHeaderId; Assign the PK of the header record duesHeader.bpt_MemberId = Contact.ToEntityReference(); Assign some values to the header - this is the member Xrm.bpt_duesdetail duesDetail = new Xrm.bpt_duesdetail(); Create an instance of the child entity record duesDetail.bpt_DuesBillId = new CrmEntityReference( Xrm.bpt_DuesHeader.EntityLogicalName, duesHeaderId); Populate the entityreference from the child back to the parent record duesHeaderDetailCollection.Entities.Add(duesDetail); Add the child record to the parent duesHeader.RelatedEntities.Add(duesHeaderDetailRelationship, duesHeaderDetailCollection); Complete the relationship by adding the child collection to the parent entity service.Create(duesHeader); Call the service to create both records at the same time DeveloperSidebar
  • 34. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 34 Resources: • Platform feature comparison: https://docs.microsoft.com/en-us/azure/app-service/choose- web-site-cloud-service-vm • Azure Architecture: https://docs.microsoft.com/en-us/azure/architecture/ • Azure Functions Tools for Visual Studio: https://docs.microsoft.com/en-us/azure/azure- functions/functions-develop-vs • Write and test functions locally: https://blogs.msdn.microsoft.com/webdev/2016/12/01/visual-studio-tools-for-azure-functions/ • Azure Functions forum: https://social.msdn.microsoft.com/Forums/azure/en- US/home?forum=AzureFunctions&filter=alltypes&sort=firstpostdesc • Continuous Deployment: https://docs.microsoft.com/en-us/azure/azure-functions/functions- continuous-deployment • Subscription Governance: https://docs.microsoft.com/en-us/azure/azure-resource- manager/resource-manager-subscription-governance
  • 35. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 35 Resources (cont): • Design Patterns for Microservices: https://azure.microsoft.com/en-us/blog/design- patterns-for-microservices/ • WebJobs Extensible Triggers: https://azure.microsoft.com/en-us/blog/extensible-triggers- and-binders-with-azure-webjobs-sdk-1-1-0-alpha1/
  • 36. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 36www.broadpoint.net Q&A
  • 37. 12/20/2017 Nelson Johnson Extending D365 with Azure www.broadpoint.net 37www.broadpoint.net Thank You! Nelson Johnson njohnson@broadpoint.net 301-634-2442

Editor's Notes

  1. Note: This presentation was developed in October 2017. The services in the cloud are constantly changing.
  2. There are a lot of good reasons for using Azure, such as reliability. Cost should not be the only consideration. Consider the learning curve to maintain apps in house vs in the cloud, and the cost of keeping updates in lock-step with the platform. Inconsistent workload demands – Web Portal with usage spikes or scheduled business process that does not need to run all the time Good for offload batch processing – Asynchronous process to create 20k records, such as monthly billing Use it to consolidate business logic – such as an integration with Microsoft Graph services, machine learning, or handling complex calculations like linear equations for product mix.
  3. When you build extensions to D365, you have many options available to run your code in Azure. These are listed in the Compute column. We will discuss the first 5 of these because they provide a diverse set of features that work for many different applications. But the code does not run itself. Somehow the program you have hosted in Azure must determine when to run and which records in CRM they apply to. This is where we introduce the integration options because they control which programs will run in response to user activity in CRM. The most common integration works through defining an endpoint in D365 that connects to a Service Bus. An optional component to consider when extending your D365 to Azure involves using one of several storage options. Lets start with the Integration part first.
  4. The Service Bus is the most common way to communicate events in D365 out to your Azure programs. Service Bus is a first-in-first-out message queue. It is like a database pipe – messages go in one side and come out the other. When you create a Service Bus Namespace in Azure, it gives you a connection string to connect to it. Your custom code would be the message receiver, and that code must retrieve each message (in effect lock it) run a process based on what is in the message, then mark it as complete. Why would we use it? D365 is super simple to send messages to it, it can queue up 1M messages, and it handles failures for us without writing any logic.
  5. In general, D365 is easily configured to send messages through a Service Bus to trigger your programs in Azure to start running. When an event happens in D365 that we want to trigger some Azure code to process, we have a workflow that creates a record in our custom Service Bus Entity It is configured to push messages into separate queues or topics depending on what the event was. The event message sits in the Service Bus queue until the Service Bus Manager picks it up and calls your Line of Business (LoB) service. LoB Service connects to CRM and performs work Errors are logged for an operator to fix and restart the process
  6. Do you need to use the Service Bus? No. You could use Webhooks if you are using D365 CD 9 or later. Here are some reasons you should use the Service Bus: Consider the scenario when you need to update a back-end service. By using a service bus, you can stop and start the back end service without disrupting the other business processes.
  7. Create a custom entity Register the endpoint Register the step (CRM event message)
  8. How much control do you want? You might need to give up some control to get scalability, quick deployment, security updates Can you reassign your team to higher value tasks?
  9. Which service is right for you? There is a tradeoff between what is quick and easy to code and the need for robust enterprise features. I would categorize the services this way:
  10. “Server-less” just means you don’t own the server. Languages: JavaScript, C#, and F#, and scripting options such as Python, PHP, Bash, Batch, and PowerShell. Triggers on Microsoft Graph Events (Excel Table events, One Drive file events, Outlook), Azure Cosmos DB, Blob storage, Events, HTTP REST or Webhook, Service Bus, and Timer. Integration with: Logic Apps, Storage tables, SQL tables, Twilio, SendGrid, Push Notification Hubs, and Auth Tokens. Complements Azure Logic Apps Run this with service bus topics and subscriptions
  11. Another “Serverless” option Technology that Flow is built on Example: Poll the database every minute for 10 days + execute 500 workflows = $15/10 days Glue between applications Triggers: recurring schedule, on demand, HTTP, API News features released in frequent updates
  12. Easier for a developer to get up to speed PCI, SOC, ISO compliant Triggers: Blobs, Service Bus, Queue, Timer, continuous, custom No remote desktop
  13. Big learning curve. Better choice if you plan to migrate legacy applications away from an enterprise data center Stateful microservice removes the need for queues and caches. Stateful services are high availability and low latency. Auto-scaling built in to clusters. With the Fault Analysis Service, you can induce meaningful faults and run complete test scenarios against your applications
  14. Reference architectures – Network DMZ, Hybrid, Identity Management, Managed web apps Performance Antipatterns – Busy Database, Chatty I/O, Extraneous Fetching (too much data),
  15. Shows some example cloud architecture design patterns. There are over 30 to choose from. The Sidecar pattern is for features like logging, and security that may be part of your framework to provide orthogonal services. Anti-corruption layer deals with exposing views of data from the legacy system in a manner consistent with the new system and allows the legacy system to function without modification. The Strangler is used to direct data requests to specific pieces of functionality that is being incrementally moved form the legacy system to a microservice architecture. Ambassador patterns act as proxy to services to allow control over routing, resiliency, security features, and to avoid any host-related access restrictions.
  16. Your on-premesis systems typically are using a SQL technology that guarantees data consistency, (also called ACID: Atomicity, Consistency, Isolation, Durability) Dynamics 365 lives in the BASE world. Basically Available, Soft state, Eventual consistency means that transactions are distributed and they are eventually updated in the database(s). This means that D365 may not be 100% accurate all the time and you must design processes that will catch inconsistencies and trigger a process to fix it. Event Sourcing is used to keep object state history so that it can be re-evaluated and corrected Command Query Responsibility Separation is used to de-couple the recording of the transaction from an actual update Use Materialized Views design pattern to present the result of the transactions Retry Pattern depends on what the fault is – cant help you if your code is broken.
  17. Example of what could go wrong if you create a system with ACID in mind, but you are really using a BASE system: You start with a known account balance But you end with an incorrect balance What happened? What was the balance before the transactions? If this is milliseconds apart, it would be very hard to tell what is going on. You could use logging, but then someone has to monitor it, and how do you fix it?
  18. By keeping the entire history of changes, we no longer really need the Balance (State) of the account We can completely recalculate the balance, or re-play a series of events (think debugging). We can also see the balance at any point in time. Eventually all accesses to an item will return the last updated value. By pushing updates into a transaction log, process does not have to wait for CRUD operations The cost: storing more data, overall system is more complex because it is many smaller parts, overhead to complete the task is more
  19. For each transaction, keep track of steps taken If the process is not completed, have a process that will walk back through and undo what was done You are effectively creating what you might have done If you have used transactions in SQL Server
  20. None of these reasons should stop you from using it, unless you are selling D365 licenses under a CSP model Microsoft has not been putting any effort into this area – seems like it is going away Our customers only get about 5% of CPU during peak periods, but pay all month for it
  21. Location, location, location – test the latency because it can really cost you
  22. My profile was for East coast time, but customer was in Houston and they saw my changes as having the wrong time. Keeping track of your services using ARM is really important to containing costs - Make a governance policy on who owns what using tags! TDD costs a bit more up front, but really pays for itself after sprint 1
  23. If you include the Service Endpoints in the solution file that you promote from dev to production, you will be connecting the production instance back to the development code The message on the service bus has the domain of the system that created the message. Compare it to the connection string domain to make sure they are the same. You can differentiate which messages belong to which programs by using queues and topics – don’t use multiple service buses In D365, check the “non-interactive” box on the user account you use for integration.
  24. These are the classes you need to combine to into creating a transaction The benefit is to reduce the amount of chatter with the API, and it is an all-or-nothing, which saves you from having to clean up partial transactions
  25. Some key elements are color coded to make it easier to follow where they are initialized and used. This sample is a membership dues Header / Detail A key point – the duesHeaderId is manually assigned in order to build the link between the parent and child record Typically, you would have more than one detail (child) record.