Hello,
We use a self-hosted agent to deploy to the service fabric cluster. We are trying to override the application name during publishing using ‘Deploy-FabricApplication.ps1’. However when using Publish-NewServiceFabricApplication with “RegisterAndUpgrade” and setting ApplicationName as a parameter results in the following error. But it works fine when using the action “RegisterAndCreate”
Error :
InvalidArgument: Parameter set cannot be resolved using the specified named parameters.
November 4th 2022 00:31:30Error
At F:\Octopus Deploy\Home\Work\20221104052944-221922-2291\staging\Octopus.FunctionAppenderContext.ps1:211 char:1
November 4th 2022 00:31:30Error
- Invoke-Expression “.
"$OctopusFunctionAppenderTargetScript
” $Octopu …
November 4th 2022 00:31:30ErrorNovember 4th 2022 00:31:30Error
at , F:\Octopus Deploy\Home\Work\20221104052944-221922-2291\staging\OctopusDeploy-FabricApplication.ps1: line 748
November 4th 2022 00:31:30Error
at , : line 1
November 4th 2022 00:31:30Error
at , F:\Octopus Deploy\Home\Work\20221104052944-221922-2291\staging\Octopus.FunctionAppenderContext.ps1: line 211
November 4th 2022 00:31:30Error
at , : line 1
November 4th 2022 00:31:30Error
at , F:\Octopus Deploy\Home\Work\20221104052944-221922-2291\staging\Octopus.AzureContext.ps1: line 243
November 4th 2022 00:31:30Error
at , F:\Octopus Deploy\Home\Work\20221104052944-221922-2291\staging\Bootstrap.Octopus.AzureContext.ps1: line 3141
November 4th 2022 00:31:30Error
at , : line 1
November 4th 2022 00:31:30Error
at , : line 1
November 4th 2022 00:31:30Error
Running rollback behaviours…
November 4th 2022 00:31:31Error
Script returned non-zero exit code: 1.
November 4th 2022 00:31:31Fatal
The remote script failed with exit code 1
November 4th 2022 00:31:31Fatal
The action Deploy Renweb Identity4App to US-East on the Octopus Server failed
Script snippet :
$PublishParameters[‘ApplicationName’] = $ApplicationName
Works :
$Action = “RegisterAndCreate”
$PublishParameters[‘Action’] = $Action
…
Publish-NewServiceFabricApplication @PublishParameters
Does not work :
$Action = “RegisterAndUpgrade”
$PublishParameters[‘Action’] = $Action
…
Publish-NewServiceFabricApplication @PublishParameters
Publish-UpgradedServiceFabricApplication -ApplicationName $ApplicationName -ApplicationPackagePath $ApplicationPackagePath -ApplicationParameterFilePath $publishProfile.ApplicationParameterFile -Action $Action -UpgradeParameters $UpgradeParameters -ApplicationParameter $ApplicationParameter -UnregisterUnusedVersions:$UnregisterUnusedApplicationVersionsAfterUpgrade -ErrorAction Stop
Was hoping to get a link to some document on how we can override the application name during upgrade mode