diff --git a/Services/AlphabetPartitions/Alphabet.Processing/Alphabet.Processing.csproj b/Services/AlphabetPartitions/Alphabet.Processing/Alphabet.Processing.csproj index 9559c24..3b656d9 100644 --- a/Services/AlphabetPartitions/Alphabet.Processing/Alphabet.Processing.csproj +++ b/Services/AlphabetPartitions/Alphabet.Processing/Alphabet.Processing.csproj @@ -9,10 +9,11 @@ Properties Alphabet.Processing Alphabet.Processing - v4.5.1 + v4.8 512 true + True true diff --git a/Services/AlphabetPartitions/Alphabet.Processing/App.config b/Services/AlphabetPartitions/Alphabet.Processing/App.config index e4ee724..c0c3aed 100644 --- a/Services/AlphabetPartitions/Alphabet.Processing/App.config +++ b/Services/AlphabetPartitions/Alphabet.Processing/App.config @@ -1,6 +1,6 @@ - + diff --git a/Services/AlphabetPartitions/Alphabet.Processing/packages.config b/Services/AlphabetPartitions/Alphabet.Processing/packages.config index 9f50716..1c77d29 100644 --- a/Services/AlphabetPartitions/Alphabet.Processing/packages.config +++ b/Services/AlphabetPartitions/Alphabet.Processing/packages.config @@ -1,6 +1,6 @@  - - - + + + \ No newline at end of file diff --git a/Services/AlphabetPartitions/Alphabet.Web/Alphabet.Web.csproj b/Services/AlphabetPartitions/Alphabet.Web/Alphabet.Web.csproj index 33b15b9..6bd906e 100644 --- a/Services/AlphabetPartitions/Alphabet.Web/Alphabet.Web.csproj +++ b/Services/AlphabetPartitions/Alphabet.Web/Alphabet.Web.csproj @@ -9,10 +9,11 @@ Properties Alphabet.Web Alphabet.Web - v4.5.1 + v4.8 512 true + True true diff --git a/Services/AlphabetPartitions/Alphabet.Web/App.config b/Services/AlphabetPartitions/Alphabet.Web/App.config index e4ee724..c0c3aed 100644 --- a/Services/AlphabetPartitions/Alphabet.Web/App.config +++ b/Services/AlphabetPartitions/Alphabet.Web/App.config @@ -1,6 +1,6 @@ - + diff --git a/Services/AlphabetPartitions/Alphabet.Web/packages.config b/Services/AlphabetPartitions/Alphabet.Web/packages.config index 47268e9..1880f21 100644 --- a/Services/AlphabetPartitions/Alphabet.Web/packages.config +++ b/Services/AlphabetPartitions/Alphabet.Web/packages.config @@ -1,7 +1,7 @@  - - - - + + + + \ No newline at end of file diff --git a/Services/AlphabetPartitions/AlphabetPartitions/AlphabetPartitions.sfproj b/Services/AlphabetPartitions/AlphabetPartitions/AlphabetPartitions.sfproj index 75d7443..602203e 100644 --- a/Services/AlphabetPartitions/AlphabetPartitions/AlphabetPartitions.sfproj +++ b/Services/AlphabetPartitions/AlphabetPartitions/AlphabetPartitions.sfproj @@ -1,9 +1,11 @@  - + ac80cdb2-9dd0-4cfc-91bd-f8449c83295f - 1.2 + 2.1 + 1.7.6 + 1.5 @@ -37,5 +39,9 @@ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Service Fabric Tools\Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.targets - + + + + + \ No newline at end of file diff --git a/Services/AlphabetPartitions/AlphabetPartitions/Scripts/Deploy-FabricApplication.ps1 b/Services/AlphabetPartitions/AlphabetPartitions/Scripts/Deploy-FabricApplication.ps1 index f3954db..2897b10 100644 --- a/Services/AlphabetPartitions/AlphabetPartitions/Scripts/Deploy-FabricApplication.ps1 +++ b/Services/AlphabetPartitions/AlphabetPartitions/Scripts/Deploy-FabricApplication.ps1 @@ -14,7 +14,7 @@ Path to the file containing the publish profile. .PARAMETER ApplicationPackagePath Path to the folder of the packaged Service Fabric application. -.PARAMETER DeloyOnly +.PARAMETER DeployOnly Indicates that the Service Fabric application should not be created or upgraded after registering the application type. .PARAMETER ApplicationParameter @@ -25,7 +25,7 @@ Indicates whether to unregister any unused application versions that exist after .PARAMETER OverrideUpgradeBehavior Indicates the behavior used to override the upgrade settings specified by the publish profile. -'None' indicates that the upgrade settings will not be overriden. +'None' indicates that the upgrade settings will not be overridden. 'ForceUpgrade' indicates that an upgrade will occur with default settings, regardless of what is specified in the publish profile. 'VetoUpgrade' indicates that an upgrade will not occur, regardless of what is specified in the publish profile. @@ -44,6 +44,9 @@ Switch signaling whether the package should be validated or not before deploymen .PARAMETER SecurityToken A security token for authentication to cluster management endpoints. Used for silent authentication to clusters that are protected by Azure Active Directory. +.PARAMETER CopyPackageTimeoutSec +Timeout in seconds for copying application package to image store. + .EXAMPLE . Scripts\Deploy-FabricApplication.ps1 -ApplicationPackagePath 'pkg\Debug' @@ -92,7 +95,10 @@ Param $SkipPackageValidation, [String] - $SecurityToken + $SecurityToken, + + [int] + $CopyPackageTimeoutSec ) function Read-XmlElementAsHashtable @@ -133,6 +139,7 @@ function Read-PublishProfile $publishProfile.ClusterConnectionParameters = Read-XmlElementAsHashtable $publishProfileXml.PublishProfile.Item("ClusterConnectionParameters") $publishProfile.UpgradeDeployment = Read-XmlElementAsHashtable $publishProfileXml.PublishProfile.Item("UpgradeDeployment") + $publishProfile.CopyPackageParameters = Read-XmlElementAsHashtable $publishProfileXml.PublishProfile.Item("CopyPackageParameters") if ($publishProfileXml.PublishProfile.Item("UpgradeDeployment")) { @@ -190,6 +197,29 @@ Import-Module "$ModuleFolderPath\ServiceFabricSDK.psm1" $IsUpgrade = ($publishProfile.UpgradeDeployment -and $publishProfile.UpgradeDeployment.Enabled -and $OverrideUpgradeBehavior -ne 'VetoUpgrade') -or $OverrideUpgradeBehavior -eq 'ForceUpgrade' +$PublishParameters = @{ + 'ApplicationPackagePath' = $ApplicationPackagePath + 'ApplicationParameterFilePath' = $publishProfile.ApplicationParameterFile + 'ApplicationParameter' = $ApplicationParameter + 'ErrorAction' = 'Stop' +} + +if ($publishProfile.CopyPackageParameters.CopyPackageTimeoutSec) +{ + $PublishParameters['CopyPackageTimeoutSec'] = $publishProfile.CopyPackageParameters.CopyPackageTimeoutSec +} + +if ($publishProfile.CopyPackageParameters.CompressPackage) +{ + $PublishParameters['CompressPackage'] = $publishProfile.CopyPackageParameters.CompressPackage +} + +# CopyPackageTimeoutSec parameter overrides the value from the publish profile +if ($CopyPackageTimeoutSec) +{ + $PublishParameters['CopyPackageTimeoutSec'] = $CopyPackageTimeoutSec +} + if ($IsUpgrade) { $Action = "RegisterAndUpgrade" @@ -206,7 +236,11 @@ if ($IsUpgrade) $UpgradeParameters = @{ UnmonitoredAuto = $true; Force = $true } } - Publish-UpgradedServiceFabricApplication -ApplicationPackagePath $ApplicationPackagePath -ApplicationParameterFilePath $publishProfile.ApplicationParameterFile -Action $Action -UpgradeParameters $UpgradeParameters -ApplicationParameter $ApplicationParameter -UnregisterUnusedVersions:$UnregisterUnusedApplicationVersionsAfterUpgrade -ErrorAction Stop + $PublishParameters['Action'] = $Action + $PublishParameters['UpgradeParameters'] = $UpgradeParameters + $PublishParameters['UnregisterUnusedVersions'] = $UnregisterUnusedApplicationVersionsAfterUpgrade + + Publish-UpgradedServiceFabricApplication @PublishParameters } else { @@ -215,6 +249,10 @@ else { $Action = "Register" } + + $PublishParameters['Action'] = $Action + $PublishParameters['OverwriteBehavior'] = $OverwriteBehavior + $PublishParameters['SkipPackageValidation'] = $SkipPackageValidation - Publish-NewServiceFabricApplication -ApplicationPackagePath $ApplicationPackagePath -ApplicationParameterFilePath $publishProfile.ApplicationParameterFile -Action $Action -ApplicationParameter $ApplicationParameter -OverwriteBehavior $OverwriteBehavior -SkipPackageValidation:$SkipPackageValidation -ErrorAction Stop + Publish-NewServiceFabricApplication @PublishParameters } \ No newline at end of file diff --git a/Services/AlphabetPartitions/AlphabetPartitions/packages.config b/Services/AlphabetPartitions/AlphabetPartitions/packages.config index 2c11cca..940f225 100644 --- a/Services/AlphabetPartitions/AlphabetPartitions/packages.config +++ b/Services/AlphabetPartitions/AlphabetPartitions/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Services/AlphabetPartitions/README.md b/Services/AlphabetPartitions/README.md index 8585b56..f410b0b 100644 --- a/Services/AlphabetPartitions/README.md +++ b/Services/AlphabetPartitions/README.md @@ -4,7 +4,9 @@ Alphabet partitions is an intro to partitioning stateful services in Service Fab To run this services: -1. Open the .sln solution file in Visual Studio 2015 +1. Open the .sln solution file in Visual Studio 2019 or 2022 +2. Install latest runtime and SDK from here: https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started +3. Set AlphabetPartitions as Startup Project 2. Press F5 to run You can access the application in a web browser by going to: