Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update versions #92

Open
wants to merge 1 commit into
base: classic
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Alphabet.Processing</RootNamespace>
<AssemblyName>Alphabet.Processing</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
<IsServiceFabricServiceProject>True</IsServiceFabricServiceProject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
2 changes: 1 addition & 1 deletion Services/AlphabetPartitions/Alphabet.Processing/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.ServiceFabric" version="5.2.207" targetFramework="net451" />
<package id="Microsoft.ServiceFabric.Data" version="2.2.207" targetFramework="net451" />
<package id="Microsoft.ServiceFabric.Services" version="2.2.207" targetFramework="net451" />
<package id="Microsoft.ServiceFabric" version="9.1.1653" targetFramework="net472" />
<package id="Microsoft.ServiceFabric.Data" version="6.1.1653" targetFramework="net472" />
<package id="Microsoft.ServiceFabric.Services" version="6.1.1653" targetFramework="net472" />
</packages>
3 changes: 2 additions & 1 deletion Services/AlphabetPartitions/Alphabet.Web/Alphabet.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Alphabet.Web</RootNamespace>
<AssemblyName>Alphabet.Web</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
<IsServiceFabricServiceProject>True</IsServiceFabricServiceProject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
2 changes: 1 addition & 1 deletion Services/AlphabetPartitions/Alphabet.Web/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
8 changes: 4 additions & 4 deletions Services/AlphabetPartitions/Alphabet.Web/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.ServiceFabric" version="5.2.207" targetFramework="net451" />
<package id="Microsoft.ServiceFabric.Data" version="2.2.207" targetFramework="net451" />
<package id="Microsoft.ServiceFabric.Services" version="2.2.207" targetFramework="net451" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net451" />
<package id="Microsoft.ServiceFabric" version="9.1.1653" targetFramework="net472" />
<package id="Microsoft.ServiceFabric.Data" version="6.1.1653" targetFramework="net472" />
<package id="Microsoft.ServiceFabric.Services" version="6.1.1653" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net45" />
</packages>
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.2.0\build\Microsoft.VisualStudio.Azure.Fabric.Application.props" Condition="Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.2.0\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" />
<Import Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props" Condition="Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" />
<PropertyGroup Label="Globals">
<ProjectGuid>ac80cdb2-9dd0-4cfc-91bd-f8449c83295f</ProjectGuid>
<ProjectVersion>1.2</ProjectVersion>
<ProjectVersion>2.1</ProjectVersion>
<SupportedMSBuildNuGetPackageVersion>1.7.6</SupportedMSBuildNuGetPackageVersion>
<MinToolsVersion>1.5</MinToolsVersion>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
Expand Down Expand Up @@ -37,5 +39,9 @@
<ApplicationProjectTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Service Fabric Tools\Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.targets</ApplicationProjectTargetsPath>
</PropertyGroup>
<Import Project="$(ApplicationProjectTargetsPath)" Condition="Exists('$(ApplicationProjectTargetsPath)')" />
<Import Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.2.0\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.2.0\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" />
<Import Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" />
<Target Name="ValidateMSBuildFiles" BeforeTargets="PrepareForBuild">
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" Text="Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" Text="Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.6\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand All @@ -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'

Expand Down Expand Up @@ -92,7 +95,10 @@ Param
$SkipPackageValidation,

[String]
$SecurityToken
$SecurityToken,

[int]
$CopyPackageTimeoutSec
)

function Read-XmlElementAsHashtable
Expand Down Expand Up @@ -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"))
{
Expand Down Expand Up @@ -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"
Expand All @@ -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
{
Expand All @@ -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
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.VisualStudio.Azure.Fabric.MSBuild" version="1.2.0" />
<package id="Microsoft.VisualStudio.Azure.Fabric.MSBuild" version="1.7.6" targetFramework="net472" />
</packages>
4 changes: 3 additions & 1 deletion Services/AlphabetPartitions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down