【发布时间】:2020-02-07 16:00:55
【问题描述】:
我正在运行 Azure 自动化运行手册,它具有 PowerShell 脚本以按定义的计划重新启动 Azure Web 应用程序。在测试运行以下脚本时出现错误:
$connectionName = "AzureRunAsConnection"
$servicePrincipalConnection = Get-AutomationConnection -Name $connectionName
$null = Add-AzureRmAccount `
-ServicePrincipal `
-TenantId $servicePrincipalConnection.TenantId `
-ApplicationId $servicePrincipalConnection.ApplicationId `
-CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
$null = Select-AzureRmSubscription -SubscriptionId 'SubscriptionID'
Restart-AzureRmWebApp -ResourceGroupName 'RGroupName' -Name 'webappname'
错误详情:
Add-AzureRmAccount:无法在 DLL“iphlpapi.dll”中找到名为“GetPerAdapterInfo”的入口点。
- $null = 添加-AzureRmAccount
- CategoryInfo : CloseError: (:) [Connect-AzureRmAccount], AadAuthenticationFailedException
- FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand
这个错误是否与没有足够的访问权限有关?
谢谢!
【问题讨论】:
标签: powershell azure-web-app-service azure-runbook