Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Power Platform Build Tools Authentication with Service Principal failed

(0) ShareShare
ReportReport
Posted on by 5

Hi Team,

 

I'm having trouble to use the Service Account connection using the Power Platform Build tools to connect to my instance.  I'm using the Service Account credentials and the App has been successfully registered in the AAD and verified using Postman with the correct permissions as an Application User with the role of Admin on the instance.  I am using Authentication type with the option of Service Principal/client secret.

 

Attached is the DevOps step that failed.

 

Thanks in advance.

 

Regards,

Kengie

  • Kengie Profile Picture
    5 on at
    Re: Power Platform Build Tools Authentication with Service Principal failed

    I have download and execute the https://github.com/davidjenni/D365-OrgServiceSample and attached the logs for your review.

     

    The error i'm getting from the Sample App is:

    Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Invalid Login Information : The HTTP request was forbidden with client authentication scheme 'Anonymous'. Source : mscorlib Method : HandleReturnMessage Date : 11/12/2020 Time : 11:16:45 AM Error : The HTTP request was forbidden with client authentication scheme 'Anonymous'. Stack Trace : Server stack trace: at System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest request, HttpWebResponse response, WebException responseException, HttpChannelFactory`1 factory) at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory`1 factory, WebException responseException, ChannelBinding channelBinding) at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.Xrm.Sdk.IOrganizationService.Execute(OrganizationRequest request) at Microsoft.Xrm.Sdk.WebServiceClient.WebProxyClient`1.ExecuteAction[TResult](Func`1 action) at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.RefreshInstanceDetails(IOrganizationService crmService, Uri uriOfInstance) at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.DoDirectLogin(Boolean IsOnPrem) at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.InitCRM2011Service()

     

    The only changes I made in the sample is my client id and the tentat id.

     

    Thanks for taking a look.

  • David Jenni Profile Picture
    Microsoft Employee on at
    Re: Power Platform Build Tools Authentication with Service Principal failed

    I can't make sense of the AAD error you're seeing, the puzzling part is why the ADAL lib is falling back to anonymous authN?
    Please try to repro with this simple console app (it can authenticate with either username/password but also with appID/clientSecret. It also writes out a more detailed CrmServiceClient & ADAL log. Please try to repro with your PP environment and your credentials, ideally both locally on your dev environment and in a Azure DevOps pipeline (I'll try to add a sample pipeline to that repo below later today):

     

    Simple console app to connect to CDS:

    https://github.com/davidjenni/D365-OrgServiceSample

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard