From 7fb29422938db822f9911ebc305dd146cfd2ad21 Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 14 Jan 2026 14:23:58 +0100 Subject: [PATCH 01/21] first steps : creation of the files needed later --- .github/workflows/deploy-infra-and-apps.yml | 35 +++ backend/Backup/ParkNDeploy.sln | 25 ++ backend/UpgradeLog.htm | 275 ++++++++++++++++++++ infrastructure/main.bicep | 32 +++ infrastructure/modules/appService.bicep | 22 ++ infrastructure/modules/appServicePlan.bicep | 20 ++ 6 files changed, 409 insertions(+) create mode 100644 .github/workflows/deploy-infra-and-apps.yml create mode 100644 backend/Backup/ParkNDeploy.sln create mode 100644 backend/UpgradeLog.htm create mode 100644 infrastructure/main.bicep create mode 100644 infrastructure/modules/appService.bicep create mode 100644 infrastructure/modules/appServicePlan.bicep diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml new file mode 100644 index 00000000..7b6de93d --- /dev/null +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -0,0 +1,35 @@ +on: [push, workflow_dispatch] + +env: + AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} + +jobs: + deploy_infrastructure: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + enable-AzPSSession: true + + - name: Create resource group if not exists + run: | + az group show --name ${{ env.AZURE_RG_NAME }} || + az group create --name ${{ env.AZURE_RG_NAME }} --location ${{ secrets.AZURE_REGION }} + + - name: Deploy bicep + id: bicep_deploy + uses: azure/arm-deploy@v2 + with: + subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} + region: ${{ secrets.AZURE_REGION }} + template: ./infrastructure/main.bicep + parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} + resourceGroupName: ${{ env.AZURE_RG_NAME }} \ No newline at end of file diff --git a/backend/Backup/ParkNDeploy.sln b/backend/Backup/ParkNDeploy.sln new file mode 100644 index 00000000..ad74ef9f --- /dev/null +++ b/backend/Backup/ParkNDeploy.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35312.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ParkNDeploy.Api", "ParkNDeploy.Api\ParkNDeploy.Api.csproj", "{20032B6D-23C2-4CE2-A4F7-0D1E8C477FBD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {20032B6D-23C2-4CE2-A4F7-0D1E8C477FBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20032B6D-23C2-4CE2-A4F7-0D1E8C477FBD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20032B6D-23C2-4CE2-A4F7-0D1E8C477FBD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20032B6D-23C2-4CE2-A4F7-0D1E8C477FBD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {456BA43D-278C-4316-ADEC-FD2A2C8C5A75} + EndGlobalSection +EndGlobal diff --git a/backend/UpgradeLog.htm b/backend/UpgradeLog.htm new file mode 100644 index 00000000..0db19cf1 --- /dev/null +++ b/backend/UpgradeLog.htm @@ -0,0 +1,275 @@ + + + + Rapport de migration +

+ Rapport de migration - ParkNDeploy

Vue d'ensemble

ProjetChemin d'accèsErreursAvertissementsMessages
SolutionParkNDeploy.sln012
ParkNDeploy.ApiParkNDeploy.Api\ParkNDeploy.Api.csproj000

Solution et projets

\ No newline at end of file diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep new file mode 100644 index 00000000..22252465 --- /dev/null +++ b/infrastructure/main.bicep @@ -0,0 +1,32 @@ +targetScope = 'resourceGroup' // We'll deploy the resources in the provided resource group + +// Parameters to easily construct resource names +param location string +param project string + +// Here we'll add an identifier to create a unique name for the App Service Plan, for example your trigram, so that everyone could deploy his own parkndeploy instance +param identifier string + +// Create the AppServicePlan through the AppServicePlan module +module appServicePlan 'modules/appServicePlan.bicep' = { + name: 'appServicePlan' + params: { + location: location + project: project + identifier: identifier + } +} + +// Create the AppService through the AppService module +module appService 'modules/appService.bicep' = { + name: 'appService' + params: { + location: location + project: project + identifier: identifier + planId: appServicePlan.outputs.planId // Use the appServicePlan output to get its id back => an App Service needs to reference its App Service Plan + } +} + +// Export App Service Name +output appServiceName string = appService.outputs.appServiceName \ No newline at end of file diff --git a/infrastructure/modules/appService.bicep b/infrastructure/modules/appService.bicep new file mode 100644 index 00000000..740e0841 --- /dev/null +++ b/infrastructure/modules/appService.bicep @@ -0,0 +1,22 @@ +param location string +param project string +param identifier string + +// App Service Plan identifier that will host our App Service +param planId string + +resource app 'Microsoft.Web/sites@2022-03-01' = { + name: '${project}-app-${identifier}' + location: location + + properties: { + serverFarmId: planId + reserved: true + + siteConfig: { + linuxFxVersion: 'DOTNETCORE|9.0' // Specify to setup the .NET Core 9.0 runtime (used by our backend API) on the Linux machine under the hood + } + } +} + +output appServiceName string = app.name // Export the App Service name for deployment \ No newline at end of file diff --git a/infrastructure/modules/appServicePlan.bicep b/infrastructure/modules/appServicePlan.bicep new file mode 100644 index 00000000..c871995f --- /dev/null +++ b/infrastructure/modules/appServicePlan.bicep @@ -0,0 +1,20 @@ +param location string +param project string +param identifier string + +resource plan 'Microsoft.Web/serverfarms@2022-09-01' = { + name: '${project}-plan-${identifier}' + location: location + + sku: { + name: 'F1' // We use F1 pricing plan (free one) as we don't need specific features + } + + kind: 'app,linux' // Allow to deploy on an App Service using Linux OS + + properties: { + reserved: true // Specifity of App Service with Linux OS + } +} + +output planId string = plan.id // Export the App Service identifier \ No newline at end of file From 7adc23a4b811771e14a04a3f700f5a32ef156bd4 Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 14 Jan 2026 14:51:29 +0100 Subject: [PATCH 02/21] definition de l'environement --- .github/workflows/deploy-infra-and-apps.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 7b6de93d..0b2b15ac 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,11 +1,17 @@ on: [push, workflow_dispatch] +permissions: + # Require write permission to Fetch an OIDC token (required for federated credential) and write it + # It will be automatically used on actions / cli that needs it + id-token: write + env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} jobs: deploy_infrastructure: runs-on: ubuntu-latest + environment: production steps: - name: Checkout repository @@ -32,4 +38,5 @@ jobs: region: ${{ secrets.AZURE_REGION }} template: ./infrastructure/main.bicep parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} - resourceGroupName: ${{ env.AZURE_RG_NAME }} \ No newline at end of file + resourceGroupName: ${{ env.AZURE_RG_NAME }} + From bf20d5425c58c903a67310185c9dfeb2c4fa7c09 Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 14 Jan 2026 15:37:46 +0100 Subject: [PATCH 03/21] remplacement bicep --- infrastructure/main.bicep | 2 +- infrastructure/modules/appService.bicep | 2 +- infrastructure/modules/appServicePlan.bicep | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index 22252465..22bac17a 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -29,4 +29,4 @@ module appService 'modules/appService.bicep' = { } // Export App Service Name -output appServiceName string = appService.outputs.appServiceName \ No newline at end of file +output appServiceName string = appService.outputs.appServiceName diff --git a/infrastructure/modules/appService.bicep b/infrastructure/modules/appService.bicep index 740e0841..40b49099 100644 --- a/infrastructure/modules/appService.bicep +++ b/infrastructure/modules/appService.bicep @@ -19,4 +19,4 @@ resource app 'Microsoft.Web/sites@2022-03-01' = { } } -output appServiceName string = app.name // Export the App Service name for deployment \ No newline at end of file +output appServiceName string = app.name // Export the App Service name for deployment diff --git a/infrastructure/modules/appServicePlan.bicep b/infrastructure/modules/appServicePlan.bicep index c871995f..c9b43403 100644 --- a/infrastructure/modules/appServicePlan.bicep +++ b/infrastructure/modules/appServicePlan.bicep @@ -17,4 +17,4 @@ resource plan 'Microsoft.Web/serverfarms@2022-09-01' = { } } -output planId string = plan.id // Export the App Service identifier \ No newline at end of file +output planId string = plan.id // Export the App Service identifier From 923e59f044bbcfc767b060651735f45b0de1c3ff Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 14 Jan 2026 16:24:07 +0100 Subject: [PATCH 04/21] test --- infrastructure/main.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index 22bac17a..4fcb6e9d 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -28,5 +28,5 @@ module appService 'modules/appService.bicep' = { } } -// Export App Service Name +// Export App Service Name output appServiceName string = appService.outputs.appServiceName From 9739e16faebe4ebe62ed6c9af3b6378be7c49ece Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 14 Jan 2026 16:41:09 +0100 Subject: [PATCH 05/21] =?UTF-8?q?d=C3=A9ploiement=20backend=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-infra-and-apps.yml | 33 +++++++++++++++++++++ infrastructure/main.bicep | 3 ++ 2 files changed, 36 insertions(+) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 0b2b15ac..16e90425 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -13,6 +13,9 @@ jobs: runs-on: ubuntu-latest environment: production + outputs: + appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -40,3 +43,33 @@ jobs: parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} resourceGroupName: ${{ env.AZURE_RG_NAME }} +deploy_backend: + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup .NET SDK 9.0.x + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.x' + + - name: Publish the app + run: dotnet publish -c Release --property:PublishDir=publish # Publish the app to the API project publish folder + working-directory: ./backend # Specify where to find the solution file in repository + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Deploy backend to App Service + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ needs.deploy_infrastructure.outputs.appServiceName }} # Access to the previous job output to get the appServiceName deployed with bicep + package: ./backend/ParkNDeploy.Api/publish # Path to the previously published app diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index 4fcb6e9d..0ecdf731 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -28,5 +28,8 @@ module appService 'modules/appService.bicep' = { } } + + // Export App Service Name output appServiceName string = appService.outputs.appServiceName + From bd6ddf1d8e5220c994d2b96b010bdc2b6d282f1d Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 14 Jan 2026 16:44:19 +0100 Subject: [PATCH 06/21] backend fix --- .github/workflows/deploy-infra-and-apps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 16e90425..fb3e0c1f 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -43,7 +43,7 @@ jobs: parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} resourceGroupName: ${{ env.AZURE_RG_NAME }} -deploy_backend: + deploy_backend: runs-on: ubuntu-latest needs: deploy_infrastructure environment: production From adf3e0bd9e6e54b61ce673b7431bf982f26b7a77 Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 14 Jan 2026 16:45:49 +0100 Subject: [PATCH 07/21] backend fix2 --- .github/workflows/deploy-infra-and-apps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index fb3e0c1f..aed7d3aa 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -43,7 +43,7 @@ jobs: parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} resourceGroupName: ${{ env.AZURE_RG_NAME }} - deploy_backend: + deploy_backend: runs-on: ubuntu-latest needs: deploy_infrastructure environment: production From 75127bc8414ba95dc5985f3038a39328e502f070 Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 14 Jan 2026 16:56:56 +0100 Subject: [PATCH 08/21] deploy frontend --- .github/workflows/deploy-infra-and-apps.yml | 2 +- infrastructure/main.bicep | 11 +++++++++++ infrastructure/modules/staticWebApp.bicep | 16 ++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 infrastructure/modules/staticWebApp.bicep diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index aed7d3aa..8a44d1c9 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -40,7 +40,7 @@ jobs: subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} region: ${{ secrets.AZURE_REGION }} template: ./infrastructure/main.bicep - parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} + parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} swaLocation=${{ secrets.AZURE_SWA_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} resourceGroupName: ${{ env.AZURE_RG_NAME }} deploy_backend: diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index 0ecdf731..8fe4d481 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -3,6 +3,7 @@ targetScope = 'resourceGroup' // We'll deploy the resources in the provided reso // Parameters to easily construct resource names param location string param project string +param swaLocation string // Here we'll add an identifier to create a unique name for the App Service Plan, for example your trigram, so that everyone could deploy his own parkndeploy instance param identifier string @@ -28,8 +29,18 @@ module appService 'modules/appService.bicep' = { } } +module staticWebApp 'modules/staticWebApp.bicep' = { + name: 'staticWebApp' + params: { + location: swaLocation + project: project + identifier: identifier + } +} + // Export App Service Name output appServiceName string = appService.outputs.appServiceName +output staticWebAppName string = staticWebApp.outputs.swaName diff --git a/infrastructure/modules/staticWebApp.bicep b/infrastructure/modules/staticWebApp.bicep new file mode 100644 index 00000000..cd780056 --- /dev/null +++ b/infrastructure/modules/staticWebApp.bicep @@ -0,0 +1,16 @@ +param location string +param project string +param identifier string + +resource swa 'Microsoft.Web/staticSites@2024-04-01' = { + name: '${project}-swa-${identifier}' + location: location + + sku: { + name: 'Free' + } + + properties: {} // Even empty, it's mandatory ... +} + +output swaName string = swa.name // Expose Static Web App name as we did for App Service for deployment purpose From 7747214acf86ef4d01ffd44aee159caf9012270d Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 14 Jan 2026 17:04:10 +0100 Subject: [PATCH 09/21] frontend --- .github/workflows/deploy-infra-and-apps.yml | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 8a44d1c9..8110707d 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -15,6 +15,7 @@ jobs: outputs: appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} + staticWebAppName: ${{ steps.bicep_deploy.outputs.staticWebAppName }} steps: - name: Checkout repository @@ -73,3 +74,31 @@ jobs: with: app-name: ${{ needs.deploy_infrastructure.outputs.appServiceName }} # Access to the previous job output to get the appServiceName deployed with bicep package: ./backend/ParkNDeploy.Api/publish # Path to the previously published app + + deploy_frontend: + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build the app + run: npm install && npm run build + working-directory: ./frontend + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Deploy frontend to Static Web App + uses: azure/static-web-apps-deploy@v1 + with: + app_location: frontend/dist + action: upload + skip_app_build: true + skip_api_build: true \ No newline at end of file From 48464c90d81b5085f1c17f79a6d520427513b275 Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 14 Jan 2026 17:12:05 +0100 Subject: [PATCH 10/21] SWA token --- .github/workflows/deploy-infra-and-apps.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 8110707d..334a0c48 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -94,10 +94,16 @@ jobs: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Get Static Web App deployment token + run: | + SWA_DEPLOYMENT_TOKEN=$(az staticwebapp secrets list -n ${{ needs.deploy_infrastructure.outputs.staticWebAppName }} -o tsv --query properties.apiKey) + echo SWA_DEPLOYMENT_TOKEN=$SWA_DEPLOYMENT_TOKEN >> $GITHUB_ENV - name: Deploy frontend to Static Web App uses: azure/static-web-apps-deploy@v1 with: + azure_static_web_apps_api_token: ${{ env.SWA_DEPLOYMENT_TOKEN }} app_location: frontend/dist action: upload skip_app_build: true From 716ab37e46cc9fa7e0c60c3b55f1893be1cef0f0 Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 14 Jan 2026 17:20:42 +0100 Subject: [PATCH 11/21] link --- infrastructure/main.bicep | 8 ++++++++ infrastructure/modules/appService.bicep | 1 + infrastructure/modules/staticWebApp.bicep | 7 ++++--- infrastructure/modules/staticWebAppBackend.bicep | 11 +++++++++++ 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 infrastructure/modules/staticWebAppBackend.bicep diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index 8fe4d481..1ccbd9d3 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -38,6 +38,14 @@ module staticWebApp 'modules/staticWebApp.bicep' = { } } +module staticWebAppBackend 'modules/staticWebAppBackend.bicep' = { + name: 'staticWebAppBackend' + params: { + backendBindedResourceId: appService.outputs.appServiceId + swaName: staticWebApp.outputs.swaName + location: location + } +} // Export App Service Name diff --git a/infrastructure/modules/appService.bicep b/infrastructure/modules/appService.bicep index 40b49099..dbe7a75b 100644 --- a/infrastructure/modules/appService.bicep +++ b/infrastructure/modules/appService.bicep @@ -20,3 +20,4 @@ resource app 'Microsoft.Web/sites@2022-03-01' = { } output appServiceName string = app.name // Export the App Service name for deployment +output appServiceId string = app.id diff --git a/infrastructure/modules/staticWebApp.bicep b/infrastructure/modules/staticWebApp.bicep index cd780056..0925f696 100644 --- a/infrastructure/modules/staticWebApp.bicep +++ b/infrastructure/modules/staticWebApp.bicep @@ -6,9 +6,10 @@ resource swa 'Microsoft.Web/staticSites@2024-04-01' = { name: '${project}-swa-${identifier}' location: location - sku: { - name: 'Free' - } + sku: { + name: 'Standard' + tier: 'Standard' +} properties: {} // Even empty, it's mandatory ... } diff --git a/infrastructure/modules/staticWebAppBackend.bicep b/infrastructure/modules/staticWebAppBackend.bicep new file mode 100644 index 00000000..4e902770 --- /dev/null +++ b/infrastructure/modules/staticWebAppBackend.bicep @@ -0,0 +1,11 @@ +param backendBindedResourceId string +param swaName string +param location string + +resource staticWebAppBackend 'Microsoft.Web/staticSites/linkedBackends@2022-03-01' = { + name: '${swaName}/backend' + properties: { + backendResourceId: backendBindedResourceId + region: location + } +} From 6fef30b51ff5d7161eaf006e6301a50f3509187a Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 20 Jan 2026 09:47:47 +0100 Subject: [PATCH 12/21] on v* --- .github/workflows/deploy-infra-and-apps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 334a0c48..1ccde74d 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,4 +1,4 @@ -on: [push, workflow_dispatch] +on: [v*, workflow_dispatch] permissions: # Require write permission to Fetch an OIDC token (required for federated credential) and write it From 8704f58910951ce6f2486c70da73a87cfb5c926e Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 20 Jan 2026 09:49:23 +0100 Subject: [PATCH 13/21] retour avant --- .github/workflows/deploy-infra-and-apps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 1ccde74d..334a0c48 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,4 +1,4 @@ -on: [v*, workflow_dispatch] +on: [push, workflow_dispatch] permissions: # Require write permission to Fetch an OIDC token (required for federated credential) and write it From 5337f20200537649624f5158959a4ceed11177f2 Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 20 Jan 2026 10:03:22 +0100 Subject: [PATCH 14/21] on push git tag --- .github/workflows/deploy-infra-and-apps.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 334a0c48..6d1ea41d 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,4 +1,8 @@ -on: [push, workflow_dispatch] +on: + push: + tags: + - 'v[0-9].[0-9].[0-9]' + workflow_dispatch: permissions: # Require write permission to Fetch an OIDC token (required for federated credential) and write it From 518d50e5cbb464d5cf02671b6b2abea9912673fe Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 20 Jan 2026 10:45:54 +0100 Subject: [PATCH 15/21] yml pull request --- .github/workflows/merge-request.yml | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/merge-request.yml diff --git a/.github/workflows/merge-request.yml b/.github/workflows/merge-request.yml new file mode 100644 index 00000000..0a04100c --- /dev/null +++ b/.github/workflows/merge-request.yml @@ -0,0 +1,42 @@ +on: [pull_request] + +permissions: + # Require write permission to Fetch an OIDC token (required for federated credential) and write it + # It will be automatically used on actions / cli that needs it + id-token: write + +jobs: + build_react_app: + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build the app + run: npm install && npm run build + working-directory: ./frontend + + - name: linting script + run: npm run lint + working-directory: ./frontend + + + build_backend: + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup .NET SDK 9.0.x + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.x' + + - name: Publish the app + run: dotnet publish -c Release --property:PublishDir=publish # Publish the app to the API project publish folder + working-directory: ./backend # Specify where to find the solution file in repository From 9a09c5d594f1dbcb19e2dded4bca08c8e186ff32 Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 20 Jan 2026 10:49:12 +0100 Subject: [PATCH 16/21] remove needs --- .github/workflows/merge-request.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/merge-request.yml b/.github/workflows/merge-request.yml index 0a04100c..e7924c6e 100644 --- a/.github/workflows/merge-request.yml +++ b/.github/workflows/merge-request.yml @@ -25,7 +25,6 @@ jobs: build_backend: runs-on: ubuntu-latest - needs: deploy_infrastructure environment: production steps: From 6e6600b6f7b76e4811de2f525e4f9dcf014000c9 Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 20 Jan 2026 11:13:45 +0100 Subject: [PATCH 17/21] remove comments --- .github/workflows/merge-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge-request.yml b/.github/workflows/merge-request.yml index e7924c6e..099e5a3a 100644 --- a/.github/workflows/merge-request.yml +++ b/.github/workflows/merge-request.yml @@ -37,5 +37,5 @@ jobs: dotnet-version: '9.0.x' - name: Publish the app - run: dotnet publish -c Release --property:PublishDir=publish # Publish the app to the API project publish folder - working-directory: ./backend # Specify where to find the solution file in repository + run: dotnet publish -c Release --property:PublishDir=publish + working-directory: ./backend From c9835bdc9b11353758bff5ee19462e5782ef40ce Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 20 Jan 2026 11:24:16 +0100 Subject: [PATCH 18/21] new yml file --- .github/workflows/connect_CI_CD.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/connect_CI_CD.yml diff --git a/.github/workflows/connect_CI_CD.yml b/.github/workflows/connect_CI_CD.yml new file mode 100644 index 00000000..e69de29b From 6d101d0d1baafaae259aceb11b1994148e652948 Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 20 Jan 2026 11:28:22 +0100 Subject: [PATCH 19/21] rmv comments --- .github/workflows/merge-request.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/merge-request.yml b/.github/workflows/merge-request.yml index 099e5a3a..c2705767 100644 --- a/.github/workflows/merge-request.yml +++ b/.github/workflows/merge-request.yml @@ -1,8 +1,6 @@ on: [pull_request] permissions: - # Require write permission to Fetch an OIDC token (required for federated credential) and write it - # It will be automatically used on actions / cli that needs it id-token: write jobs: From 1d4d5746702361f10b5454e21c6a185d04bd546a Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 20 Jan 2026 11:33:46 +0100 Subject: [PATCH 20/21] edit on --- .github/workflows/merge-request.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/merge-request.yml b/.github/workflows/merge-request.yml index c2705767..8d069fe0 100644 --- a/.github/workflows/merge-request.yml +++ b/.github/workflows/merge-request.yml @@ -1,4 +1,6 @@ -on: [pull_request] +on: + pull_request: + types: [opened, synchronize, reopened] permissions: id-token: write From 2f4e161c33cfb29a4c879c8dc959b93894eec6a1 Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 20 Jan 2026 11:34:41 +0100 Subject: [PATCH 21/21] delte file --- .github/workflows/connect_CI_CD.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .github/workflows/connect_CI_CD.yml diff --git a/.github/workflows/connect_CI_CD.yml b/.github/workflows/connect_CI_CD.yml deleted file mode 100644 index e69de29b..00000000