Skip to content

Commit

Permalink
Merge pull request #749 from msalemcode/msalem/add_8lts_support
Browse files Browse the repository at this point in the history
Upgrade to Dotnet 8TLS
  • Loading branch information
santhoshb-msft authored Aug 29, 2024
2 parents 31c7abd + 4052fec commit 9ce5725
Show file tree
Hide file tree
Showing 18 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
CUSTOMER_PROJECT: './src/CustomerSite/CustomerSite.csproj'
PUBLISHER_PROJECT: './src/AdminSite/AdminSite.csproj'
SERVICES_TEST_PROJECT: './src/Services.Test/Services.Test.csproj'
DOTNET_CORE_VERSION: '6.0.x'
DOTNET_CORE_VERSION: '8.0.303'

jobs:
BuildApps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ env:
CUSTOMER_AZURE_WEBAPP_PACKAGE_PATH: './src/Marketplace.SaaS.Accelerator.CustomerSite/publish'
PUBLISHER_AZURE_WEBAPP_PACKAGE_PATH: './src/Marketplace.SaaS.Accelerator.AdminSite/publish'
SQLSCRIPT_PATH: './src/Marketplace.SaaS.Accelerator.AdminSite/publish'
DOTNET_CORE_VERSION: '6.0.x'
DOTNET_CORE_VERSION: '8.0.303'

jobs:
deployandtest:
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
shell: pwsh
run: |
Write-Host "dotnet tools restore"
dotnet tool install --global dotnet-ef --version 6.0.1
dotnet tool install --global dotnet-ef --version 8.0.0
Write-Host "Set to the Admin site connection string"
$sqlServerName = "${{ secrets.SQL_SERVER_NAME }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ This project accelerates the SaaS offer onboarding experience for those building

