azure - 如何在 AzureAutomation 中使用 ConnectionType 作为 Azure 登录 AzureRm
问题描述
我的 Azure 自动化是使用Create Azure Run As Account
我可以使用以下命令登录 Azure
$connectionName = "AzureRunAsConnection"
$servicePrincipalConnection = Get-AutomationConnection -Name $connectionName
"Logging in to Azure..."
Connect-AzureRmAccount -ServicePrincipal -TenantId $servicePrincipalConnection.TenantId -ApplicationId $servicePrincipalConnection.ApplicationId -CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
我现在正在调查连接类型为Azure
通过在证书中上传我自己的证书,我创建了一个作为Azure 类型的新连接
我自己的自动化证书
我的 Azure 连接
现在我正在考虑如何使用此abc
连接登录到我的 Azure Rm 帐户
$connectionName = "abc"
$conn = Get-AutomationConnection -Name $connectionName
echo $conn
"Logging in to Azure..."
Connect-AzureRmAccount -SubscriptionId $conn.SubscriptionID
我知道上面这不是正确的方法,但希望有人能帮助我得到正确的方法。
上面的查询给出了如下错误
Name Value
---- -----
AutomationCertificateName MyCertificate
SubscriptionID xxxx-xxx-xxx-xxx-xxxxxxx
Logging in to Azure...
Connect-AzureRmAccount : Unable to find an entry point named 'GetPerAdapterInfo' in DLL 'iphlpapi.dll'.
At line:5 char:5
+ Connect-AzureRmAccount -SubscriptionId $conn.SubscriptionID
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Connect-AzureRmAccount], AadAuthenticationFailedException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand
此外,我无法获得任何关于connectionType
as Azure确切用法的参考文档。除了与Azure的连接类型相关的示例之外,我找不到任何示例
如果有人指导以Azure的形式获取有关 connectionType 的一些参考文档,那将是一个很大的帮助
解决方案
Azure 运行方式帐户不仅仅是连接和证书资产。
在创建 Azure 运行方式帐户期间,还会为该服务主体分配一个 Azure AD 应用程序、Azure AD 服务主体和参与者权限。
查看https://docs.microsoft.com/en-us/azure/automation/manage-runas-account了解更多信息。文档还包含一个用于创建您自己的 Azure 运行方式帐户的 PowerShell 脚本,其中包括对以下配置的支持:
- 使用自签名证书创建运行方式帐户。
- 使用自签名证书创建运行方式帐户和经典运行方式帐户。
- 使用企业证书颁发机构 (CA) 颁发的证书创建运行方式帐户和经典运行方式帐户。
- 使用 Azure 政府云中的自签名证书创建运行方式帐户和经典运行方式帐户。
推荐阅读
- r - 如何制作有条件的ggplot几何
- fortran - 如何在 Fortran 90 中使用 MPI 结构发送和接收数组
- date - 当 foxpro 创建选择光标时,它将“1900-01-01”日期显示为空
- python - 如何在python中的文本字符串中找到子字符串的起始位置?
- javascript - Puppeteer:按类查找 iframe
- javascript - 验证 NG_VALIDATORS 中的控制状态未更新
- android - PlayGames ERROR_INVALID_CREDENTIAL
- java - 我们可以在 python 代码之上引入一些 java 或任何其他语言包装器,以隐藏/加密我们的 python 代码以防止重新设计吗?
- html - Div 中的居中按钮,位于其他居中文本下方
- python - Python字典中基于默认参数的映射命令