3
votes

I am looking to connect to CRM 2013 Online from a WCF webservice hosted on Azure. I have this working correctly on my dev box ( with the WCF service hosted in the Azure compute emulator),and can connect and retrieve data from CRM online with no issues.

To authenticate against CRM online I am passing the organisation, username and password as parameters to the web service method (I know it's not a great idea but this is only a test), and creating the CRMOrganisationService using these - again, this works fine locally.

However when I publish this WCF service to Azure I hit some problems. The service publishes correctly and can be accessed at the cloudapp.net address, however any attempt to call a method which retrieves data results in an exception back from the server about Microsoft.Identity.dll not being found.

In an attempt to resolve this I rdp'd t the cloud service instance and enabled Windows Identity Foundation 3.5 from the ServerManager feature view.

This now results in an exception "The type initializer for 'Microsoft.IdentityModel.Tokens.SecurityTokenHandlerConfiguration' threw an exception."

Any thoughts more than welcome....!

Thanks

Matt

1
I am on it too, but I cant connect to the CRM throught WCF service. how you did it?Bruno Gomes
WIF 3.5 is now deprecated. Make sure you are using the right library, what version of .Net are you targeting?Steve Newton

1 Answers

0
votes

I think your problem could be due to TLS, dynamics crm 9 and towards only accepts TLS 1.2 connections, if your Azure component, guessing for the information in the question could be Cloud Service/WebRole, is possible that you defaul OS is win server 2008, to support .net framewor 3.5, this OS need a patch to support TLS 1.2, you could upgrade the OS is your WebRole (assuming that is cloud service) and upgrade the .net framework a more recent one.

microsoft dynamics crm link

Hope it helps