Powershell Workflow Runbook-身份验证失败

我有一个Azure自动化 Run As account当我在Azure Portal中的运行本上运行以下代码(来自Azure在线教程的第5步)时,出现以下错误。问题:我在这里可能会缺少什么,我们如何解决该问题?

Runbook代码

# Ensures you do not inherit an AzContext in your runbook
Disable-AzContextAutosave –Scope Process

$Conn = Get-AutomationConnection -Name AzureRunAsConnection
Connect-AzAccount -ServicePrincipal -Tenant $Conn.TenantID `
-ApplicationId $Conn.ApplicationID -CertificateThumbprint $Conn.CertificateThumbprint

$AzureContext = Select-AzSubscription -SubscriptionId $Conn.SubscriptionID

错误

Failed At line:4 char:1
+ Disable-AzContextAutosave –Scope Process
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cannot find the 'Disable-AzContextAutosave' command. If this command is defined as a workflow, ensure it is defined before the workflow that calls it. If it is a command intended to run directly within Windows PowerShell (or is not available on this system), place it in an InlineScript: 'InlineScript { Disable-AzContextAutosave }'
公路跑者

我假设您尚未将Az.Accounts模块导入您的自动化帐户。Disable-AzContextAutosaveConnect-AzAccount并且Select-AzSubscription来自此模块。

请遵循本指南来导入Az模块

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在Azure Workflow Runbook中中断ForEach循环

来自分类Dev

Powershell Mongodb身份验证

来自分类Dev

PowerShell远程身份验证

来自分类Dev

Runbook - 用于修改 Azure AD 组的 PowerShell

来自分类Dev

O365-多因素身份验证-通过Powershell访问身份验证电话

来自分类Dev

在Powershell中为IIS应用启用身份验证

来自分类Dev

Powershell禁用匿名FTP并启用身份验证

来自分类Dev

带有Powershell的OVH API身份验证

来自分类Dev

使用Powershell设置Azure广告证书身份验证

来自分类Dev

使用身份验证PowerShell从Web加载xml

来自分类Dev

Azure PowerShell Runbook动态获取设置Az磁盘

来自分类Dev

如何在Azure PowerShell Runbook上应用SharePoint网站模板?

来自分类Dev

Azure Runbook-使用Powershell脚本从图库创建

来自分类Dev

使用Azure Powershell Runbook自动创建数据库

来自分类Dev

Azure Runbook-缺少PowerShell Cmdlet或未针对VM执行

来自分类Dev

Azure 自动化 Powershell Runbook 静默无法 LoadAssembly

来自分类Dev

我是否必须在 powershell runbook (azure) 中导入模块?

来自分类Dev

在 Azure PowerShell Runbook 中更改 Azure Blob 存储层

来自分类Dev

SslStream身份验证失败

来自分类Dev

PHPMailer身份验证失败

来自分类Dev

Heroku身份验证失败

来自分类Dev

MongoDB身份验证失败?

来自分类Dev

Shiro身份验证失败

来自分类Dev

MongoError:身份验证失败

来自分类Dev

身份验证失败:omniauth

来自分类Dev

VNC身份验证失败

来自分类Dev

LightDM:“身份验证失败”

来自分类Dev

Paramiko身份验证失败/身份验证异常

来自分类Dev

使用 nestjs 身份验证时身份验证失败