Recently I created a proof of concept using a WCF behaviour extension to consume services which require authentication against Azure Active Directory. The idea here is that if you want to consume an API and wish to use a service account credential you can configure the service account in Azure AD or alternatively on premise and use Azure AD Connect to synchronise the ID to the cloud. Once your credential is in Azure AD you can configure a native application in Azure AD and provide access to other services for users who have authenticated against your application.
The WCF Behaviour extension I have created uses the ADAL library to authenticate you against Azure AD and then sets the authentication header when calling the API. The below code snippet shows you what the behaviour looks like internally.
In BizTalk you can then configure a send port to send to an API which is secured with Azure AD and you will be able to easily obtain a token to access the service in a very standard BizTalk fashion through send port configuration. Below is an example of the configuration of the behaviour extension on a BizTalk send port.
Download Sample
The sample for this WCF behaviour can be downloaded from the below link:
[…] In this video I have used that sample to show how you can use the Power BI API from BizTalk Server in a very simple way using the Web-HTTP adapter to consume rest services. The original post with the sample WCF behaviour is on the following link: https://mikestephenson.me/2015/11/16/biztalk-wcf-behaviour-extension-for-waad-authentication/ […]
[…] I recently wrote a sample for a WCF behaviour extension to allow you to consume an API in BizTalk if it was secured with Azure Active Directory. […]