PowerShell脚本和libeay32.dll与Azure功能应用程序

时间:2017-04-03 09:52:43

标签: powershell azure azure-functions

我尝试在Azure功能应用中使用可在我的计算机上运行的PowerShell脚本。

简而言之,该脚本使用Service Principal配置文件json登录Azure,然后更新我的Let的加密SSL证书。

脚本本身位于名为Register-LetsEncryptCertificateSP.ps1的文件中,我可以通过调用它在本地PowerShell ISE中成功运行它: PS C:\tmp\test> .\Register-LetsEncryptCertificateSP.ps1 -Domain dev.mysite.com -RegistrationEmail my@email.com -ResourceGroup my-resourcegroup-name -WebApp my-webapp-name -ServicePrincipalProfilePath "c:\tmp\letsencryptSP.json"

我向Lee Holmes的脚本添加了Service Principal支持,该脚本默认提示输入Azure帐户凭据:https://www.powershellgallery.com/packages/Register-LetsEncryptCertificate/1.0/DisplayScript

我试图将此脚本放在TimerTriggerPowerShell函数应用程序中。该脚本需要以下模块:#requires -Modules AcmeSharp, Azure, AzureRM.Websites

默认情况下,

AzureAzureRM.Websites可用,我已将ACMESharp上传到modules/ -directory`但是当我在Azure中运行脚本时,我得到以下日志:

2017-04-03T09:46:23.499 Function started (Id=015f9081-8bc2-4801-b392-76e53da027f7)
2017-04-03T09:46:23.983 Loaded modules:
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp.psd1
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp-AWS/ACMESharp-AWS.psd1
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp-IIS/ACMESharp-IIS.psd1
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp.PKI.Providers.OpenSslLib32.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp.PKI.Providers.OpenSslLib64.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp.POSH-test.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp.POSH.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp.Providers.AWS.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp.Providers.IIS.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp.Vault.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/AWSSDK.Core.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/AWSSDK.Route53.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/AWSSDK.S3.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ManagedOpenSsl.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/Microsoft.Web.Administration.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/Newtonsoft.Json.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/x86/libeay32.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/x86/ssleay32.dll
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp-AWS/ACMESharp-AWS.psm1
/TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp-IIS/ACMESharp-IIS.psm1
2017-04-03T09:46:24.186 Import-Module : The specified module 'AWSPowerShell' was not loaded because no valid module file was found in any module directory.
at <ScriptBlock>, /TimerTriggerPowerShell1/modules/ACMESharp/0.8.1/ACMESharp-AWS/ACMESharp-AWS.psm1: line 17
+ Import-Module
+ _____________
    + CategoryInfo          : ResourceUnavailable: (AWSPowerShell:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
2017-04-03T09:46:24.280 Function completed (Failure, Id=015f9081-8bc2-4801-b392-76e53da027f7)
2017-04-03T09:46:24.343 Exception while executing function: Functions.TimerTriggerPowerShell1. System.Management.Automation: Could not load file or assembly 'file:///D:\home\site\wwwroot\TimerTriggerPowerShell1\modules\ACMESharp\0.8.1\x86\libeay32.dll' or one of its dependencies. The module was expected to contain an assembly manifest.

应用服务正在32位运行。有任何想法如何解决这个错误?

0 个答案:

没有答案