简体   繁体   中英

Getting "The remote server returned an error: (401) Unauthorized." when creating a release in Azure DevOps pipeline

I am getting the following error when I click on "Create Release"

2020-03-16T20:19:34.4515940Z Logging in with a Service Principal
2020-03-16T20:19:34.9209641Z Publishing PowerBI FIle: D:\a\r1\a\_PowerBI\drop\PowerBI, in workspace: contoso with user: 
2020-03-16T20:19:35.0059635Z Getting Power BI Workspace properties; contoso
2020-03-16T20:19:35.6190535Z ##[error]The remote server returned an error: (401) Unauthorized.
2020-03-16T20:19:35.6575457Z ##[section]Finishing: Power BI Action: Publish

I have tried both "User" and "Service Principal" and this error is when I choose "Service Principal"

Thanks

According to the error log, looks like you are using this 3rd-party extension -- Power BI Actions

To configure a Service Principal with PowerBI you will have to go through this guide:Service principal with Power BI

  • ClientId: The client id of the Azure Active Directory application. This application should have the appropriate rights in order to use the Power BI Api.
  • ClientSecret: The client secret of the application
  • Tenant ID: The identifier of the Azure Active Directory tenant

Service principal just work as an impersonation for user in Azure AD. If Service Principal do not have corresponding permission, you need to check it when created.

Here your go: Use portal to create an Azure Active Directory application and service principal that can access resources .

When you have an application that needs to access or modify resources, you must set up an Azure Active Directory (AD) application and assign the required permissions to it. This approach is preferable to running the app under your own credentials because:

  • You can assign permissions to the app identity that are different than your own permissions. Typically, these permissions are restricted to exactly what the app needs to do.
  • You do not have to change the app's credentials if your responsibilities change.
  • You can use a certificate to automate authentication when executing an unattended script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM