aBlaze
aBlaze

Reputation: 2716

"Publishing failed" generic, undescriptive error message when attempting to publish Azure Function

I am using Visual Studio to develop my C# Azure Functions. I attempt to publish my Azure Function to the cloud, and encounter this message in the screenshot. My Azure Function App has created and in the started state, so that is not the issue.

What is the cause of this error? Or is there any other way to get a more descriptive error message?

enter image description here

Upvotes: 3

Views: 283

Answers (2)

Shashank
Shashank

Reputation: 11

  1. I published it to local folder
  2. Logged into functionapp.scm.azurewebsites.net
  3. Deleted all contents in site/wwwroot
  4. replaced the contents with the contents from published folder.

it works!

Upvotes: 1

aBlaze
aBlaze

Reputation: 2716

The issue ended up being that I was using #if in the Azure function in this way:

namespace Common.Utils
{
    using System;
    using System.Net.Http;
    using System.Threading.Tasks;
    #if DEBUG
    using Microsoft.Azure.KeyVault;
    using Microsoft.Azure.KeyVault.Models;
    using Microsoft.Azure.Services.AppAuthentication;
    using Microsoft.IdentityModel.Clients.ActiveDirectory;
    #endif
    .....

While the above worked in both Debug and Release modes while I was testing locally, it didn't work in the cloud.

Upvotes: 1

Related Questions