**Video instructions** Additionally, there is a quick video on the installation process. [Installing the SaaS Accelerator with the Azure portal cloud shell](https://go.microsoft.com/fwlink/?linkid=2196326) available through [Mastering the Marketplace](https://microsoft.github.io/Mastering-the-Marketplace).

**[Upgrade to newer version](./docs/Installation-Instructions.md#update-to-a-newer-version-of-the-saas-accelerator)** Follow these instructions to move your 6.x release to the current version.
**[Upgrade to newer version](./docs/Installation-Instructions.md#update-to-a-newer-version-of-the-saas-accelerator)** Follow these instructions to move your release to the current version.

### Additional technical documents

Expand Down Expand Up @@ -111,7 +111,7 @@ The source `/src` directory contains the following Visual Studio projects.

| Project | Description | Directory Name |
| --- | --- | --- |
| [**Customer portal - Sample web application**](./src/CustomerSite) | Demonstrates how to register, provision, and activate the marketplace subscription. Implemented using ASP.Net Core 6.0, the sample web application uses the Services client library and data access library to invoke and persist API interactions and provides an example user interface to demonstrate how a customer would manage their subscriptions and plans. |CustomerSite|
| [**Customer portal - Sample web application**](./src/CustomerSite) | Demonstrates how to register, provision, and activate the marketplace subscription. Implemented using ASP.Net Core 8.0, the sample web application uses the Services client library and data access library to invoke and persist API interactions and provides an example user interface to demonstrate how a customer would manage their subscriptions and plans. |CustomerSite|
| [**Publisher portal - Sample web application**](./src/AdminSite) | Demonstrates how to generate usage events used in metered billing transactions, and how to emit these events to the Marketplace Metering Service API. |AdminSite|
| [**Client data access library**](./src/DataAccess) | Demonstrates how to persist plans, marketplace subscriptions, and related transaction attributes when using the SaaS Fulfillment API (v2) and Marketplace Metering Service API. |DataAccess |
| [**Services client library**](./src/Services) | Contains the services used by the Customer and Publisher portals, including the POCO classes to orchestrate calls to the marketplace APIs on [client library](https://github.com/microsoft/commercial-marketplace-client-dotnet) / database.|Services |
Expand All @@ -125,8 +125,8 @@ The sample code in this repository runs in the publisher's environment as illust

This project has been developed using the following technologies and versions:

- [.NET 6](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
- [ASP.NET Core Runtime 6](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
- [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
- [ASP.NET Core Runtime 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
- [Entity Framework](https://docs.microsoft.com/ef/)

## Security
Expand All @@ -140,7 +140,7 @@ Ensure the following prerequisites are met before getting started:
- You must have an active Azure subscription for development and testing purposes. Create an Azure subscription [here](https://azure.microsoft.com/free/).
- You must have a Partner Center account enabled for use with the commercial marketplace. Create an account [here](https://docs.microsoft.com/azure/marketplace/partner-center-portal/create-account).
- We recommend using an Integrated Development Environment (IDE): [Visual Studio Code](https://code.visualstudio.com/), [Visual Studio 2019 / 2022](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16#), etc...
- The SaaS Accelerator has been implemented using [.NET 6](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
- The SaaS Accelerator has been implemented using [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
- For data persistence we are using [Azure SQL Database](https://azure.microsoft.com/services/sql-database/) and [Entity Framework](https://docs.microsoft.com/ef/). However, feel free to use any data repository you are comfortable with.

## Contributing
Expand Down
10 changes: 5 additions & 5 deletions deployment/Deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ if(!($KeyVault -match "^[a-zA-Z][a-z0-9-]+$")) {

#region pre-checks

# check if dotnet 6 is installed
# check if dotnet 8 is installed

$dotnetversion = dotnet --version

if(!$dotnetversion.StartsWith('6.')) {
Throw "🛑 Dotnet 6 not installed. Install dotnet6 and re-run the script."
if(!$dotnetversion.StartsWith('8.')) {
Throw "🛑 Dotnet 8 not installed. Install dotnet8 and re-run the script."
Exit
}

Expand Down Expand Up @@ -543,7 +543,7 @@ az appservice plan create -g $ResourceGroupForDeployment -n $WebAppNameService -

Write-host " 🔵 Admin Portal WebApp"
Write-host " ➡️ Create Web App"
az webapp create -g $ResourceGroupForDeployment -p $WebAppNameService -n $WebAppNameAdmin --runtime dotnet:6 --output $azCliOutput
az webapp create -g $ResourceGroupForDeployment -p $WebAppNameService -n $WebAppNameAdmin --runtime dotnet:8 --output $azCliOutput
Write-host " ➡️ Assign Identity"
$WebAppNameAdminId = az webapp identity assign -g $ResourceGroupForDeployment -n $WebAppNameAdmin --identities [system] --query principalId -o tsv
Write-host " ➡️ Setup access to KeyVault"
Expand All @@ -555,7 +555,7 @@ az webapp config set -g $ResourceGroupForDeployment -n $WebAppNameAdmin --always

Write-host " 🔵 Customer Portal WebApp"
Write-host " ➡️ Create Web App"
az webapp create -g $ResourceGroupForDeployment -p $WebAppNameService -n $WebAppNamePortal --runtime dotnet:6 --output $azCliOutput
az webapp create -g $ResourceGroupForDeployment -p $WebAppNameService -n $WebAppNamePortal --runtime dotnet:8 --output $azCliOutput
Write-host " ➡️ Assign Identity"
$WebAppNamePortalId= az webapp identity assign -g $ResourceGroupForDeployment -n $WebAppNamePortal --identities [system] --query principalId -o tsv
Write-host " ➡️ Setup access to KeyVault"
Expand Down
8 changes: 4 additions & 4 deletions docs/Installation-Instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Copy the following section to an editor and update it to match your company pref
``` powershell
wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh; `
chmod +x dotnet-install.sh; `
./dotnet-install.sh -version 6.0.417; `
./dotnet-install.sh -version 8.0.303; `
$ENV:PATH="$HOME/.dotnet:$ENV:PATH"; `
dotnet tool install --global dotnet-ef --version 6.0.1; `
dotnet tool install --global dotnet-ef --version 8.0.0; `
git clone https://github.com/Azure/Commercial-Marketplace-SaaS-Accelerator.git -b 7.6.2 --depth 1; `
cd ./Commercial-Marketplace-SaaS-Accelerator/deployment; `
.\Deploy.ps1 `
Expand Down Expand Up @@ -82,9 +82,9 @@ If you already have deployed the SaaS Accelerator, but you want to update it so
``` powershell
wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh; `
chmod +x dotnet-install.sh; `
./dotnet-install.sh -version 6.0.417; `
./dotnet-install.sh -version 8.0.303; `
$ENV:PATH="$HOME/.dotnet:$ENV:PATH"; `
dotnet tool install --global dotnet-ef --version 6.0.1; `
dotnet tool install --global dotnet-ef --version 8.0.0; `
git clone https://github.com/Azure/Commercial-Marketplace-SaaS-Accelerator.git -b <release-version-branch-to-deploy> --depth 1; `
cd ./Commercial-Marketplace-SaaS-Accelerator/deployment; `
.\Upgrade.ps1 `
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "6.0.417"
"version": "8.0.303"
}
}
21 changes: 11 additions & 10 deletions src/AdminSite/AdminSite.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Authors>Microsoft.Marketplace</Authors>
<Company>Microsoft</Company>
<Product>Marketplace.SaaS.Accelerator</Product>
Expand All @@ -25,18 +25,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.1.3" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.Abstractions" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.1">
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.10.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />

</ItemGroup>

<ItemGroup>
Expand Down
17 changes: 9 additions & 8 deletions src/CustomerSite/CustomerSite.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Authors>Microsoft.Marketplace</Authors>
<Company>Microsoft</Company>
<Product>Marketplace.SaaS.Accelerator</Product>
Expand All @@ -25,16 +25,17 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.Abstractions" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.1.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.1">
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.10.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />

</ItemGroup>

<ItemGroup>
Expand All @@ -52,4 +53,4 @@
<Folder Include="Properties\PublishProfiles\" />
<Folder Include="Properties\ServiceDependencies\" />
</ItemGroup>
</Project>
</Project>
3 changes: 2 additions & 1 deletion src/DataAccess/Context/SaasKitContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{

//dotnet 8lts require this line
optionsBuilder.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=Test");
}
}

Expand Down
13 changes: 7 additions & 6 deletions src/DataAccess/DataAccess.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Authors>Microsoft.Marketplace</Authors>
<Company>Microsoft</Company>
<Product>Marketplace.SaaS.Accelerator</Product>
Expand All @@ -14,13 +14,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PackageReference Include="Azure.Identity" Version="1.11.4" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
</Project>
7 changes: 2 additions & 5 deletions src/DataAccess/Migrations/Custom/BaselineV2_Seed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,7 @@ IF NOT EXISTS (SELECT * FROM ApplicationConfiguration WHERE Name = 'FaviconFile'
INSERT INTO ApplicationConfiguration (Name,Value,Description)
VALUES ('FaviconFile','','Favicon File')
END
GO
");
GO");
migrationBuilder.Sql(@$"
INSERT INTO EmailTemplate
([Status],[Description],[InsertDate],[TemplateBody],[Subject],[IsActive])
Expand Down Expand Up @@ -667,7 +666,5 @@ INSERT INTO EmailTemplate
</center>
</body>
</html>
";

}
";}
}
3 changes: 1 addition & 2 deletions src/DataAccess/Migrations/Custom/BaselineV6_Seed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ INSERT [dbo].[ApplicationConfiguration] ( [Name], [Value], [Description]) VALUES
INSERT [dbo].[ApplicationConfiguration] ( [Name], [Value], [Description]) VALUES ( N'EnableMonthlyMeterSchedules', N'False', N'This will enable to run Monthly meter scheduled items')
INSERT [dbo].[ApplicationConfiguration] ( [Name], [Value], [Description]) VALUES ( N'EnableYearlyMeterSchedules', N'False', N'This will enable to run Yearly meter scheduled items')
INSERT [dbo].[ApplicationConfiguration] ( [Name], [Value], [Description]) VALUES ( N'EnableOneTimeMeterSchedules', N'False', N'This will enable to run OneTime meter scheduled items')
GO
");
GO");
}
}
}
8 changes: 4 additions & 4 deletions src/MeteredTriggerJob/MeteredTriggerJob.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk;Microsoft.NET.Sdk.Publish">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Authors>Microsoft.Marketplace</Authors>
<Company>Microsoft</Company>
<Product>Marketplace.SaaS.Accelerator</Product>
Expand All @@ -14,9 +14,9 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Services\Services.csproj" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
Expand Down
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The following components are included in this directory:

| Project | Description | Directory Name |
| --- | --- | --- |
| [**Customer portal - Sample web application**](./CustomerSite) | Demonstrates how to register, provision, and activate the marketplace subscription. Implemented using ASP.Net Core 6.0, the sample web application uses the Services client library and data access library to invoke and persist API interactions and provides an example user interface to demonstrate how a customer would manage their subscriptions and plans. |CustomerSite |
| [**Customer portal - Sample web application**](./CustomerSite) | Demonstrates how to register, provision, and activate the marketplace subscription. Implemented using ASP.Net Core 8.0, the sample web application uses the Services client library and data access library to invoke and persist API interactions and provides an example user interface to demonstrate how a customer would manage their subscriptions and plans. |CustomerSite |
| [**Publisher portal - Sample web application**](./AdminSite) | Demonstrates how to generate usage events used in metered billing transactions, and how to emit these events to the Marketplace Metering Service API. | AdminSite |
| [**Client data access library**](./DataAccess) | Demonstrates how to persist plans, marketplace subscriptions, and related transaction attributes when using the SaaS Fulfillment API (v2) and Marketplace Metering Service API. | DataAccess |
| [**Services client library**](./Services) | Contains the services used by the Customer and Publisher portals, including the POCO classes to orchestrate calls to the marketplace APIs on [client library](https://github.com/microsoft/commercial-marketplace-client-dotnet) / database.| Services |
Expand Down
10 changes: 5 additions & 5 deletions src/Services.Test/Services.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Authors>Microsoft.Marketplace</Authors>
<Company>Microsoft</Company>
<Product>Marketplace.SaaS.Accelerator</Product>
Expand All @@ -10,9 +10,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Moq" Version="4.18.3" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
Expand Down Expand Up @@ -40,4 +40,4 @@
</None>
</ItemGroup>

</Project>
</Project>
Loading

0 comments on commit 9ce5725

Please sign in to comment.