none
Remove-Item issue while trying to remove BizTalk applicaiton by using BizTalk PowerShell provider cmdlet

    Question

  • Hi,

    I got the following exception when trying to use PowerShell BizTalk provider to remove BizTalk application:

    Command:

    $status = Remove-Item -Path $BizTalkApplicationName -Recurse

    Exception:

    13/02/2017 4:03:03 PM [ERROR] - Exception: [USM.Common.Patterns.BRE 1.0] Unable to Remove BizTalk
     Application. US-Biztalk-Remove-Application Failed! Caught an Exception in [C:\Dev\Source\UniSupe
    rV2\Development\DevOps\Deployment Scripts\Bamboo Build Script\_SHARED\Pal\US_BizTalk_Admin.psm1]
    at [151] : BizTalkFactory.Management.Automation.BtsException: Unable to commit changes to the Biz
    Talk management database
    Ruleset "USM.Common.ErrorFramework.Configuration.2.0", version 1.0 is not deployed. ---> Microsof
    t.RuleEngine.RuleEngineDeploymentNotDeployedException: Ruleset "USM.Common.ErrorFramework.Configu
    ration.2.0", version 1.0 is not deployed.
       at Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer.SaveChangesWithTransaction(Object transacti
    onObj)
       at BizTalkFactory.Management.Automation.BtsCatalog.SaveChanges()
       --- End of inner exception stack trace ---
       at BizTalkFactory.Management.Automation.BtsCatalog.SaveChanges()
       at BizTalkFactory.Management.Automation.Helper.BtsApplicationHelper.ResetPipelines(BtsApplicat
    ion application)
       at BizTalkFactory.Management.Automation.BtsCatalog.RemoveApplication(BtsApplication applicatio
    n, Boolean recursive)
       at BizTalkFactory.PowerShell.Extensions.Application.RemoveItem(Boolean recurse)
       at BizTalkFactory.PowerShell.Extensions.BizTalkProvider.RemoveItem(String path, Boolean recurs
    e)
       at System.Management.Automation.SessionStateInternal.RemoveItem(CmdletProvider providerInstanc
    e, String path, Boolean recurse, CmdletProviderContext context) [line=139; offset=19] At C:\Dev\S
    ource\UniSuperV2\Development\DevOps\Deployment Scripts\Bamboo Build Script\_SHARED\Pal\US_BizTalk
    _Admin.psm1:139 char:19
    +         $status = Remove-Item -Path $BizTalkApplicationName -Recurse
    +                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    I have checked BRE after the failure and the policy in question is in the 'Published' state (initially it was in the 'Deployed' state). Second run of the same command is removing application successfully including policy.

    Anyone encountered something similar?

    Your help is very much appreciated.

    Thanks,

    Alla

    Monday, February 13, 2017 6:01 AM

Answers

  • Hi Alla,

    If I get that right, you mean the first time you run the command the policy in question is in 'Deployed' state and after executing the command the state changes from 'Deployed' to 'Published' and the second time you execute the command you are successfully able to remove the policy.

    From http://biztalk114.rssing.com/chan-11795895/all_p5.html, it is clear that builtin CmdLet Remove-item supports policies so it means that this is clearly a bug in the product.

    This can be best addressed by the product team and I can see you have already raised this in the right forum here: http://psbiztalk.codeplex.com/workitem/8154. Let them investigate this.


    Rachit Sikroria (Microsoft Azure MVP)

    Thursday, February 16, 2017 4:11 AM
    Moderator

All replies

  • Have I posted it in a wrong forum or forum is dead?
    Thursday, February 16, 2017 2:49 AM
  • Hi Alla,

    If I get that right, you mean the first time you run the command the policy in question is in 'Deployed' state and after executing the command the state changes from 'Deployed' to 'Published' and the second time you execute the command you are successfully able to remove the policy.

    From http://biztalk114.rssing.com/chan-11795895/all_p5.html, it is clear that builtin CmdLet Remove-item supports policies so it means that this is clearly a bug in the product.

    This can be best addressed by the product team and I can see you have already raised this in the right forum here: http://psbiztalk.codeplex.com/workitem/8154. Let them investigate this.


    Rachit Sikroria (Microsoft Azure MVP)

    Thursday, February 16, 2017 4:11 AM
    Moderator