data factory linked services common data services - dynamics-crm

i am trying to connect to the common data services by using my Office 365 account and it is not successful. here is the error:
Unable to Login to Dynamics CRM: Invalid Login Information : An
unsecured or incorrectly secured fault was received from the other
party. See the inner FaultException for the fault code and detail. An
unsecured or incorrectly secured fault was received from the other
party. See the inner FaultException for the fault code and detail. =>
Authentication FailureUnable to Login to Dynamics CRM Unable to Login
to Dynamics CRM The creator of this fault did not specify a Reason.
I can use Power BI common data services connection and successfully connect to the model and pick the entities however it is not successful in data factory!
I have googled thew error and as you can guess there might be whole range of issues but mostly talking about the time difference. I tried to use the on-Prem Runtime to see if it makes any difference but still no hope.
PS: My server is "crm6.dynamics.com"

did you try visiting home.dynamics.com and from there on choose custom app. This shall land you on Dynamics. Also can you visit admin.powerplatform.com and see there atleast 2 env, One as default and other as your CRM. Remember default is not your crm.

Related

Hosting Microsoft Teams App Messaging Endpoint

I've been following Microsoft's Teams C# tutorials found here, and have been successful for the most part. However, I cannot seem to get my app to work when I host the messaging endpoint myself rather than via their Azure service, which is not an option for me ultimately as the pricing is outrageous for what we need it to do.
I'm hosting the endpoint myself by publishing the sample project and ensuring it's externally available via HTTPS. I can access a custom tab within Teams, so I know that it's online, it's just the messaging endpoint that seems to fail with an "unable to reach app" error when I try and use the messaging extension via a chat window.
When debugging using dev tools, I get 502 error: Bot returned unsuccessful status code Forbidden, error code 1008. Every potential solution I've seen for similar issues hasn't worked for me thus far, though I still feel like it's something incredibly obvious. Are there special steps that need taking when hosting the endpoint yourself? The docs do a very lousy job of explaining the process, probably because Microsoft want you to pay to host the app on Azure.
This is usually caused by the app id / app key not being registered or used correctly in your app, so it's not authenticating to the bot framework service properly. Where/how you do that depends a bit on what sample code / project template you started with, but it's usually somewhere in a .config file (or previously in a .bot file).
The information that you need will be in:
App Id: The Bot Settings page in Azure
App Key: from the Bot settings page, where you got the AppId above, it links to the App registration itself - within there you'll find the section on keys, and you can create a new key (if you've lost the original one)
I know it's generally an error when AppID validation fails. The bot app requests Azure AD to verify the identity.Could your web server access to Azure AD? If you deny to access to outbound with firewall, you should allow Azure IP range.
Turns out it was purely a network issue, that as of yet we still haven't actually figured out. But we tried hosting the app elsewhere and it was fine. That's my recommendation if anyone else has the same problem!

Exchange 2016 / Non hybrid environment & MS Graph

I´m trying to get data from On-Prem Exchange Server (2016, with latest version) using MS Graph API in a non-hybrid environment.
I´ve registered the application in Azure AD, using application permissions and granted the admin consent already. After performing a http get operation it will give the following error:
Error authenticating with resource
After some research throughout the web I´ve found this article https://www.signorellidenis.com/en/graph-authenticationerror-trying-to-get-the-exchange-server-on-premises/
It seems that on Exchange side there is a missing authentication provider, so that all requests aren´t even forwarded from MS Graph to Exchange.
My questions are:
Does it work to perform requests to Exchange via MS Graph in a non-hybrid environment? There are no information in the official documentation about this issue.
Does it work without an authentication provider? Is there another way to perform requests in the environment? Or is the hybrid authentication necessary to do this?
Thank you very much in advance for any hints on this issue!
Just get a confirmation from Microsoft Support that It's not supported to make requests to pure on-premise Exchange 2016 via MS Graph.
MS Graph is designed for O365 cloud data. There is no permission to access on-premise resources.
In a hybrid environment, we can say that we use MS Graph as the interface to require the data. But it still most likely uses EWS to request data from on-premise.
The only way to access data from on-prem Exchange 2016 currently is hybrid deployments. See this document.

CRM 2016, OAuth and OData API

