Publish to Azure succeeds but Visual Studio says that it failed.

Carolyn Schroeder 186 Reputation points
2022-09-29T19:56:48.06+00:00

With the publish profiles that I have for my Azure Web Apps, when I publish, the output information is that the publish succeeded but the publish page says that the publish failed. Usually I have fixed this by creating a new publish profile, but I have not been able to sign in to Azure from the Publish dialog in Visual Studio. I can always deploy by importing a publish profile but the publish profile approach does not allow enough for remote debugging.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,256 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,879 questions
{count} vote

Accepted answer
  1. Jandos 96 Reputation points
    2022-10-28T01:01:28.643+00:00

    I had the same issue recently. The reason was my azure security token was expired. I just had to open new profile window, and re enter my credentials, and cancel creating new profile. Then everything worked as before.

    4 people found this answer helpful.

4 additional answers

Sort by: Most helpful
  1. Carolyn Schroeder 186 Reputation points
    2022-10-02T17:38:25.103+00:00

    I have attached a screen shot.
    246779-error.png

    There is nothing in the referenced error logs.

    I am continuing to deploy from Visual Studio. The publish does succeed in spite of the error message. The newly deployed site does not come up in the browser.

    1 person found this answer helpful.

  2. ajkuma 22,401 Reputation points Microsoft Employee
    2022-09-30T12:51:36.85+00:00

    @Carolyn Schroeder ,

    When you say, “but the publish page says that the publish failed“, What is the exact error message you receive?
    Does this issue occur only when deploying to Azure App Service WebApp or happens for local deployments?

    You may directly login to your Azure subscription via Azure Portal, and find (status) the deployment/resources. https://portal.azure.com/

    -You may try these, if you have done it already, you may try these:
    • It is recommended that you have the latest version running.
    • Install the latest updates in Visual Studio by selecting Help > Check for Updates.
    • Add the workload by selecting Tools > Get Tools and Features.

    Note:

    • The dotnet msbuild command is a cross-platform command and can compile ASP.NET Core apps on macOS and Linux. However, MSBuild on macOS and Linux isn't capable of deploying an app to Azure or other MSDeploy endpoints.
    • Remote debugging does not work in Express editions of Visual Studio.
    • Publish profiles : When publishing to an Azure target, the .pubxml file contains your Azure subscription identifier. With that target type, adding this file to source control is discouraged.

  3. Lan Huang-MSFT 25,556 Reputation points Microsoft Vendor
    2022-10-03T06:18:13.94+00:00

    Hi @Carolyn Schroeder ,
    There are many reasons for this problem, you can try the following methods one by one:

    • Try open visual studio as admin.
    • In your solution directory, delete the .vs folder.If your project directory contains a pubxml file, please delete it.After that, restart Visual Studio.
    • Removed yellow marked files from Visual Studio project solution

    Best regards,
    Lan Huang


  4. Sjors Miltenburg 6 Reputation points
    2022-11-08T11:06:23.33+00:00

    I had the same problem.
    What helped was

    • deleting my local publish profile (publish - more actions - delete)
    • adding it again with the profile.publishssettings file I downloaded from azure
    0 comments No comments