14

I am trying to deploy my Bot to azure. I have created it in azure and i downloaded the source code. But now im trying to deploy it again i'm getting the error on the title. I got all the credentials correct because i wrote it down before. This is the error.

Severity Code Description Project File Line Suppression State Error Web deployment task failed. (Connected to the remote computer ("dotnetfpbot.scm.azurewebsites.net") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.) Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator. Error details: Connected to the remote computer ("dotnetfpbot.scm.azurewebsites.net") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED. The remote server returned an error: (401) Unauthorized. AzureBot 0

If ever my username or password is wrong is there a way to change them?

6
  • Are you using the deployment username and password from the deployment profile or your Azure account username and password? Commented Jan 10, 2019 at 9:25
  • I'm using the microsoft appID and password when i first created the bot in azure portal sir. Commented Jan 11, 2019 at 1:40
  • 1
    Alright, well you need to use the publish/deployment profile credentials. Normally Visual Studio should do that for you.. Commented Jan 11, 2019 at 5:23
  • 2
    It's okay now. I went to azure and clicked "get publish profile" and theres a password there. I used that password and it logged in successfuly. Now i can publish the bot but how can i publish it back to it's slot in azure portal? Commented Jan 11, 2019 at 7:11
  • I first created it in azure and downloaded the source code but now i can't deploy it back even after successfuly publishing it in visual studio. Commented Jan 11, 2019 at 7:13

8 Answers 8

15

Go to Function App's Configuration/General Settings. On the page set Basic Auth Publishing Credentials to On, Save.

Basic Auth Publishing Credentials has to be set to "On"

Sign up to request clarification or add additional context in comments.

3 Comments

In 2024, you can find this setting in Azure Function Settings -> Configuration -> General Settings -> SCM Basic Auth Publishing.
This actaully worked for me. SCM Basic Auth Publishing Credentials should be turned on to publish from Vsual Studio.Please refer this link
Enabling Basic Auth AFTER trying to publish didn't work for me until I deleted the profile and re-created it - I'm using VS 2022 64 bit Version 17.10.6.
9

please delete the publish profiles and rebuilt them by going through the wizard again.

1 Comment

Thanks. This extra step was needed after the @on-the-ray's answer.
3

Yes. Sign in to your Azure account and hit 'get publish profile' at the top of the dashboard after you click into your project and you can send it to Notepad. Much stuff there. It all repeats; It is userPWD="the long password is here"

Comments

2

This happened to me today, Even if I get the publishing profile from Azure App Service.

All I did was update my Visual Studio to the latest which is as of this moment is 17.6.0 from 17.5.X

1 Comment

Thank you so much. Updating visual studio solved this problem from my end.
2

I faced the same issue, followed the following steps and it worked for me-

  • Open your web app in the azure portal and expand the settings and Open the configuration.

  • In the General settings tab, make sure SCM Basic Auth Publishing and FTP Basic Auth Publishing is turned on.

  • Once it is on click on Save.

  • Go back to Visual Studio and delete all the publish profiles you have created.

  • Create a new publish profile and select your azure web app and hit publish.

enter image description here

Comments

0

[Go to side menu configuration/General Settings and set the SCM Basic Auth Publishing and FTP Basic Auth Publishing 'On'][1]

1 Comment

It looks as though you were trying to include an image, yet no image came through. Can you edit your post and try again?
0

For the sake of users, who want to see the settings page (screenshot from azure portal), I have pasted it below:

enter image description here

Comments

0

I solved this today - the LDAP user (domain\myuser) would not work despite setting up web deploy for those users. What did work was a LOCAL server user. Go to the server, create the user, assign to administrators.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.