I have an on-premise CRM 2016 system that uses Active Directory and when I attempt to access the OData API from a desktop app, using network credentials, I get an un-authorised message.
After looking into this it would appear that I need to authenticate using OAuth which in turn would require installing AD Federation Services.
Before going down this path I would like to know if this is the correct approach to take?
I've been able to find plenty of examples on how to acheieve this using CRM online/Azure AD, but not much for on-premise 2016.
If your desktop app built on .NET framework and runs in the same local network as your CRM server then you can use XRM Tooling SDK instead.
https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/dn689057%28v%3dcrm.8%29
This SDK lets you create a CrmServiceClient object using a connection string from your configuration file. This object implements the IOrganization interface which means it has the CRUD methods you can use against your CRM.
CrmServiceClient service = new CrmServiceClient(ConfigurationManager.ConnectionStrings["mycrmconnstr"].ConnectionString);
Yes, that's the way to make it work with CRM On-Premise.
You will have to install and configure ADFS (according to documentation ADFS 3.0 is the latest version supported). Once everything is set up, the overall process is quite similar to when you're doing it in Online with AAD:
Register application
Add-AdfsClient -ClientId <CLIENT_ID> -Name <APP_NAME> -RedirectUri <REDIRECT_URI>
Grant application permission to CRM
Grant-AdfsApplicationPermission -ClientRoleIdentifier <CLIENT_ID> -ServerRoleIdentifier <CRM_URI>
Connect using Authorization Code Grant
Authorization Code is the only flow implemented in ADFS 3.0 (that's why I mentioned it before) so don't waste 4 o 5 hours trying to use Implicit like I did :(. ADFS 4.0 implements it (along with Client Credential and Resource Owner Password Credentials but in theory is not supported (although I've seen it working).
As you said the process is not well documented but you'll find some questions on forums or some blog post that will help you. I found THIS one very helpful, even though is not Dynamics related.

How to setup Azure web service for Dynamics 365

Good morning everyone,
My apologies if this post is too similar to this post:
Dynamics 365 and Azure integration
but I am struggling to understand exactly what is needed in order to setup a web service on an Azure server that is consumable by a Dynamics 365 plugin. Based on my research it appears that it goes as follows but I would like to see if any knows of a better guide.
1.) Construct the web service as normal on the Azure Windows Server.
2.) Register a proper DNS Domain name (friendly-name) and route it to the Azure server.
3.) Secure that Azure server/URL with a certificate.
4.) Call the web service from my C# Dynamics 365 plugin.
Is that everything or might I be missing something critical? Thank you!
4 might be an issue, given you want to use certificate based security, not sure that will work, you might need to use another mechanism, e.g. basic user name and password. Otherwise looks okay.
Plug-in isolation, trusts, and statistics
Web access
Sandboxed plug-ins and custom workflow activities can access the
network through the HTTP and HTTPS protocols. This capability provides
support for accessing popular web resources like social sites, news
feeds, web services, and more. The following web access restrictions
apply to this sandbox capability.
Only the HTTP and HTTPS protocols are allowed.
Access to localhost (loopback) is not permitted.
IP addresses cannot be used. You must use a named web address that requires DNS name resolution.
Anonymous authentication is supported and recommended. There is no provision for prompting the logged on user for credentials or saving
those credentials.

code : 5001 message : "An internal error has occurred." name : "Internal Error" when calling getAccessTokenAsync

code:5001
message:"An internal error has occurred."
name:"Internal Error"
I get this error when I call getAccessTokenAsync in my outlook addin. In desktop version I get a another error with code:13003. With the AttachemntDemo sample I get the same errors.
You are most likely using an on-premises Exchange Server with a local Domain Account.
From the documentation:
13003
User Type not supported. The user isn't signed into Office with a valid Microsoft Account or Work or School account. This may happen if Office runs with an on-premises domain account, for example. Your code should ask the user to sign in to Office.
Also confirm that your server meets these requirements:
If the user is connected to Office 365 or Outlook.com, mail server requirements are all taken care of already. However, for users connected to on-premises installations of Exchange Server, the following requirements apply.+
The server must be Exchange 2013 or later.
Exchange Web Services (EWS) must be enabled and must be exposed to the internet. Many add-ins require EWS to function properly.
The server must have a valid authentication certificate in order for the server to issue valid identity tokens. New installations of Exchange server include a default authentication certificate. For more information, see Digital certificates and encryption in Exchange 2016 and Set-AuthConfig.
In order to access add-ins from the Office Store, the client access servers must be able to communicate with https://store.office.com.
:
Try to inspect the network traffic and see the actual request - there is more information about the error as this function is just a wrapper around the network request and does not give enough information.
I was receiving the same error and when checked the network request - discovered that I have to add one more application as a Pre-authorized application.

Resources