Answered by:
How to Connect to CRM2011 from Worker Role of azure?

Question
-
Hi,
I want to perform Create,Update,Delete operations in CRM 2011 from my custom asp.net web application. I have developed such kind of application using CRM SDK . It works fine . Now i want to host it on Windows Azure server. but when i tried to write same code in my worker role for performing CRUD operation ,It doesn't work (ie. it can not able to establish the connection with crm 2011 onpremise server itself) but when i will write the same code in web role itself it is working fine .Actually i have also tried to do the same in windows service which is just similar to the worker role but in that it also works fine.
Please Tell me, where i am making mistake ?? actually i want to do those operation from worker role when it receives the message from web role.
Is it require to perform some extra changes in worker role??please help me
Thanks in advance,
shekhar
Wednesday, May 16, 2012 12:22 PM
Answers
-
Since your CRM2011 server is running on-premise you'll need to make sure that your worker role can connect to your CRM2011 server.
Did you open the required ports on your firewall? Did you configure your authentication information (like username password and domain)?
You might want to consider using AppFabric Service Bus Relay, allowing you to connect your worker role to your CRM 2011 deployment through a WCF Service. The WCF Service will be running on-premise next to your CRM server but will be exposed to the cloud.
http://www.windowsazure.com/en-us/develop/net/how-to-guides/service-bus-relay/
Sandrino Di Mattia | Twitter: http://twitter.com/sandrinodm | Azure Blog: http://fabriccontroller.net/blog | Blog: http://sandrinodimattia.net/blog
- Proposed as answer by Arwind - MSFT Thursday, May 17, 2012 2:52 AM
- Marked as answer by Arwind - MSFT Tuesday, May 22, 2012 3:50 AM
Wednesday, May 16, 2012 12:53 PM -
Hi,
As Worker role does not include IIS, the error you got means the Worker role can not access service Metadata success, try to change Http to TCP and have a try. For Http, you need create a ServiceHost with the specifical bindings.
Hope this helps.
Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework
- Marked as answer by Arwind - MSFT Tuesday, May 22, 2012 3:50 AM
Friday, May 18, 2012 3:53 AM
All replies
-
Since your CRM2011 server is running on-premise you'll need to make sure that your worker role can connect to your CRM2011 server.
Did you open the required ports on your firewall? Did you configure your authentication information (like username password and domain)?
You might want to consider using AppFabric Service Bus Relay, allowing you to connect your worker role to your CRM 2011 deployment through a WCF Service. The WCF Service will be running on-premise next to your CRM server but will be exposed to the cloud.
http://www.windowsazure.com/en-us/develop/net/how-to-guides/service-bus-relay/
Sandrino Di Mattia | Twitter: http://twitter.com/sandrinodm | Azure Blog: http://fabriccontroller.net/blog | Blog: http://sandrinodimattia.net/blog
- Proposed as answer by Arwind - MSFT Thursday, May 17, 2012 2:52 AM
- Marked as answer by Arwind - MSFT Tuesday, May 22, 2012 3:50 AM
Wednesday, May 16, 2012 12:53 PM -
Hi Sandrino ,
Just i wanted to know that , When i put the code of fetching the data of CRM 2011 on-premise in my web-role it works fine ,but when i will put the same code in my worker role, it doesn't works anymore ( ie. It throws the error like "Metadata contains a reference that cannot be resolved"). Please tell me why this is happening ??
Thursday, May 17, 2012 12:27 PM -
Hi,
As Worker role does not include IIS, the error you got means the Worker role can not access service Metadata success, try to change Http to TCP and have a try. For Http, you need create a ServiceHost with the specifical bindings.
Hope this helps.
Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework
- Marked as answer by Arwind - MSFT Tuesday, May 22, 2012 3:50 AM
Friday, May 18, 2012 3:53 AM -
Hi Arwind,
Can you please explain How to bind WCF service from HTTP to TCP ? How to use TCP service in my source code? please provide any sample code if you have any.please help me
Tuesday, May 22, 2012 9:00 AM -
Hi Arwind,
I have also tried to create a ServiceHost with the specifical bindings by refering the forum on the link "http://www.develop.com/wcfservices". but still no luck .Please tell me any other possible way if available. please help me.
Tuesday, May 22, 2012 12:07 PM -
For ServiceBus sample, please check this link (include TCP, HTTP, Sb):
http://servicebus.codeplex.com/About your exception, do you ever receive any exceptions message? If so, would you like to share them?
Wednesday, May 23, 2012 3:12 AM -
Hi shekhar,
Were you able to resolve this issue? Is your CRM internet facing ?
My CRM 2011 is on-premises and not internet facing so I am using Azure connect to establish a connection between the webrole and the crm machine.
but i am getting this error:
Metadata contains a reference that cannot be resolved: 'http://crm2011/Cloud/XRMServices/2011/Organization.svc?wsdl'
Wednesday, September 5, 2012 1:43 AM