Unable to Login to Dynamics CRM - WebJobs RRS feed

  • Question

  • Hi

    I have below piece of code in my <g class="gr_ gr_13 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="13" id="13">Webjob</g> for authentication. The code works fine if I run it from Vs2015 or run the console application from Command Prompt. when I host it as a WebJon in Azure then it throws <g class="gr_ gr_29 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="29" id="29">error</g>:

    "Unable to Login to Dynamics CRM".

    My Office 365 is Federated with AD. Any thoughts?

    Source Code: 

     CrmServiceClient crmConn = new CrmServiceClient("USER@Company.com.au",CrmServiceClient.MakeSecureString("pass@word1"), "Oceania","orgUniquename",useUniqueInstance: false, useSsl:true, orgDetail:null, isOffice365: true);
                Console.WriteLine("Connected Org Name:{0}", crmConn.ConnectedOrgFriendlyName);
                if (crmConn.IsReady)
                    Console.WriteLine("Connection is successfully.");
                    Console.WriteLine("Error:{0}", crmConn.LastCrmError);
                    Console.WriteLine("Error:{0}", crmConn.LastCrmException);


    • Edited by myCRMGuy Tuesday, May 16, 2017 5:26 AM spelling
    Tuesday, May 16, 2017 4:19 AM