gpt4 book ai didi

azure powershell 集成帐户合作伙伴创建身份无效

转载 作者:行者123 更新时间:2023-12-03 02:33:49 25 4
gpt4 key购买 nike

我在 Azure 上设置了付费和免费集成帐户。我已经使用该门户生成了一些合作伙伴和协议(protocol),没有出现任何问题。我现在希望使用一些 powershell 脚本来帮助控制将来这些合作伙伴和协议(protocol)的创建。

当尝试构建脚本来创建合作伙伴时,我遇到了业务身份的瓶颈。

New-AzIntegrationAccountPartner -ResourceGroupName $ResourceGroupName …| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Invalid business identity.

$ResourceGroupName = 'rg-test'
$IntegrationAccountName = 'inter-test'
$PartnerName = 'TestPartner'

$BusinessIdentities = @{
Qualifier = "AS2Identity"
Value = "TestIdentity"
}

New-AzIntegrationAccountPartner -ResourceGroupName $ResourceGroupName -Name $IntegrationAccountName -PartnerName $PartnerName -BusinessIdentities $BusinessIdentities

引用:https://learn.microsoft.com/en-us/powershell/module/az.logicapp/new-azintegrationaccountpartner?view=azps-4.6.1

关于哈希表,有什么我不知道的吗?

Powershell 核心 MacOS 10.15.6

主要次要补丁 PreReleaseLabel BuildLabel

<小时/>

7 0 3

<小时/>

更新:

添加 Resolve-AzError 响应。

HistoryId: 4

Message : Invalid business identity.
StackTrace : at Microsoft.Azure.Commands.LogicApp.Utilities.CmdletHelper.ConvertToBusinessIdentityList(Object businessIdentityObject)
at Microsoft.Azure.Commands.LogicApp.Cmdlets.NewAzureIntegrationAccountPartnerCommand.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception : System.Management.Automation.PSArgumentException
InvocationInfo : {New-AzIntegrationAccountPartner}
Line : New-AzIntegrationAccountPartner -ResourceGroupName $ResourceGroupName -Name $IntegrationAccountName -PartnerName $PartnerName -BusinessIdentities
$BusinessIdentities
Position : At /Users/john/Desktop/run.ps1:10 char:1
+ New-AzIntegrationAccountPartner -ResourceGroupName $ResourceGroupName …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 4

最佳答案

根据我的研究,当我们运行命令 New-AzIntegrationAccountPartner 时,我们需要将 BusinessIdentities 定义为数组。因为命令 New-AzIntegrationAccountPartner 中的代码 Microsoft.Azure.Commands.LogicApp.Utilities.CmdletHelper.ConvertToBusinessIdentityList(ObjectbusinessIdentityObject) 需要用户提供 Array 对象。否则,会抛出错误。更多详情请引用herehere .

例如

$ResourceGroupName = 'testaks'
$IntegrationAccountName = 'test06'
$PartnerName = 'TestPartner'

$BusinessIdentities = @("<the Qualifier's value such as AS2Identity>","<The Value's value>")

New-AzIntegrationAccountPartner -ResourceGroupName $ResourceGroupName -Name $IntegrationAccountName -PartnerName $PartnerName -BusinessIdentities $BusinessIdentities

enter image description here

关于azure powershell 集成帐户合作伙伴创建身份无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63996266/

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