From 2a2d410b2db8e2d87ee1a850c90f0655badca52a Mon Sep 17 00:00:00 2001 From: Ahmed Muhsin <36454324+ahmedmuhsin@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:31:24 -0600 Subject: [PATCH 01/13] azure functions: java21 GA (#7900) * make java 21 linux GA * make java 21 windows GA but keep it hidden * adjust EOL dates to match the servicing road map for microsoft's build of openjdk --- .../2020-10-01/stacks/function-app-stacks/Java.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/stacks/2020-10-01/stacks/function-app-stacks/Java.ts b/server/src/stacks/2020-10-01/stacks/function-app-stacks/Java.ts index c100211431..579267d19f 100644 --- a/server/src/stacks/2020-10-01/stacks/function-app-stacks/Java.ts +++ b/server/src/stacks/2020-10-01/stacks/function-app-stacks/Java.ts @@ -2,9 +2,9 @@ import { FunctionAppStack } from '../../models/FunctionAppStackModel'; import { getDateString } from '../date-utilities'; const getJavaStack: (useIsoDateFormat: boolean) => FunctionAppStack = (useIsoDateFormat: boolean) => { - // EOL source: https://docs.microsoft.com/en-us/java/azure/jdk/?view=azure-java-stable#supported-java-versions-and-update-schedule - const java21EOL = getDateString(new Date('2031/09/01'), useIsoDateFormat); - const java17EOL = getDateString(new Date('2031/09/01'), useIsoDateFormat); + // EOL source: https://learn.microsoft.com/en-us/java/openjdk/support#release-and-servicing-roadmap + const java21EOL = getDateString(new Date('2028/09/01'), useIsoDateFormat); + const java17EOL = getDateString(new Date('2027/09/01'), useIsoDateFormat); const java11EOL = getDateString(new Date('2027/09/01'), useIsoDateFormat); const java8EOL = getDateString(new Date('2026/11/30'), useIsoDateFormat); @@ -23,7 +23,7 @@ const getJavaStack: (useIsoDateFormat: boolean) => FunctionAppStack = (useIsoDat stackSettings: { windowsRuntimeSettings: { runtimeVersion: '21', - isPreview: true, + isPreview: false, isHidden: true, isAutoUpdate: true, isDefault: false, @@ -55,7 +55,7 @@ const getJavaStack: (useIsoDateFormat: boolean) => FunctionAppStack = (useIsoDat }, linuxRuntimeSettings: { runtimeVersion: 'Java|21', - isPreview: true, + isPreview: false, isHidden: false, isAutoUpdate: true, isDefault: false, From df1ecb11ba1f52c78b2e84e32ea34b17c7d2520b Mon Sep 17 00:00:00 2001 From: Ahmed Muhsin <36454324+ahmedmuhsin@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:07:08 -0600 Subject: [PATCH 02/13] Revert "azure functions: java21 GA (#7900)" (#7903) This reverts commit 2a2d410b2db8e2d87ee1a850c90f0655badca52a. --- .../2020-10-01/stacks/function-app-stacks/Java.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/stacks/2020-10-01/stacks/function-app-stacks/Java.ts b/server/src/stacks/2020-10-01/stacks/function-app-stacks/Java.ts index 579267d19f..c100211431 100644 --- a/server/src/stacks/2020-10-01/stacks/function-app-stacks/Java.ts +++ b/server/src/stacks/2020-10-01/stacks/function-app-stacks/Java.ts @@ -2,9 +2,9 @@ import { FunctionAppStack } from '../../models/FunctionAppStackModel'; import { getDateString } from '../date-utilities'; const getJavaStack: (useIsoDateFormat: boolean) => FunctionAppStack = (useIsoDateFormat: boolean) => { - // EOL source: https://learn.microsoft.com/en-us/java/openjdk/support#release-and-servicing-roadmap - const java21EOL = getDateString(new Date('2028/09/01'), useIsoDateFormat); - const java17EOL = getDateString(new Date('2027/09/01'), useIsoDateFormat); + // EOL source: https://docs.microsoft.com/en-us/java/azure/jdk/?view=azure-java-stable#supported-java-versions-and-update-schedule + const java21EOL = getDateString(new Date('2031/09/01'), useIsoDateFormat); + const java17EOL = getDateString(new Date('2031/09/01'), useIsoDateFormat); const java11EOL = getDateString(new Date('2027/09/01'), useIsoDateFormat); const java8EOL = getDateString(new Date('2026/11/30'), useIsoDateFormat); @@ -23,7 +23,7 @@ const getJavaStack: (useIsoDateFormat: boolean) => FunctionAppStack = (useIsoDat stackSettings: { windowsRuntimeSettings: { runtimeVersion: '21', - isPreview: false, + isPreview: true, isHidden: true, isAutoUpdate: true, isDefault: false, @@ -55,7 +55,7 @@ const getJavaStack: (useIsoDateFormat: boolean) => FunctionAppStack = (useIsoDat }, linuxRuntimeSettings: { runtimeVersion: 'Java|21', - isPreview: false, + isPreview: true, isHidden: false, isAutoUpdate: true, isDefault: false, From 67ec4629a0bd2eb20e1d5934bd5b1829943ce6c4 Mon Sep 17 00:00:00 2001 From: Matthew Henderson Date: Thu, 14 Nov 2024 11:00:18 -0800 Subject: [PATCH 03/13] Fixing release type and confirming EOL (#7904) --- .../stacks/2020-10-01/stacks/function-app-stacks/Dotnet.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/src/stacks/2020-10-01/stacks/function-app-stacks/Dotnet.ts b/server/src/stacks/2020-10-01/stacks/function-app-stacks/Dotnet.ts index b9244b99d9..8ba4e7ac97 100644 --- a/server/src/stacks/2020-10-01/stacks/function-app-stacks/Dotnet.ts +++ b/server/src/stacks/2020-10-01/stacks/function-app-stacks/Dotnet.ts @@ -8,8 +8,6 @@ const getDotnetStack: (useIsoDateFormat: boolean) => FunctionAppStack = (useIsoD const dotnet6EOL = getDateString(new Date('2024/11/12'), useIsoDateFormat); const dotnet7EOL = getDateString(new Date('2024/05/14'), useIsoDateFormat); const dotnet8EOL = getDateString(new Date('2026/11/10'), useIsoDateFormat); - - // projected as a guess - not on the support lifecycle page yet and should be adjusted when moved out of preview const dotnet9EOL = getDateString(new Date('2026/05/12'), useIsoDateFormat); return { @@ -23,7 +21,7 @@ const getDotnetStack: (useIsoDateFormat: boolean) => FunctionAppStack = (useIsoD minorVersions: [ { displayText: '.NET 9 Isolated', - value: '9 (LTS), isolated worker model', + value: '9 (STS), isolated worker model', stackSettings: { windowsRuntimeSettings: { runtimeVersion: 'v9.0', From 52e243e757e1b0c68d4412afee53afc163769c98 Mon Sep 17 00:00:00 2001 From: "CSIGS@microsoft.com" Date: Fri, 15 Nov 2024 10:11:48 -0800 Subject: [PATCH 04/13] Juno: check in to users/csigs/hb_452267ed-f3ea-4b18-a9d2-7c2ed17cef14_20241115140928916. (#7907) --- .../LocProject/lcl/Server/Resources/Resources.resx.lcl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/Resources/ja-JP/LocProject/lcl/Server/Resources/Resources.resx.lcl b/server/Resources/ja-JP/LocProject/lcl/Server/Resources/Resources.resx.lcl index c2f9caea8b..2999439021 100644 --- a/server/Resources/ja-JP/LocProject/lcl/Server/Resources/Resources.resx.lcl +++ b/server/Resources/ja-JP/LocProject/lcl/Server/Resources/Resources.resx.lcl @@ -15687,6 +15687,15 @@ + + + + + + + + + From e71aa52b9db200cf6a3b54894ef6eea7fa71207b Mon Sep 17 00:00:00 2001 From: Stephanie Pellegrino <35281019+spellegrino021@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:12:07 -0800 Subject: [PATCH 05/13] Add contents: read permission (#7906) * workflow content update * update checkout * comment --- server/src/workflows/2022-10-01/WorkflowService.ts | 3 ++- .../container-configs/container-functions-linux.config.yml | 3 +++ .../container-configs/container-webapp-linux.config.yml | 3 +++ .../2022-10-01/function-app-configs/node-linux.config.yml | 3 +++ .../2022-10-01/function-app-configs/node-windows.config.yml | 3 +++ .../2022-10-01/function-app-configs/python-linux.config.yml | 3 +++ .../2022-10-01/web-app-configs/aspnet-windows.config.yml | 2 ++ .../2022-10-01/web-app-configs/dotnetcore-linux.config.yml | 2 ++ .../2022-10-01/web-app-configs/dotnetcore-windows.config.yml | 2 ++ .../2022-10-01/web-app-configs/java-jar-linux.config.yml | 2 ++ .../2022-10-01/web-app-configs/java-jar-windows.config.yml | 2 ++ .../2022-10-01/web-app-configs/java-war-linux.config.yml | 2 ++ .../2022-10-01/web-app-configs/java-war-windows.config.yml | 2 ++ .../2022-10-01/web-app-configs/node-linux-oryx.config.yml | 2 ++ .../2022-10-01/web-app-configs/node-linux.config.yml | 2 ++ .../2022-10-01/web-app-configs/node-windows.config.yml | 2 ++ .../workflows/2022-10-01/web-app-configs/php-linux.config.yml | 2 ++ .../2022-10-01/web-app-configs/php-windows.config.yml | 4 +++- .../2022-10-01/web-app-configs/python-linux.config.yml | 2 ++ .../2022-10-01/web-app-configs/wordpress-linux.config.yml | 2 ++ 20 files changed, 46 insertions(+), 2 deletions(-) diff --git a/server/src/workflows/2022-10-01/WorkflowService.ts b/server/src/workflows/2022-10-01/WorkflowService.ts index 17b218b3f0..6dde875c45 100644 --- a/server/src/workflows/2022-10-01/WorkflowService.ts +++ b/server/src/workflows/2022-10-01/WorkflowService.ts @@ -33,7 +33,8 @@ export class WorkflowService20221001 { tenant-id: \${{ secrets.__tenantidsecretname__ }} subscription-id: \${{ secrets.__subscriptionidsecretname__ }}\n`; const permssions = `permissions: - id-token: write #This is required for requesting the JWT\n`; + id-token: write #This is required for requesting the JWT + contents: read #This is required for actions/checkout\n`; const environment = `environment: name: '__slotname__' url: \${{ steps.deploy-to-webapp.outputs.webapp-url }}`; diff --git a/server/src/workflows/2022-10-01/container-configs/container-functions-linux.config.yml b/server/src/workflows/2022-10-01/container-configs/container-functions-linux.config.yml index 3464bb8ef3..2b2abbd080 100644 --- a/server/src/workflows/2022-10-01/container-configs/container-functions-linux.config.yml +++ b/server/src/workflows/2022-10-01/container-configs/container-functions-linux.config.yml @@ -12,6 +12,9 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/container-configs/container-webapp-linux.config.yml b/server/src/workflows/2022-10-01/container-configs/container-webapp-linux.config.yml index 8b34d5c4f3..a8fae241cf 100644 --- a/server/src/workflows/2022-10-01/container-configs/container-webapp-linux.config.yml +++ b/server/src/workflows/2022-10-01/container-configs/container-webapp-linux.config.yml @@ -12,6 +12,9 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/function-app-configs/node-linux.config.yml b/server/src/workflows/2022-10-01/function-app-configs/node-linux.config.yml index 4d79ad3dca..2aee9228d2 100644 --- a/server/src/workflows/2022-10-01/function-app-configs/node-linux.config.yml +++ b/server/src/workflows/2022-10-01/function-app-configs/node-linux.config.yml @@ -16,6 +16,9 @@ env: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + steps: - name: 'Checkout GitHub Action' uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/function-app-configs/node-windows.config.yml b/server/src/workflows/2022-10-01/function-app-configs/node-windows.config.yml index abe68e8e2c..09d17ead5f 100644 --- a/server/src/workflows/2022-10-01/function-app-configs/node-windows.config.yml +++ b/server/src/workflows/2022-10-01/function-app-configs/node-windows.config.yml @@ -16,6 +16,9 @@ env: jobs: build: runs-on: windows-latest + permissions: + contents: read #This is required for actions/checkout + steps: - name: 'Checkout GitHub Action' uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/function-app-configs/python-linux.config.yml b/server/src/workflows/2022-10-01/function-app-configs/python-linux.config.yml index a40b3d0cb7..30d243e6a3 100644 --- a/server/src/workflows/2022-10-01/function-app-configs/python-linux.config.yml +++ b/server/src/workflows/2022-10-01/function-app-configs/python-linux.config.yml @@ -17,6 +17,9 @@ env: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/aspnet-windows.config.yml b/server/src/workflows/2022-10-01/web-app-configs/aspnet-windows.config.yml index b3f0bdce8b..1629a25f27 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/aspnet-windows.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/aspnet-windows.config.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: windows-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/dotnetcore-linux.config.yml b/server/src/workflows/2022-10-01/web-app-configs/dotnetcore-linux.config.yml index da8789caf6..274b33f3cd 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/dotnetcore-linux.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/dotnetcore-linux.config.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/dotnetcore-windows.config.yml b/server/src/workflows/2022-10-01/web-app-configs/dotnetcore-windows.config.yml index 59d87301e6..abece3f376 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/dotnetcore-windows.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/dotnetcore-windows.config.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: windows-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/java-jar-linux.config.yml b/server/src/workflows/2022-10-01/web-app-configs/java-jar-linux.config.yml index 1c8396443c..9eefcb0810 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/java-jar-linux.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/java-jar-linux.config.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/java-jar-windows.config.yml b/server/src/workflows/2022-10-01/web-app-configs/java-jar-windows.config.yml index de8b4139c0..400692602a 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/java-jar-windows.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/java-jar-windows.config.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: windows-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/java-war-linux.config.yml b/server/src/workflows/2022-10-01/web-app-configs/java-war-linux.config.yml index 1c5e50e7e4..40be7a13e4 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/java-war-linux.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/java-war-linux.config.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/java-war-windows.config.yml b/server/src/workflows/2022-10-01/web-app-configs/java-war-windows.config.yml index e214b368bd..8085f219bd 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/java-war-windows.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/java-war-windows.config.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: windows-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/node-linux-oryx.config.yml b/server/src/workflows/2022-10-01/web-app-configs/node-linux-oryx.config.yml index 87f9707952..e3e007cb02 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/node-linux-oryx.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/node-linux-oryx.config.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/node-linux.config.yml b/server/src/workflows/2022-10-01/web-app-configs/node-linux.config.yml index 459e3926d3..64fc1c1140 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/node-linux.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/node-linux.config.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/node-windows.config.yml b/server/src/workflows/2022-10-01/web-app-configs/node-windows.config.yml index c9f822a00f..37ea6a9bdc 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/node-windows.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/node-windows.config.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: windows-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/php-linux.config.yml b/server/src/workflows/2022-10-01/web-app-configs/php-linux.config.yml index 4b77800f13..9b63beb5c4 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/php-linux.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/php-linux.config.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/php-windows.config.yml b/server/src/workflows/2022-10-01/web-app-configs/php-windows.config.yml index 6cbf23a67c..1cad0d5936 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/php-windows.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/php-windows.config.yml @@ -12,7 +12,9 @@ on: jobs: build: runs-on: windows-latest - + permissions: + contents: read #This is required for actions/checkout + steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/python-linux.config.yml b/server/src/workflows/2022-10-01/web-app-configs/python-linux.config.yml index 3c84cb6da1..28c9f6a790 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/python-linux.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/python-linux.config.yml @@ -13,6 +13,8 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 diff --git a/server/src/workflows/2022-10-01/web-app-configs/wordpress-linux.config.yml b/server/src/workflows/2022-10-01/web-app-configs/wordpress-linux.config.yml index ca17a94133..05414d3d10 100644 --- a/server/src/workflows/2022-10-01/web-app-configs/wordpress-linux.config.yml +++ b/server/src/workflows/2022-10-01/web-app-configs/wordpress-linux.config.yml @@ -11,6 +11,8 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout steps: - uses: actions/checkout@v4 From 003c51756058ce470fb43b656168b086bcb93dbd Mon Sep 17 00:00:00 2001 From: liuqidake <33185278+liuqidake@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:58:02 -0800 Subject: [PATCH 06/13] AB#30275542 Hide stack settings for logic app (#7912) * disable stack settings version update for logic app * update stack error string * update siterouter * hide stack settings for logic app * use a scenario instead * remove unused imports --------- Co-authored-by: Qi Liu --- .../app/app-settings/Sections/GeneralSettings.tsx | 11 +++++++---- .../src/utils/scenario-checker/scenario-ids.ts | 1 + .../scenario-checker/workflow-app.environment.ts | 7 +++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/client-react/src/pages/app/app-settings/Sections/GeneralSettings.tsx b/client-react/src/pages/app/app-settings/Sections/GeneralSettings.tsx index b047002ff0..610fce7c3d 100644 --- a/client-react/src/pages/app/app-settings/Sections/GeneralSettings.tsx +++ b/client-react/src/pages/app/app-settings/Sections/GeneralSettings.tsx @@ -32,15 +32,18 @@ const GeneralSettings: React.FC> = props => { return null; }; - const isSiteContainer = useMemo(() => { - return values.config?.properties.linuxFxVersion + const showStack = useMemo(() => { + const isSiteContainer = values.config?.properties.linuxFxVersion ? StringUtils.equalsIgnoreCase(values.config?.properties.linuxFxVersion, DeploymentCenterConstants.sitecontainers) : false; - }, [values.config?.properties.linuxFxVersion]); + const showStackSettingStatus = scenarioChecker.checkScenario(ScenarioIds.showStackSettings, { site }).status; + + return !isSiteContainer && showStackSettingStatus !== 'disabled'; + }, [values.config?.properties.linuxFxVersion, site]); return ( <> - {!isSiteContainer && } + {showStack && } {/* NOTE (krmitta): Need to hide platform settings except TLS settings for KubeApp as elements within are not shown */} <>

{t('platformSettings')}

diff --git a/client-react/src/utils/scenario-checker/scenario-ids.ts b/client-react/src/utils/scenario-checker/scenario-ids.ts index e17a99d625..b62f0d510f 100644 --- a/client-react/src/utils/scenario-checker/scenario-ids.ts +++ b/client-react/src/utils/scenario-checker/scenario-ids.ts @@ -106,6 +106,7 @@ export class ScenarioIds { public static readonly xenonAppRuntimeStack = 'xenonAppRuntimeStack'; public static readonly showAppInsightsLogs = 'showAppInsightsLogs'; public static readonly showRuntimeVersionSetting = 'showRuntimeVersionSetting'; + public static readonly showStackSettings = 'showStackSettings'; public static readonly deploymentCenterLogs = 'deploymentCenterLogs'; public static readonly kuduBuildProvider = 'kuduBuildProvider'; public static readonly dockerCompose = 'dockerCompose'; diff --git a/client-react/src/utils/scenario-checker/workflow-app.environment.ts b/client-react/src/utils/scenario-checker/workflow-app.environment.ts index 8d8cc67e3d..258cf3d0b9 100644 --- a/client-react/src/utils/scenario-checker/workflow-app.environment.ts +++ b/client-react/src/utils/scenario-checker/workflow-app.environment.ts @@ -22,6 +22,13 @@ export class WorkflowAppEnvironment extends FunctionAppEnvironment { }, }; + this.scenarioChecks[ScenarioIds.showStackSettings] = { + id: ScenarioIds.showStackSettings, + runCheck: () => { + return { status: 'disabled' }; + }, + }; + this.scenarioChecks[ScenarioIds.enableCustomErrorPages] = { id: ScenarioIds.enableCustomErrorPages, runCheck: () => { From 3f08f4778c3c2fbe5af948d0bc675eca38ebee72 Mon Sep 17 00:00:00 2001 From: CroffZ Date: Tue, 19 Nov 2024 16:07:41 -0500 Subject: [PATCH 07/13] Support debug console for Azure Container Apps --- .../console/ConsoleDataLoader.tsx | 41 ++++++++++++++----- .../src/app/shared/models/portal-resources.ts | 2 + server/Resources/Resources.resx | 7 ++++ 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/client-react/src/pages/container-app/console/ConsoleDataLoader.tsx b/client-react/src/pages/container-app/console/ConsoleDataLoader.tsx index 80a75e94f6..be650dbd7b 100644 --- a/client-react/src/pages/container-app/console/ConsoleDataLoader.tsx +++ b/client-react/src/pages/container-app/console/ConsoleDataLoader.tsx @@ -14,14 +14,19 @@ import { KeyBoard } from '../../../utils/CommonConstants'; import { containerAppStyles } from '../ContainerApp.styles'; import { getTerminalDimensions } from '../xtermHelper'; import { consoleStyles, dialogFooterStyles, dialogTitleStyles } from './ConsoleDataLoader.styles'; +import { Text } from '@fluentui/react/lib/Text'; export interface ConsoleDataLoaderProps { resourceId: string; - execEndpoint?: string; + execEndpoint?: string; // To be deprecated + mode?: 'exec' | 'debug'; + endpoint?: string; } const ConsoleDataLoader: React.FC = props => { const portalCommunicator = useContext(PortalContext); + const endpoint = !!props.mode ? props.endpoint : props.execEndpoint; + const isDebug = props.mode === 'debug'; const { width, height } = useWindowSize(); const { t } = useTranslation(); @@ -67,10 +72,10 @@ const ConsoleDataLoader: React.FC = props => { resizeHandler(width, height); } - toggleHideDialog(!props.execEndpoint); + toggleHideDialog(!endpoint); setSelectedKey(options[0]); setCustomTextField(''); - }, [props.execEndpoint]); + }, [endpoint]); useEffect(() => { return () => debouncedResizeHandler.cancel(); @@ -80,8 +85,13 @@ const ConsoleDataLoader: React.FC = props => { debouncedResizeHandler(width, height); }, [width, height]); - const getServerEndpoint = (execEndpoint: string, token: string, startUpCommand: string) => { - return `${execEndpoint}?token=${token}&command=${startUpCommand}`; + const getWsUrl = (endpoint: string, token: string, startUpCommand?: string) => { + const url = new URL(endpoint); + url.searchParams.append('token', token); + if (startUpCommand) { + url.searchParams.append('command', startUpCommand); + } + return url.toString(); }; const processMessageBlob = async (data: Blob) => { @@ -157,7 +167,7 @@ const ConsoleDataLoader: React.FC = props => { const dialogContentProps: IDialogContentProps = { type: DialogType.normal, - title: t('containerApp_console_chooseStartUpCommand'), + title: isDebug ? t('containerApp_console_connectToDebugConsole') : t('containerApp_console_chooseStartUpCommand'), styles: dialogTitleStyles(), showCloseButton: false, }; @@ -173,12 +183,17 @@ const ConsoleDataLoader: React.FC = props => { } toggleHideDialog(); + if (isDebug) { + // Not using i18n because this is a console message + updateConsoleText('Connecting to debug console...\r\n'); + } - const execEndpointBefore = props.execEndpoint; + const endpointBefore = endpoint; ContainerAppService.getAuthToken(props.resourceId).then(authTokenResponse => { - if (execEndpointBefore === props.execEndpoint) { - const serverEndpoint = getServerEndpoint(props.execEndpoint || '', authTokenResponse.data.properties.token, command); - ws.current = new WebSocket(serverEndpoint); + if (endpointBefore === endpoint) { + const token = authTokenResponse.data.properties.token; + const wsUrl = isDebug ? getWsUrl(endpoint || '', token) : getWsUrl(endpoint || '', token, command); + ws.current = new WebSocket(wsUrl); ws.current.onmessage = async (event: MessageEvent) => { if (event.data instanceof Blob) { @@ -254,7 +269,11 @@ const ConsoleDataLoader: React.FC = props => {