我正在部署一个函数,我能够在 Visual Studio 的函数应用 V2 中成功构建和发布它,但在 azure 门户中,我在函数应用中看到以下消息。我已经添加了必要的包,但仍然没有用。有没有人遇到过这个错误并有任何反馈。Visual Studio 的输出窗口中也没有错误。
如果我删除此版本的抽象,那么它会显示在 3.1.5 版中找不到文件。当我添加版本 3.1.5 时,它说找不到文件。不知道出了什么问题。在 github 中有一个讨论,但该线程现在已关闭,没有太多信息
谢谢
System.Private.CoreLib:无法加载文件或程序集“Microsoft.Extensions.Logging.Abstractions,版本=5.0.0.0,Culture=neutral,PublicKeyToken=adb97829ddae60”。该系统找不到指定的文件。System.Private.CoreLib:无法加载指定的文件。
这与 Azure 事件中心有关,我正在尝试使用 POSTMAN 的 POST api 调用将数据发送到我的事件中心。
我遵循的步骤:
创建事件中心、生成 SAS 发送令牌、创建消费者组
现在在邮递员中,我正在努力格式化正确的标题:
我发送的请求:
POST: https://testeventhu.servicebus.windows.net/myhub
Run Code Online (Sandbox Code Playgroud)
2个标题:
Content-Type : application/atom+xml;type=entry;charset=utf-8
Authorization: SharedAccessSignature sig=kjheh/f6SqR8dIW2nRpGUCHuhdshss2KoCKo7Q6ozmY=&se=1571140739&skn=saspolicy&sr=https://testeventhu.servicebus.windows.net/myhub
Run Code Online (Sandbox Code Playgroud)
我收到错误 401 MalformedToken: Failed to parse simple web token
我在这里做错了什么?使用的参考来自 https://docs.microsoft.com/en-us/rest/api/eventhub/Send-event?redirectedfrom=MSDN
提前致谢
下面是我传递内存流并读取它并在之后执行必要操作的代码。现在需求已经改变,而不是内存流,我将传递流,这开始给我错误。如果此处返回的内容是 Stream 类型,我想知道如何处理以下方法。现在,当我的内容是 MemoryStream 类型时,它可以正常工作。
public async Task<string> ReadStream(string containerName, string digestFileName, string fileName, string connectionString)
{
string data = string.Empty;
string fileExtension = Path.GetExtension(fileName);
var contents = await DownloadBlob(containerName, digestFileName, connectionString);
if (fileExtension == ".gz")
{
using (var unzipper = new GZipStream(contents, CompressionMode.Decompress))
{
using (StreamReader reader = new StreamReader(unzipper, Encoding.UTF8))
{
data = reader.ReadToEnd();
}
}
}
else
{
data = Encoding.UTF8.GetString(contents.ToArray());
}
return data;
}
Run Code Online (Sandbox Code Playgroud)