尝试发布Azure Function时出现“发布失败”的通用,非描述性错误消息

时间:2018-08-03 16:58:09

标签: azure azure-functions

我正在使用Visual Studio开发我的C#Azure函数。我尝试将Azure功能发布到云中,并在屏幕截图中遇到此消息。我的Azure Function应用已创建并处于启动状态,所以这不是问题。

此错误的原因是什么?还是有其他方法可以获取更具描述性的错误消息?

enter image description here

2 个答案:

答案 0 :(得分:1)

问题最终导致我以这种方式在Azure函数中使用#if

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
    .....

当我在本地测试时,以上内容在“调试”和“发布”模式下均有效,但在云中则无效。

答案 1 :(得分:1)

  1. 我将其发布到本地文件夹
  2. 登录到functionapp.scm.azurewebsites.net
  3. 删除了site / wwwroot中的所有内容
  4. 用发布文件夹中的内容替换内容。

有效!

相关问题