I downloaded the Publishing Profile from my App Service and created a profile on my WebApi.
When I execute "publishing" using VS 2017, it works fine. When I try to execute deploy command on Jenkins if fails. The error message I have is :
- Deployment task failed. (Connected to the remote computer ("XXXXXXXX") using the Web Management Service, but could not authorize.
- Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator.
- Connected to the remote computer ("xxxxxxxxxxx") using the Web Management Service, but could not authorize.
- The remote server returned an error: (401) Unauthorized.
I have a step on Jenkins using PowerShell command line like :
msbuild My.WebApi /P:AllowUntrustedCertificate=true /P:DeployOnBuild=True /p:PublishProfile=$myPublishProfile
- It builds without errors
- $myPublishProfile is a valid Path
- This Jenkins instance runs on a Server, not on my machine.
- Jenkins has its own SMC user and server auth user.
- App Service has WEBSITE_WEBDEPLOY_USE_SCM set to False
- I am using the same Publishing Profile to build on Jenkins and on Visual Studio.
If both are using the same Publishing Profile, why I am getting the Auth error ?
Is there is any other config I should do to perform Deploy from Jenkins ?