Fresh of the press: new Azure PowerShell cmdlets for upcoming X12 connector disaster recovery
This afternoon five new cmdlets will be released as part of the Azure PowerShell Release 3.7.0. After installing the release you may refer to the built-in detailed help like this:
get-help Get-AzureRmIntegrationAccountReceivedIcn -detailed
get-help Set-AzureRmIntegrationAccountReceivedIcn -detailed
get-help Remove-AzureRmIntegrationAccountReceivedIcn -detailed
get-help Get-AzureRmIntegrationAccountGeneratedIcn -detailed
get-help Set-AzureRmIntegrationAccountGeneratedIcn -detailed
This detailed help explains the cmdlets in details. Here below is a copy for preview. Now the cmdlets will work as one element of a broader disaster recovery system under development. The X12 connector is been updated as another element of that system; that update is not quite available yet and the release cadences of the two are different. So you will need to wait a bit longer before you can use these cmdlets to execute an actual disaster recovery.
Programmers will also be interested in learning that the code for these cmdlets is entirely available as open source on GitHub. It is built from three incremental steps: the REST API for the underlying resource, the autorest generated C# SDK and finally the cmdlets code itself. The GitHub repositories are respectively https://github.com/Azure/azure-rest-api-specs/ (/arm-logic folder), https://github.com/Azure/azure-sdk-for-net/ (/src/ResourceManagement/Logic folder) and https://github.com/Azure/azure-powershell/ (/src/ResourceManager/LogicApp folder)
NAME
Get-AzureRmIntegrationAccountReceivedIcn
SYNOPSIS
This cmdlet retrieves a specific received interchange control number per agreement and control number value.
SYNTAX
Get-AzureRmIntegrationAccountReceivedIcn -AgreementName <String> -ControlNumberValue <String> -Name <String>
-ResourceGroupName <String> [<CommonParameters>]
DESCRIPTION
This cmdlet is meant to be used in disaster recovery scenarios to validate the presence of a received interchange
control number and optionally to remove that entity with Remove-AzureRmIntegrationAccountReceivedIcn.
PARAMETERS
-AgreementName <String>
The integration account agreement name.
-ControlNumberValue <String>
The integration account control number value.
-Name <String>
The integration account name.
-ResourceGroupName <String>
The integration account resource group name.
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Example 1
PS C:\> Get-AzureRmIntegrationAccountReceivedIcn -ResourceGroupName "groupName" -Name "accountName" -AgreementName
"X12AgreementName" -ControlNumberValue "000000641"
ControlNumber : 000000641
ControlNumberChangedTime : 2/15/2017 12:36:00 AM
This command gets the integration account received interchange control number by agreement name and control number
value.
NAME
Set-AzureRmIntegrationAccountReceivedIcn
SYNOPSIS
Updates the integration account received interchange control number (ICN) in the Azure resource group.
SYNTAX
Set-AzureRmIntegrationAccountReceivedIcn -AgreementName <String> -IsMessageProcessingFailed <Boolean> -Name
<String> -ResourceGroupName <String> [-Confirm] [-WhatIf] -ControlNumberValue <String> [<CommonParameters>]
DESCRIPTION
The Set-AzureRmIntegrationAccountGeneratedIcn cmdlet updates an existing integration account received interchange
control number (ICN) and returns an object that represents the integration account received interchange control
number. Use this cmdlet to update an integration account received interchange control number's message processing
status. You can update an integration account received interchange control number by specifying the integration
account name, resource group name, agreement name, control number value and message processing status. You cannot
create a new integration account received interchange control number with this command. To use the dynamic
parameters, just type them in the command, or type a hyphen sign(-) to indicate a parameter name and then press
the TAB key repeatedly to cycle through the available parameters. If you miss a required template parameter, the
cmdlet prompts you for the value. Template parameter file values that you specify at the command line take
precedence over template parameter values in a template parameter object.
PARAMETERS
-AgreementName <String>
The integration account agreement name.
-IsMessageProcessingFailed <Boolean>
The received message processing status.
-Name <String>
The integration account name.
-ResourceGroupName <String>
The integration account resource group name.
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.
-ControlNumberValue <String>
The integration account control number value.
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Example 1
PS C:\> Set-AzureRmIntegrationAccountGeneratedIcn -ResourceGroupName "ResourceGroup1" -Name "IntegrationAccount1"
-AgreementName "IntegrationAccountAgreement1" -ControlNumber "123" -IsMessageProcessingFailed $true
ControlNumber : 1100
ControlNumberChangedTime : 2/15/2017 12:36:00 AM
IsMessageProcessingFailed : true
This command updates the integration account received interchange control number for a specific integration
account agreement and value with message processing status failed.
NAME
Remove-AzureRmIntegrationAccountReceivedIcn
SYNOPSIS
This cmdlet removes a specific received interchange control number per agreement and control number value.
SYNTAX
Remove-AzureRmIntegrationAccountReceivedIcn -AgreementName <String> -ControlNumberValue <String> -Name <String>
-ResourceGroupName <String> [-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
This cmdlet is meant to be used in disaster recovery scenarios to remove a received interchange control number
from the integration account so that the B2B connector may process again the message when duplicate number
detection is enabled. In rare occasions the received interchange control number may be reserved shortly before a
disaster and before the B2B connector rejects the interchange as erroneous. In such occasions the operation may
want to enable the recovery site to process again the same interchange after its payload is corrected.
PARAMETERS
-AgreementName <String>
The integration account agreement name.
-ControlNumberValue <String>
The integration account control number value.
-Name <String>
The integration account name.
-ResourceGroupName <String>
The integration account resource group name.
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Example 1
PS C:\> Get-AzureRmIntegrationAccountReceivedIcn -ResourceGroupName "groupName" -Name "accountName" -AgreementName
"X12AgreementName" -ControlNumberValue "000000641"
Get-AzureRmIntegrationAccountReceivedIcn : The existing recevied control number '000000641' for agreement
'X12AgreementName' is not in a valid format.
At line:1 char:1
+ Get-AzureRmIntegrationAccountReceivedIcn -ResourceGroupName "groupName ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzureRmIntegrationAccountReceivedIcn],
PSInvalidOperationException
+ FullyQualifiedErrorId :
Microsoft.Azure.Commands.LogicApp.Cmdlets.GetAzureIntegrationAccountReceivedIcnCommand
PS C:\> Remove-AzureRmIntegrationAccountReceivedIcn -ResourceGroupName "groupName" -Name "accountName"
-AgreementName "X12AgreementName" -ControlNumberValue "000000641"
PS C:\> Get-AzureRmIntegrationAccountReceivedIcn -ResourceGroupName "groupName" -Name "accountName" -AgreementName
"X12AgreementName" -ControlNumberValue "000000641"
Get-AzureRmIntegrationAccountReceivedIcn : The session 'X12-ICN-X12AgreementName-000000641' could not be found in
integration account 'accountName'.
At line:1 char:1
+ Get-AzureRmIntegrationAccountReceivedIcn -ResourceGroupName "groupName ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzureRmIntegrationAccountReceivedIcn], CloudException
+ FullyQualifiedErrorId :
Microsoft.Azure.Commands.LogicApp.Cmdlets.GetAzureIntegrationAccountReceivedIcnCommand
Attempts to get a received interchange control number which content is not in a valid format. Removes the received
interchange control number. Confirms the received interchange control number was removed by attempting to get it
again.
NAME
Get-AzureRmIntegrationAccountGeneratedIcn
SYNOPSIS
This cmdlet retrieves the current value of the generated interchange control number per agreement.
SYNTAX
Get-AzureRmIntegrationAccountGeneratedIcn [-AgreementName <String>] -Name <String> -ResourceGroupName <String>
[<CommonParameters>]
DESCRIPTION
This cmdlet is meant to be used in disaster recovery scenarios to retrieve the current value of the generated
interchange control number so to write back an increased value with Set-AzureRmIntegrationAccountGeneratedIcn. The
interchange control number should be increased to avoid duplicate interchange control numbers for the numbers that
could not yet be replicated to the passive region when the disaster happened in the active region.
PARAMETERS
-AgreementName <String>
The integration account agreement name.
-Name <String>
The integration account name.
-ResourceGroupName <String>
The integration account resource group name.
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Example 1
PS C:\> Get-AzureRmIntegrationAccountGeneratedIcn -ResourceGroupName "ResourceGroup1" -Name "IntegrationAccount1"
-AgreementName "IntegrationAccountAgreement1"
ControlNumber : 1000
ControlNumberChangedTime : 2/15/2017 12:36:00 AM
This command gets the integration account generated interchange control number by agreement name.
Example 2
PS C:\> Get-AzureRmIntegrationAccountGeneratedIcn -ResourceGroupName "ResourceGroup1" -Name "IntegrationAccount1"
ControlNumber : 1000
ControlNumberChangedTime : 2/22/2017 8:05:41 PM
AgreementName : onesdk4351
ControlNumber : 1000
ControlNumberChangedTime : 2/22/2017 8:05:41 PM
AgreementName : onesdk4619
ControlNumber : No generated control number was found for this agreement.
ControlNumberChangedTime : 1/1/0001 12:00:00 AM
AgreementName : onesdk6720
This command gets all the generated interchange control numbers by integration account name.
NAME
Set-AzureRmIntegrationAccountGeneratedIcn
SYNOPSIS
Updates the integration account generated interchange control number (ICN) in the Azure resource group.
SYNTAX
Set-AzureRmIntegrationAccountGeneratedIcn -AgreementName <String> [-Confirm] -ControlNumber <String> -Name
<String> -ResourceGroupName <String> [-WhatIf] [<CommonParameters>]
DESCRIPTION
The Set-AzureRmIntegrationAccountGeneratedIcn cmdlet updates an existing integration account generated interchange
control number (ICN) and returns an object that represents the integration account generated interchange control
number. Use this cmdlet to update an integration account generated interchange control number. You can update an
integration account generated interchange control number by specifying the integration account name, resource
group name and agreement name. You cannot create a new integration account generated interchange control number
with this command. To use the dynamic parameters, just type them in the command, or type a hyphen sign(-) to
indicate a parameter name and then press the TAB key repeatedly to cycle through the available parameters. If you
miss a required template parameter, the cmdlet prompts you for the value. Template parameter file values that you
specify at the command line take precedence over template parameter values in a template parameter object.
PARAMETERS
-AgreementName <String>
The integration account agreement name.
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
-ControlNumber <String>
The generated control number new value.
-Name <String>
The integration account name.
-ResourceGroupName <String>
The integration account resource group name.
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Example 1
PS C:\> $resourceGroup.ResourceGroupName = "ResourceGroup1"
PS C:\> $integrationAccountName = "IntegrationAccount1"
PS C:\> $integrationAccountAgreementName = "IntegrationAccountAgreement1"
PS C:\> $initialControlNumber = Get-AzureRmIntegrationAccountGeneratedIcn -ResourceGroupName
$resourceGroup.ResourceGroupName -Name $integrationAccountName -AgreementName $integrationAccountAgreementName
PS C:\> $incrementedControlNumberValue =
[convert]::ToString([convert]::ToInt32($initialControlNumber.ControlNumber, 10) + 100, 10)
PS C:\> Set-AzureRmIntegrationAccountGeneratedIcn -ResourceGroupName $resourceGroup.ResourceGroupName -Name
$integrationAccountName -AgreementName $integrationAccountAgreementName -ControlNumber
$incrementedControlNumberValue
ControlNumber : 1100
ControlNumberChangedTime : 2/15/2017 12:36:00 AM
This command gets the integration account generated interchange control number for a specific integration account
agreement, increase its value by 100 then writes back the updated value.
Comments
- Anonymous
April 12, 2017
Adding the link to Azure PowerShell 3.7.0 https://www.powershellgallery.com/packages/Azure/3.7.0You can install it within PowerShell using the command:Install-Module -Name Azure -RequiredVersion 3.7.0 - Anonymous
May 20, 2019
Partial content from this post which are not available on published documentation has been replicated to https://www.linkedin.com/pulse/azure-logic-apps-b2b-connectors-disaster-recovery-paging-david-burgThis blog may be taken down as part of the MSDN blog changes. - Anonymous
June 20, 2019
This blog has been moved off the MSDN platform. Find further content and update at https://www.linkedin.com/today/author/daviburgComments are locked as part of the blog migration, so please reach out to your customer support contact for assistance with Microsoft products and services.