The following error is shown in Microsoft Visual Studio during publishing or connection validation when using some user added in Domains > example.com > Web Users > Add Users:
Connected to the remote computer ("example.com") 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.
Additional web user is used, that was created in Domains > example.com > Web Users > Add Users.
By default only subscription system user is allowed to access IIS websites for Web Deploy.
Apply one of the following solutions:
use the subscription system user
Find the subscription system user at Subscriptions > example.com:
Use it in Microsoft Visual Studio.
add additional web user to the allowed ones
Connect to the server via RDP.
Open Internet Information Services (IIS) Manager > Hostname > Sites > example.com > IIS Manager Permissions:
Warning: If IIS Manager Permissions is missing, install Management Service role as described in Microsoft official documentation.
Click Allow Users.. > Windows > Select > enter the username and click Check Names: