Unable to publish to Azure: Web deployment task failed - visual-studio

I have been deploying my Web Service via Visual Studio for over a year. Today it suddenly started giving me the error: Web deployment task failed.
Things I have noticed:
I have two other projects in the same solution that deployed to Azure without an issue.
I am able to download and change files via Cloud Explorer in VS.
I cant preview changes.
Validate Connection fails.
Things that I have tried:
Reset the publish profile via Azure, downloaded and imported it.
Selected an existing App Service.
Ensured that WEBSITE_WEBDEPLOY_USE_SCM = false before downloading the latest
publish profile.
Manually typed in the Username, Password from the Deployment Center
Hopefully someone can see something I am missing.

I was finally able to publish after a few weeks and plenty of back-and-forths with Azure support. I'm not sure if it was just time that fixed the problem, but the last thing I did before it started working was Attach a Debugger to the App Service. Hope that helps!

Related

How to provide password for Web Deploy on Visual Studio (Mac)

Environment
MacOS 10.14.6 Mojave, Visual Studio For Mac v8.7.9
API service built on .NET Core framework
Issue: I have a .NET Core project that has a web deploy publish profile to deploy updates to the windows server running on EC2 (IIS).
When I was working on windows, I could easily deploy it through the web deploy UI in the visual studio but after I migrated to the macOS, cannot find such option in the visual studio. I can click on the existing web deploy publish option but it always fails because I need to provide the password somewhere. I tried to add <Password> under the pubxml file but it doesn't read as a valid tag.
Existing publish profiles
Error
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Web deployment task failed. (Connected to the remote computer 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.)
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator.
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Error details:
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Connected to the remote computer ("ec2-3-92-105-216.compute-1.amazonaws.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.
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : The remote server returned an error: (401) Unauthorized.
Publish failed to deploy.
Currently I have not yet found the answer for that but I've found a kind of work around.
I publish the project to a folder (be careful with dotnet parameters) and after that manually copy files in "bin/Release/netcoreapp3.1/publish" v. ftp to my server.
In order to save a lot of time, it makes sense to copy only newer / different size files.
Not elegant at all, but this is the way how it works for me now.
Will be happy to hear, someone found a solution how to store the password for webdeploy on MacOS

Visual Studio hangs when creating Azure App Service

I'm trying to follow a tutorial on Azure deployment. I'm stuck on one of the first steps creating the App Service. It seams that the form tries to find all App Service Plans but can't, so all of Visual Studio hangs. I had to kill it with Task Manager. Any clues on how I can fix this? Do I need to create something at the Azure management console?
Had the same issue, turned out I hadn't installed Azure SDK, you'd think there would be some kind of error message, but no. Installing the SDK fixed issue
I did the steps below to resolve the issue.
Login to your Azure account
Manually create an app service (use any dummy app service name). The service plan and resource group will be created while you're creating this app service
Once you see the dummy app service created on your Azure dashboard (it will take around 1-2 minutes), open your visual studio from your pc, create your web project and check api service
--- This time, the service plan and resource group will be brought in.---
Click "Create" to create your "real" web/api project in Azure
Now you can remove the dummy service from Azure
I had the same problem. It started to work after I logged into the Azure Dashboard and manually created an App Services Web App.
Ran into the same issue a few days ago and here is how I got it working.
I had yet to create any App Services in the Azure account I had tied to Visual Studio and when I got to the Create App Service window you posted, Visual Studio would freeze.
I logged into the Azure Portal, created an App Service with a different name than the project. Once it was created, I then deleted the newly created App Service.
After doing this had no problem freezing in Visual Studio. The fix appears to be to create at least one App Service in portal before it works in VS.
I did two things at once, not sure which one got through the lock up.
1) In Visual Studio, went to File -> Account Settings then under the "All Accounts" section of the Account Settings window I reentered my credentials for the Azure account I had linked the project to. This account had a notification raised saying "We need to refresh the credentials for this account."
2) As others have said, I created a new Web App. I'm not sure this was the problem, however - I had previously created a couple other web apps and these resources were still present in my dashboard.
I have to agree with the above comments, too - the error messages provided for this are really, really poor.
Check that there are no characters that it will not accept. For instance an underscore '_'
Azure built a dummy name for me to use including an underscore which it does not accept. It was trial and error for me to find this where a simple warning would have saved lots of time.
Login to Azure Portal and create necessary resources. VS screens do not seem to work properly.
I created Api App on azure portal and my problem solved.
Same problem, however I have 3 Azure subscriptions, but even after making sure all of'em has at least one App Service it still hangs on this step. No other option than to not check the option to host.
Updating Azure SDK on VS2015 fix the problem in my case

Deploying to Azure: "Access to the path ... msshrtmi.dll is denied"

I have a long-standing Azure project that I built in VS2012 against the Azure SDK 2.4, and am attempting to migrate it to VS2015 and Azure 2.7. I am able to build the project and run it locally, but when I attempt to deploy it fails with the following error:
Access to the path 'C:[user folder]\AppData\Local\Temp[random chars]\roles[solution]\base\x86\msshrtmi.dll' is denied
When I attempt to view that containing folder it doesn't exist... perhaps it is removed after the publish failure? I've found the msshrtmi.dll within the solution folders, and have tried changing the platform targeting that has been claimed to help other msshrtmi.dll issues, but most of those seem to be fails at build time not publish time.
I've re-built a new Azure solution and imported my web role project and get the same result. I've never had to delve deep in to the VS configuration/build/deploy world before and am hoping someone can help point me in the right direction.
Thanks in advance for your help!
I had the same exception. My resolution was a workaround given to me by the Microsoft Azure Tools team - package or publish on a 64-bit machine. My VM was 32-bit. As soon as I packaged on the 64-bit machine, this error went away and I could publish once again.
The same team members said this issue will be fixed in the Azure 2.7.1 release around the end of August.

Deploying Workflow wsp as sandbox soluting

I Am Relatively new in sharepoint. I have created a small workflow using Visual Studio as a Farm Solution. It works fine for my Server but whem I am trying to deploy it on remote server its disabling the activate option ..it appears to me that i have to deploy it is as a sandbox Solution. I tried by setting the sandbox = true in VS but then its throwing me an error saying "Feature cannot be deployed as Sandbox Solution". Can Any1 Help
Thank You

Deploying to Azure from Visual Studio fails when connecting

I have been using Visual Studio to deploy a Web Service to Azure; downloaded my publish profile to enable that and it was working fine for the past few weeks.
Today I tried to deploy an update and now all my deployments fail with the following:
17:25:03 - Preparing deployment for WindowsAzure1 - 25/03/2013 17:24:53 with Subscription ID 'xxx' using Service Management URL 'https://management.core.windows.net/'...
17:25:03 - Connecting...
17:25:04 - Object reference not set to an instance of an object.
17:25:04 - Deployment failed with a fatal error
I'm not sure what's failing here; is this saying it's unable to connect to the Service Management URL?
Last week I installed an SSL certificate on Azure and now I'm not seeing the option to download my publish settings. I know it used to be there but isn't now. Does having an SSL prevent me from somehow connecting to the management page?
Edit
Before leaving work I removed the certificate but when I then checked for the PublishProfile it was still not showing.
The PublishProfile is not available for any of the other users attached to the subscription - so I don't think it's related to my login.
Edit 2
A bit more drastic; I've now tried deleting my storage and service, to start from scratch. I created a new publishsettings file by removing the subscriptions already imported into Visual Studio and then following the link to "Sign in to download credentials". Next I created a new service and storage in Azure and tried to publish but the deployment still fails when connecting with
Object reference not set to an instance of an object
I have no idea what else I could try or what could be wrong, or where to look to find out.
I got the same error today. Why it wasn't working was because I hadn't uploaded the certificate in the managementportal prior to the publish.
After adding the certificate, everything worked just fine!
You can read more here: http://www.amido.co.uk/mark-omahoney/publishing-in-windows-azure-object-reference-not-set-to-an-instance-of-an-object/
The best way to solve above problem is to download the latest PublishSettings from Azure Management Portal and then use it with Visual Studio. This way your connection to Windows Azure Management Portal from local machine will be verified and validated. Once you have the basic connection working then you can publish your application to specific Windows Azure Service.
Also you can log into your Azure Management Portal and remove all old management certificates which are added in previous publishsettings download attempts.
The problem, in my case, was that my solution Cloud project had the thumbprint of the SSL certificate I'd uploaded in its ServiceDefinition.csdef and ServiceConfiguration.Cloud.cscfg. In my first edit I said that I'd removed the certificate from Azure, but hadn't then removed it from the project files; commenting them out allowed me to publish from Visual Studio again.
I'm not sure why this happened though, I had uploaded the certificate to Azure and was able to connect to my service on https in FireFox so the SSL was "working".
Web Deploy v3.6 BETA3 was released that fixes this issue. To resolve this error, you can download the Web Deploy beta and patch your VS2013 installation. http://azure.microsoft.com/blog/2014/08/11/web-deploy-3-6-beta-released/
Test Validate Connection once you installed the above Web Deploy. If it works, then fine else you can modify the proxy settings used by msbuild.exe (msbuild.exe.config) and check you can now publish from behind a proxy with Web Deploy.
Regards,
Logesh Shan
I think the certificate got corrupt. Deleting the solution .suo file and the .ccproj.user file in my Azure project did it for me.

Resources