I have created an Azure Function in VS 2019 and want to deploy it from VS 2019. While trying to deploy I am getting below error: The attempt to publish the ZIP file through failed with HTTP status code Unauthorized. I have tried following options:
None of the options is working. I am always getting same UNAUTHORIZED error.
I was facing the same failure when trying to publish a .NET Azure Function app from Visual Studio and I discovered that the Deploy ZIP file with REST APIs requires basic authentication to be turned on. So, in the Azure Portal for your Azure Function app go to Configuration and then to General Settings and turn on basic authentication.

One last thing, you might need to restart the app for the configuration change to take place.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With