gpt4 book ai didi

Azure powershell 函数停止工作(未发现任何更改),并出现错误 "Could not load file or assembly ' Azure.Core,版本=1.5.1.0“

转载 作者:行者123 更新时间:2023-12-03 00:23:00 26 4
gpt4 key购买 nike

我们的许多 Azure 函数(函数应用内)已于 11 月初停止工作。虽然我确信它很简单,但我们无法识别和已做出的更改。这是代码(直到出现错误的行 - new-AzStorageContext)

using namespace System.Net


# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)

# Write to the Azure Functions log stream.
Write-Host "PowerShell HTTP trigger function processed a LIPA Open Day Data message."
$OpenDayData = "$((Get-Date -format yyyy-MMM-dd-ddd` HH-MM-ss-fff).ToString()).json"
$TargetContainerName = $env:ODLTargetContainerName

# Interact with query parameters or the body of the request.
$message = $Request.Body.Message

if ($message) {

write-host "Instantiating storage context"
$ctx = New-AzStorageContext -ConnectionString $env:AzureWebJobsStorage

这就是错误:

2020-12-04T17:37:58.516 [Error] ERROR: Could not load file or assembly 'Azure.Core, Version=1.5.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'. The system cannot find the file specified.Exception             :Type       : System.IO.FileNotFoundExceptionMessage    : Could not load file or assembly 'Azure.Core, Version=1.5.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'. The system cannot find the file specified.FileName   : Azure.Core, Version=1.5.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8TargetSite : Void .ctor(System.Action`1[System.String])StackTrace :at Microsoft.Azure.Commands.Common.Authentication.AzureEventListener..ctor(Action`1 action)at Microsoft.Azure.Commands.Common.Authentication.Factories.AzureEventListenerFactory.GetAzureEventListener(Action`1 action)at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.SetupDebuggingTraces()at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing()at System.Management.Automation.Cmdlet.DoBeginProcessing()at System.Management.Automation.CommandProcessorBase.DoBegin()Source     : Microsoft.Azure.PowerShell.AuthenticationHResult    : -2147024894CategoryInfo          : NotSpecified: (:) [New-AzStorageContext], FileNotFoundExceptionFullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.WindowsAzure.Commands.Storage.Common.Cmdlet.NewAzureStorageContextInvocationInfo        :MyCommand        : New-AzStorageContextScriptLineNumber : 18OffsetInLine     : 12HistoryId        : 1ScriptName       : D:\home\site\wwwroot\LogOpenDayActivity\run.ps1Line             :     $ctx = New-AzStorageContext -ConnectionString $env:AzureWebJobsStoragePositionMessage  : At D:\home\site\wwwroot\LogOpenDayActivity\run.ps1:18 char:12+     $ctx = New-AzStorageContext -ConnectionString $env:AzureWebJobsSt …+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~PSScriptRoot     : D:\home\site\wwwroot\LogOpenDayActivityPSCommandPath    : D:\home\site\wwwroot\LogOpenDayActivity\run.ps1InvocationName   : New-AzStorageContextCommandOrigin    : InternalScriptStackTrace      : at <ScriptBlock>, D:\home\site\wwwroot\LogOpenDayActivity\run.ps1: line 18Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException : Result: ERROR: Could not load file or assembly 'Azure.Core, Version=1.5.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'. The system cannot find the file specified.Exception             :Type       : System.IO.FileNotFoundExceptionMessage    : Could not load file or assembly 'Azure.Core, Version=1.5.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'. The system cannot find the file specified.FileName   : Azure.Core, Version=1.5.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8TargetSite : Void .ctor(System.Action`1[System.String])StackTrace :at Microsoft.Azure.Commands.Common.Authentication.AzureEventListener..ctor(Action`1 action)at Microsoft.Azure.Commands.Common.Authentication.Factories.AzureEventListenerFactory.GetAzureEventListener(Action`1 action)at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.SetupDebuggingTraces()at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing()at System.Management.Automation.Cmdlet.DoBeginProcessing()at System.Management.Automation.CommandProcessorBase.DoBegin()Source     : Microsoft.Azure.PowerShell.AuthenticationHResult    : -2147024894CategoryInfo          : NotSpecified: (:) [New-AzStorageContext], FileNotFoundExceptionFullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.WindowsAzure.Commands.Storage.Common.Cmdlet.NewAzureStorageContextInvocationInfo        :MyCommand        : New-AzStorageContextScriptLineNumber : 18OffsetInLine     : 12HistoryId        : 1ScriptName       : D:\home\site\wwwroot\LogOpenDayActivity\run.ps1Line             :     $ctx = New-AzStorageContext -ConnectionString $env:AzureWebJobsStoragePositionMessage  : At D:\home\site\wwwroot\LogOpenDayActivity\run.ps1:18 char:12+     $ctx = New-AzStorageContext -ConnectionString $env:AzureWebJobsSt …+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~PSScriptRoot     : D:\home\site\wwwroot\LogOpenDayActivityPSCommandPath    : D:\home\site\wwwroot\LogOpenDayActivity\run.ps1InvocationName   : New-AzStorageContextCommandOrigin    : InternalScriptStackTrace      : at <ScriptBlock>, D:\home\site\wwwroot\LogOpenDayActivity\run.ps1: line 18Exception: Could not load file or assembly 'Azure.Core, Version=1.5.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'. The system cannot find the file specified.Stack:    at Microsoft.Azure.Commands.Common.Authentication.AzureEventListener..ctor(Action`1 action)at Microsoft.Azure.Commands.Common.Authentication.Factories.AzureEventListenerFactory.GetAzureEventListener(Action`1 action)at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.SetupDebuggingTraces()at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing()at System.Management.Automation.Cmdlet.DoBeginProcessing()at System.Management.Automation.CommandProcessorBase.DoBegin()

最佳答案

请检查您的函数的requirements.psd1。检查是否被其他人修改过。 enter image description here

然后重新启动您的函数应用。

如果仍然显示相同的错误消息,我认为您可以使用相同的代码创建另一个函数来实现您的要求,因为某些文件可能会被某些人删除(或修改)。

关于Azure powershell 函数停止工作(未发现任何更改),并出现错误 "Could not load file or assembly ' Azure.Core,版本=1.5.1.0“,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65148470/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com