Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The remote server returned an error: (401) Unauthorized" from Azure DevOps Pipeline #7

Open
souravkar123 opened this issue Jun 17, 2020 · 7 comments

Comments

@souravkar123
Copy link

Powershell script running from Azure DevOps pipeline
PnP Powershell can connect successfully without any issue (see below)
image
image
But when I try to fetch some data from the site, I'm getting error "Get-PnPWeb : The remote server returned an error: (401) Unauthorized" (see below)
image
image

@s-KaiNet
Copy link
Owner

Please follow the setup guide from the home page. You shouldn't install any modules or pacakge providers in your code.

@souravkar123
Copy link
Author

Used PnP-Powershell template.
Even though I'm using the correct values in variables sp_user and sp_password, I'm receiving bad credentials error
image
image
image

@souravkar123
Copy link
Author

image

@s-KaiNet
Copy link
Owner

Do you use MFA? Please also check that these credentials work for you in your regular Powershell code.

@souravkar123
Copy link
Author

The credentials work for me in regular Powershell code.
We use MFA.
LegacyAuthProtocolsEnabled is enabled in the system.
I'm only a site collection admin, I don't have tenant level access or Office 365 Admin level access

@s-KaiNet
Copy link
Owner

Do you use app password?

@souravkar123
Copy link
Author

I don't see the app password option
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants