Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Issue with Dynamics crm web api code after deployed in Azure

$
0
0

Hi,

I have developed a WCF service using dynamics crm web api and its working locally as expected. however once i have deployed the code in azure as an "App Service" its deplyed successfully and gave me a url like "http://requestservicecloud.azurewebsites.net/service1.svc" While I am trying to consume the service in a console  its failing and throwing below exception. 

"Error HRESULT E_FAIL has been returned from a call to a COM component."

I am not using Web api Helper code in my application.

AuthenticationParameters ap = AuthenticationParameters.CreateFromResourceUrlAsync(new Uri(redirectUrl+ "/api/data")).Result;

string resourceUrl = ap.Resource;
string authorityUrl = ap.Authority;

// Generate the Authority context
AuthenticationContext authContext = new AuthenticationContext(authorityUrl, false);
AuthenticationResult authToken;
try
{
authToken = await authContext.AcquireTokenAsync(resourceUrl, clientId, new Uri(redirectUrl), new PlatformParameters(PromptBehavior.Never));
}
catch (AdalException e)
{
if (e.ErrorCode == "user_interaction_required")
{
authToken = await authContext.AcquireTokenAsync(resourceUrl, clientId, new Uri(redirectUrl), new PlatformParameters(PromptBehavior.Auto));
}
else
{
throw;
}
}


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>