Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

IOrganizationService service is null in Azure web app

Posted on by

Hi,

I've been using the simplified connection of Microsoft.Xrm.Tooling.Connector.dll to connect a web app to D365. This works locally, but it doesn't work when is published to an Azure web app, IOrganizationService service is null.

Any step I'm missing of this not working in Azure?

CrmServiceClient conn = new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(connectionString);

// Cast the proxy client to the IOrganizationService interface.
IOrganizationService service = (IOrganizationService)conn.OrganizationWebProxyClient != null ?
(IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;

// Create the ServiceContext object that will generate
// the IQueryable collections for LINQ calls.
XrmServiceContext svcContext = new XrmServiceContext(service);

<add name="CRMOnline" connectionString="Url=https://l.crm4.dynamics.com; Username=crm@onmicrosoft.com; Password=HU; authtype=Office365" />


*This post is locked for comments

  • Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,397 on at
    RE: IOrganizationService service is null in Azure web app

    Hi

    Looks correct.

    would you please let me know the connection string, you are using.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans