failed with HTTP status code 'Unauthorized'.

Anonymous
2023-05-14T19:52:08.6466667+00:00

Hi,

Why I suddenly started getting this error:

/Users/jassim/Projects/OneID/One ID API/Controllers/Account.cs(116,9,116,15): warning CS0162: Unreachable code detected
/usr/local/share/dotnet/sdk/7.0.203/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.ZipDeploy.targets(55,5): error : The attempt to publish the ZIP file through 'https://oneid.scm.azurewebsites.net/api/zipdeploy' failed with HTTP status code 'Unauthorized'.
    13 Warning(s)
    1 Error(s)

How can I fix it, please?

Thanks,

Jassim

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Developer technologies | .NET | Other
{count} votes

6 answers

Sort by: Most helpful
  1. Miguel Andres Arias 1 Reputation point
    2025-02-25T13:34:59.6733333+00:00

    I am experiencing the same error. After successfully publishing a function in the Flex service, I encounter an error when trying to publish from Visual Studio 2022 that says the service is unavailable. It is not possible to publish again. If I create a new function from scratch, Visual Studio can publish it, but this is impossible to do in a productive environment. The error I encounter is as follows:

    Publish has encountered an error.

    The Publish URL https://test-solidaria-whatsapp.scm.azurewebsites.net/ is unreachable. The application may be stopped, restarting or unavailable. Try again once the publish target is available.

    A diagnostic log has been written to the following location:

    "C:\Users\migue\AppData\Local\Temp\tmp5572.tmp"

    The text of the file says the following:

    Microsoft.WebTools.Shared.Exceptions.WebToolsException: The Publish URL https://test-solidaria-whatsapp.scm.azurewebsites.net/ is unreachable. The application may be stopped, restarting or unavailable. Try again once the publish target is available.

    at Microsoft.WebTools.Azure.Functions.Publish.ZipDeployPublishProfileConfiguration.<PrePublishAsync>d__11.MoveNext()

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at Microsoft.Publish.Framework.Profiles.PublishProfilesServiceImpl.ServerProjectProfilesManager.<RunPublishTaskAsync>d__76.MoveNext()

    I have three functions with the same problem

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.