locked
New-AzureRmIntegrationAccountPartner RRS feed

  • Question

  • Does anyone know how to set the BusinessIdentities property on the New-AzureRmIntegrationAccountPartner cmdlet?

    I'm trying to copy partners from 1 subscription to another.  I've used the Get-AzureRmIntegrationAccountPartner  to get all my partners like this.

    $partners = Get-AzureRmIntegrationAccountPartner -ResourceGroupName $resourceGroupName -Name $integrationAccountName

    However i'm not able to pass in the property I get back from that to New-AzureRmIntegrationAccountPartner

    i.e.

    foreach($p in $partners)
    {
        $p.Content.B2b.BusinessIdentities
    }

    I can't build a Hashtable like the doc suggests as it doesn't allow duplicate keys. 

    https://docs.microsoft.com/en-us/powershell/module/azurerm.logicapp/new-azurermintegrationaccountpartner?view=azurermps-5.1.1

    The error I get is

    New-AzureRmIntegrationAccountPartner : Invalid business identity.

    Wednesday, December 20, 2017 7:13 PM

Answers

  • The solution is to take the BusinessIndenties you get from the Get cmdlet and convert them into an array.    Not very obvious but this works.  

    $result = [System.Collections.ArrayList]@()

    $businessIdentities | foreach {  $temp = @($_.Qualifier, $_.Value); $result.Add($temp)  }

    New-AzureRmIntegrationAccountPartner -ResourceGroup <rg> -Name <ia> -PartnerName <partner> -BusinessIdentities $result.ToArray()

    • Marked as answer by Randy Vandehei Friday, December 22, 2017 1:20 PM
    Friday, December 22, 2017 1:20 PM

All replies

  • The solution is to take the BusinessIndenties you get from the Get cmdlet and convert them into an array.    Not very obvious but this works.  

    $result = [System.Collections.ArrayList]@()

    $businessIdentities | foreach {  $temp = @($_.Qualifier, $_.Value); $result.Add($temp)  }

    New-AzureRmIntegrationAccountPartner -ResourceGroup <rg> -Name <ia> -PartnerName <partner> -BusinessIdentities $result.ToArray()

    • Marked as answer by Randy Vandehei Friday, December 22, 2017 1:20 PM
    Friday, December 22, 2017 1:20 PM
  • Hi Randy,

    Thanks for answering your question, it helped me a lot.

    Any idea how to construct the metadata object? I tried the same procedure as with the BusinessIdentities, but that didn't work. I keep getting "invalid metadata", so it expects a different type of Object.

    Wednesday, October 3, 2018 1:35 PM