-
Notifications
You must be signed in to change notification settings - Fork 652
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
(401) Unauthorized Error While Running KUDU zipdeploy from VSTS #2826
Comments
Likely explanation is that your |
Hi David, Thanks for the response. I am using below code snippets for generating token and it is generating the token perfectly. So still I am not sure what could be the reason for 401
|
As a test, try going to https://$webAppName.scm.azurewebsites.net/basicauth (in a clean Incognito windows), and check that the username & password that you are getting are working when you type them manually in the browser. |
Then next step is to use F12 tools to see exactly what header is being sent in the working case, and compare it to what you send in your non-working case. You can also try to base64 decode each, and see what you end up with. There must be some difference at some level. |
base64 tokens generated in VSTS release step and in-browser header are exactly matching |
And what happens if you use the same PowerShell logic locally? If it repros there, at least you'll have eliminated VSTS from the equation. |
in the local same script works fine. No issues in local. Also, in VSTS if I hardcode all the variable it works there too. But with variables, it doesn't work. Even though the variables have the correct values. |
I can't explain that, but I think at this point it's best to look at this as a VSTS issue rather than a Kudu issue. You can try opening issue on https://github.com/Microsoft/vsts-tasks. |
Hi There,
I am using VSTS Azure Powershell task to deploy my AspNetCore zip package. Below is the REST call
$kuduApiUrl = "https://$webAppName.scm.azurewebsites.net/api/zipdeploy"
where $webAppName is my app service name
Invoke-RestMethod -Uri $kuduApiUrl -Headers @{Authorization = ("Basic {0}" -f $kuduApiAuthorisationToken) } -Method POST -InFile $ZipPackageFile -ContentType "multipart/form-data"
All input data are valid but still, I am getting 401 UnAuthorised error.
Please suggest what could be the reason?
Let me know if you need more info.
The text was updated successfully, but these errors were encountered: