From 0c97b92cb01687e6733354404d76ffce3f6188d1 Mon Sep 17 00:00:00 2001 From: mkarmark Date: Wed, 2 Oct 2024 16:30:10 -0700 Subject: [PATCH 01/11] Update resources.resjson --- .../Strings/resources.resjson/en-US/resources.resjson | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tasks/AzureStaticWebAppV0/Strings/resources.resjson/en-US/resources.resjson b/Tasks/AzureStaticWebAppV0/Strings/resources.resjson/en-US/resources.resjson index 4cdb7b7282de..e57b5e7684c0 100644 --- a/Tasks/AzureStaticWebAppV0/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/AzureStaticWebAppV0/Strings/resources.resjson/en-US/resources.resjson @@ -36,5 +36,9 @@ "loc.input.label.production_branch": "Production Branch", "loc.input.help.production_branch": "Production branch. When specified and Deployment Environment is empty, deployments from other branches will be preview environments", "loc.input.label.data_api_location": "Data api location", - "loc.input.help.data_api_location": "Directory location of the Data API source files relative to working directory" -} \ No newline at end of file + "loc.input.help.data_api_location": "Directory location of the Data API source files relative to working directory", + "loc.input.label.azure_access_token": "Azure Access Token", + "loc.input.help.azure_access_token": "Access token used to authenticate and authorize the deployment", + "loc.input.label.default_hostname": "Default Hostname", + "loc.input.help.default_hostname": "Default Hostname of the app" +} From b0c26e4e24174f896c531c692a12de3b00a08c25 Mon Sep 17 00:00:00 2001 From: mkarmark Date: Wed, 2 Oct 2024 16:32:05 -0700 Subject: [PATCH 02/11] Update index.ts --- Tasks/AzureStaticWebAppV0/index.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Tasks/AzureStaticWebAppV0/index.ts b/Tasks/AzureStaticWebAppV0/index.ts index 4970cd651483..4b1809baaf26 100644 --- a/Tasks/AzureStaticWebAppV0/index.ts +++ b/Tasks/AzureStaticWebAppV0/index.ts @@ -12,6 +12,8 @@ const routesLocationInputName = 'routes_location'; const buildTimeoutInMinutesInputName = 'build_timeout_in_minutes'; const configFileLocationInputName = 'config_file_location'; const apiTokenInputName = 'azure_static_web_apps_api_token'; +const accessTokenInputName = 'azure_access_token'; +const defaultHostnameInputName = 'default_hostname'; const deploymentEnvironmentInputName = 'deployment_environment'; const productionBranchInputName = 'production_branch'; const dataApiLocationInputName = 'data_api_location'; @@ -87,7 +89,9 @@ async function createDockerEnvVarFile(envVarFilePath: string) { const skipApiBuild: boolean = tl.getBoolInput('skip_api_build', false); const isStaticExport: boolean = tl.getBoolInput('is_static_export', false); const apiToken: string = process.env[apiTokenInputName] || tl.getInput(apiTokenInputName, false) || ""; - + const accessToken: string = process.env[accessTokenInputName] || tl.getInput(accessTokenInputName, false) || ""; + const defaultHostname: string = process.env[defaultHostnameInputName] || tl.getInput(defaultHostnameInputName, false) || ""; + const systemVerbose = getNullableBooleanFromString(process.env['SYSTEM_DEBUG']); const inputVerbose = getNullableBooleanFromString(tl.getInput('verbose', false)); @@ -114,7 +118,9 @@ async function createDockerEnvVarFile(envVarFilePath: string) { addSystemVariableToString("VERBOSE", verbose.toString()); addInputStringToString("DEPLOYMENT_TOKEN", apiToken, apiTokenInputName); - + addInputStringToString("AZURE_ACCESS_TOKEN", accessToken, accessTokenInputName); + addInputStringToString("DEFAULT_HOSTNAME", defaultHostname, defaultHostnameInputName); + process.env['SWA_DEPLOYMENT_CLIENT'] = deploymentClient; process.env['SWA_WORKING_DIR'] = workingDirectory; process.env['SWA_WORKSPACE_DIR'] = containerWorkingDir; From b0507b2033af1274e1af8130254d07138300fbcb Mon Sep 17 00:00:00 2001 From: mkarmark Date: Wed, 2 Oct 2024 16:33:00 -0700 Subject: [PATCH 03/11] Update task.json --- Tasks/AzureStaticWebAppV0/task.json | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Tasks/AzureStaticWebAppV0/task.json b/Tasks/AzureStaticWebAppV0/task.json index 03957139336d..81d920918d8a 100644 --- a/Tasks/AzureStaticWebAppV0/task.json +++ b/Tasks/AzureStaticWebAppV0/task.json @@ -160,6 +160,22 @@ "defaultValue": "", "required": false, "helpMarkDown": "Directory location of the Data API source files relative to working directory" + }, + { + "name": "azure_access_token", + "type": "string", + "label": "Azure Access Token", + "defaultValue": "", + "required": false, + "helpMarkDown": "Access Token used for deployment. Not required if passed as a variable" + }, + { + "name": "default_hostname", + "type": "string", + "label": "Default Hostname", + "defaultValue": "", + "required": false, + "helpMarkDown": "Default hostname for deployment. Not required if passed as an environment variable" } ], "execution": { @@ -172,4 +188,4 @@ "argumentFormat": "" } } -} \ No newline at end of file +} From c22bead1286f1d05fed59a7029aec6f2b33acc03 Mon Sep 17 00:00:00 2001 From: mkarmark Date: Wed, 2 Oct 2024 16:33:10 -0700 Subject: [PATCH 04/11] Update task.loc.json --- Tasks/AzureStaticWebAppV0/task.loc.json | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Tasks/AzureStaticWebAppV0/task.loc.json b/Tasks/AzureStaticWebAppV0/task.loc.json index 61673db9ba1d..93126ab2893a 100644 --- a/Tasks/AzureStaticWebAppV0/task.loc.json +++ b/Tasks/AzureStaticWebAppV0/task.loc.json @@ -160,6 +160,22 @@ "defaultValue": "", "required": false, "helpMarkDown": "ms-resource:loc.input.help.data_api_location" + }, + { + "name": "azure_access_token", + "type": "string", + "label": "Azure Access Token", + "defaultValue": "", + "required": false, + "helpMarkDown": "Access Token used for deployment. Not required if passed as a variable" + }, + { + "name": "default_hostname", + "type": "string", + "label": "Default Hostname", + "defaultValue": "", + "required": false, + "helpMarkDown": "Default hostname for deployment. Not required if passed as an environment variable" } ], "execution": { @@ -172,4 +188,4 @@ "argumentFormat": "" } } -} \ No newline at end of file +} From e3f0908ca16a993621b5a67e71f88b398a560e65 Mon Sep 17 00:00:00 2001 From: mkarmark Date: Wed, 2 Oct 2024 16:38:09 -0700 Subject: [PATCH 05/11] Update task.json --- Tasks/AzureStaticWebAppV0/task.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/AzureStaticWebAppV0/task.json b/Tasks/AzureStaticWebAppV0/task.json index 81d920918d8a..535028c0643f 100644 --- a/Tasks/AzureStaticWebAppV0/task.json +++ b/Tasks/AzureStaticWebAppV0/task.json @@ -15,7 +15,7 @@ "version": { "Major": 0, "Minor": 246, - "Patch": 0 + "Patch": 1 }, "preview": true, "minimumAgentVersion": "1.95.0", From 50727120d176608587005433c8aa6cfaa765780f Mon Sep 17 00:00:00 2001 From: mkarmark Date: Wed, 2 Oct 2024 16:38:27 -0700 Subject: [PATCH 06/11] Update task.loc.json --- Tasks/AzureStaticWebAppV0/task.loc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/AzureStaticWebAppV0/task.loc.json b/Tasks/AzureStaticWebAppV0/task.loc.json index 93126ab2893a..eefdc6929fc5 100644 --- a/Tasks/AzureStaticWebAppV0/task.loc.json +++ b/Tasks/AzureStaticWebAppV0/task.loc.json @@ -15,7 +15,7 @@ "version": { "Major": 0, "Minor": 246, - "Patch": 0 + "Patch": 1 }, "preview": true, "minimumAgentVersion": "1.95.0", From 292b2d77d89a2fc4a63b84a30b30778da7fc7607 Mon Sep 17 00:00:00 2001 From: mkarmark Date: Wed, 2 Oct 2024 16:39:12 -0700 Subject: [PATCH 07/11] Update task.json --- Tasks/AzureStaticWebAppV0/task.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/AzureStaticWebAppV0/task.json b/Tasks/AzureStaticWebAppV0/task.json index 535028c0643f..1d751cac6396 100644 --- a/Tasks/AzureStaticWebAppV0/task.json +++ b/Tasks/AzureStaticWebAppV0/task.json @@ -14,8 +14,8 @@ "demands": [], "version": { "Major": 0, - "Minor": 246, - "Patch": 1 + "Minor": 247, + "Patch": 0 }, "preview": true, "minimumAgentVersion": "1.95.0", From 859b1b8617274519c8a30bbf3356b03f5e71699a Mon Sep 17 00:00:00 2001 From: mkarmark Date: Wed, 2 Oct 2024 16:39:38 -0700 Subject: [PATCH 08/11] Update task.loc.json --- Tasks/AzureStaticWebAppV0/task.loc.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/AzureStaticWebAppV0/task.loc.json b/Tasks/AzureStaticWebAppV0/task.loc.json index eefdc6929fc5..5f6602a834df 100644 --- a/Tasks/AzureStaticWebAppV0/task.loc.json +++ b/Tasks/AzureStaticWebAppV0/task.loc.json @@ -14,8 +14,8 @@ "demands": [], "version": { "Major": 0, - "Minor": 246, - "Patch": 1 + "Minor": 247, + "Patch": 0 }, "preview": true, "minimumAgentVersion": "1.95.0", From 1ab441deeeff6b2512d5b5771af618e7391f01d0 Mon Sep 17 00:00:00 2001 From: Mitali Karmarkar Date: Wed, 2 Oct 2024 17:17:32 -0700 Subject: [PATCH 09/11] fixed generated file issue --- Tasks/AzureStaticWebAppV0/package-lock.json | 78 +++++++++---------- _generated/AzureStaticWebAppV0.versionmap.txt | 4 +- .../resources.resjson/en-US/resources.resjson | 6 +- _generated/AzureStaticWebAppV0/index.ts | 10 ++- .../AzureStaticWebAppV0/package-lock.json | 78 +++++++++---------- _generated/AzureStaticWebAppV0/task.json | 22 +++++- _generated/AzureStaticWebAppV0/task.loc.json | 22 +++++- .../resources.resjson/en-US/resources.resjson | 6 +- .../AzureStaticWebAppV0_Node20/index.ts | 10 ++- .../AzureStaticWebAppV0_Node20/task.json | 22 +++++- .../AzureStaticWebAppV0_Node20/task.loc.json | 22 +++++- 11 files changed, 182 insertions(+), 98 deletions(-) diff --git a/Tasks/AzureStaticWebAppV0/package-lock.json b/Tasks/AzureStaticWebAppV0/package-lock.json index 13c49f843bf8..5643567218f3 100644 --- a/Tasks/AzureStaticWebAppV0/package-lock.json +++ b/Tasks/AzureStaticWebAppV0/package-lock.json @@ -227,6 +227,45 @@ "agent-base": "5", "debug": "4" } + }, + "msalv1": { + "version": "npm:@azure/msal-node@1.18.4", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.18.4.tgz", + "integrity": "sha512-Kc/dRvhZ9Q4+1FSfsTFDME/v6+R2Y1fuMty/TfwqE5p9GTPw08BPbKgeWinE8JRHRp+LemjQbUZsn4Q4l6Lszg==", + "requires": { + "@azure/msal-common": "13.3.1", + "jsonwebtoken": "^9.0.0", + "uuid": "^8.3.0" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } + } + }, + "msalv2": { + "version": "npm:@azure/msal-node@2.14.0", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.14.0.tgz", + "integrity": "sha512-rrfzIpG3Q1rHjVYZmHAEDidWAZZ2cgkxlIcMQ8dHebRISaZ2KCV33Q8Vs+uaV6lxweROabNxKFlR2lIKagZqYg==", + "requires": { + "@azure/msal-common": "14.15.0", + "jsonwebtoken": "^9.0.0", + "uuid": "^8.3.0" + }, + "dependencies": { + "@azure/msal-common": { + "version": "14.15.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.15.0.tgz", + "integrity": "sha512-ImAQHxmpMneJ/4S8BRFhjt1MZ3bppmpRPYYNyzeQPeFN288YKbb8TmmISQEbtfkQ1BPASvYZU5doIZOPBAqENQ==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } + } } } }, @@ -705,45 +744,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "msalv1": { - "version": "npm:@azure/msal-node@1.18.4", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.18.4.tgz", - "integrity": "sha512-Kc/dRvhZ9Q4+1FSfsTFDME/v6+R2Y1fuMty/TfwqE5p9GTPw08BPbKgeWinE8JRHRp+LemjQbUZsn4Q4l6Lszg==", - "requires": { - "@azure/msal-common": "13.3.1", - "jsonwebtoken": "^9.0.0", - "uuid": "^8.3.0" - }, - "dependencies": { - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - } - } - }, - "msalv2": { - "version": "npm:@azure/msal-node@2.13.1", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.13.1.tgz", - "integrity": "sha512-sijfzPNorKt6+9g1/miHwhj6Iapff4mPQx1azmmZExgzUROqWTM1o3ACyxDja0g47VpowFy/sxTM/WsuCyXTiw==", - "requires": { - "@azure/msal-common": "14.14.2", - "jsonwebtoken": "^9.0.0", - "uuid": "^8.3.0" - }, - "dependencies": { - "@azure/msal-common": { - "version": "14.14.2", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.14.2.tgz", - "integrity": "sha512-XV0P5kSNwDwCA/SjIxTe9mEAsKB0NqGNSuaVrkCCE2lAyBr/D6YtD80Vkdp4tjWnPFwjzkwldjr1xU/facOJog==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - } - } - }, "node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", diff --git a/_generated/AzureStaticWebAppV0.versionmap.txt b/_generated/AzureStaticWebAppV0.versionmap.txt index 2ffb637c28a0..a36e0c1203fc 100644 --- a/_generated/AzureStaticWebAppV0.versionmap.txt +++ b/_generated/AzureStaticWebAppV0.versionmap.txt @@ -1,2 +1,2 @@ -Default|0.246.0 -Node20_229_8|0.246.1 +Default|0.247.0 +Node20_229_8|0.247.1 diff --git a/_generated/AzureStaticWebAppV0/Strings/resources.resjson/en-US/resources.resjson b/_generated/AzureStaticWebAppV0/Strings/resources.resjson/en-US/resources.resjson index 4cdb7b7282de..3562e0e09675 100644 --- a/_generated/AzureStaticWebAppV0/Strings/resources.resjson/en-US/resources.resjson +++ b/_generated/AzureStaticWebAppV0/Strings/resources.resjson/en-US/resources.resjson @@ -36,5 +36,9 @@ "loc.input.label.production_branch": "Production Branch", "loc.input.help.production_branch": "Production branch. When specified and Deployment Environment is empty, deployments from other branches will be preview environments", "loc.input.label.data_api_location": "Data api location", - "loc.input.help.data_api_location": "Directory location of the Data API source files relative to working directory" + "loc.input.help.data_api_location": "Directory location of the Data API source files relative to working directory", + "loc.input.label.azure_access_token": "Azure Access Token", + "loc.input.help.azure_access_token": "Access Token used for deployment. Not required if passed as a variable", + "loc.input.label.default_hostname": "Default Hostname", + "loc.input.help.default_hostname": "Default hostname for deployment. Not required if passed as an environment variable" } \ No newline at end of file diff --git a/_generated/AzureStaticWebAppV0/index.ts b/_generated/AzureStaticWebAppV0/index.ts index 4970cd651483..4b1809baaf26 100644 --- a/_generated/AzureStaticWebAppV0/index.ts +++ b/_generated/AzureStaticWebAppV0/index.ts @@ -12,6 +12,8 @@ const routesLocationInputName = 'routes_location'; const buildTimeoutInMinutesInputName = 'build_timeout_in_minutes'; const configFileLocationInputName = 'config_file_location'; const apiTokenInputName = 'azure_static_web_apps_api_token'; +const accessTokenInputName = 'azure_access_token'; +const defaultHostnameInputName = 'default_hostname'; const deploymentEnvironmentInputName = 'deployment_environment'; const productionBranchInputName = 'production_branch'; const dataApiLocationInputName = 'data_api_location'; @@ -87,7 +89,9 @@ async function createDockerEnvVarFile(envVarFilePath: string) { const skipApiBuild: boolean = tl.getBoolInput('skip_api_build', false); const isStaticExport: boolean = tl.getBoolInput('is_static_export', false); const apiToken: string = process.env[apiTokenInputName] || tl.getInput(apiTokenInputName, false) || ""; - + const accessToken: string = process.env[accessTokenInputName] || tl.getInput(accessTokenInputName, false) || ""; + const defaultHostname: string = process.env[defaultHostnameInputName] || tl.getInput(defaultHostnameInputName, false) || ""; + const systemVerbose = getNullableBooleanFromString(process.env['SYSTEM_DEBUG']); const inputVerbose = getNullableBooleanFromString(tl.getInput('verbose', false)); @@ -114,7 +118,9 @@ async function createDockerEnvVarFile(envVarFilePath: string) { addSystemVariableToString("VERBOSE", verbose.toString()); addInputStringToString("DEPLOYMENT_TOKEN", apiToken, apiTokenInputName); - + addInputStringToString("AZURE_ACCESS_TOKEN", accessToken, accessTokenInputName); + addInputStringToString("DEFAULT_HOSTNAME", defaultHostname, defaultHostnameInputName); + process.env['SWA_DEPLOYMENT_CLIENT'] = deploymentClient; process.env['SWA_WORKING_DIR'] = workingDirectory; process.env['SWA_WORKSPACE_DIR'] = containerWorkingDir; diff --git a/_generated/AzureStaticWebAppV0/package-lock.json b/_generated/AzureStaticWebAppV0/package-lock.json index 13c49f843bf8..5643567218f3 100644 --- a/_generated/AzureStaticWebAppV0/package-lock.json +++ b/_generated/AzureStaticWebAppV0/package-lock.json @@ -227,6 +227,45 @@ "agent-base": "5", "debug": "4" } + }, + "msalv1": { + "version": "npm:@azure/msal-node@1.18.4", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.18.4.tgz", + "integrity": "sha512-Kc/dRvhZ9Q4+1FSfsTFDME/v6+R2Y1fuMty/TfwqE5p9GTPw08BPbKgeWinE8JRHRp+LemjQbUZsn4Q4l6Lszg==", + "requires": { + "@azure/msal-common": "13.3.1", + "jsonwebtoken": "^9.0.0", + "uuid": "^8.3.0" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } + } + }, + "msalv2": { + "version": "npm:@azure/msal-node@2.14.0", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.14.0.tgz", + "integrity": "sha512-rrfzIpG3Q1rHjVYZmHAEDidWAZZ2cgkxlIcMQ8dHebRISaZ2KCV33Q8Vs+uaV6lxweROabNxKFlR2lIKagZqYg==", + "requires": { + "@azure/msal-common": "14.15.0", + "jsonwebtoken": "^9.0.0", + "uuid": "^8.3.0" + }, + "dependencies": { + "@azure/msal-common": { + "version": "14.15.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.15.0.tgz", + "integrity": "sha512-ImAQHxmpMneJ/4S8BRFhjt1MZ3bppmpRPYYNyzeQPeFN288YKbb8TmmISQEbtfkQ1BPASvYZU5doIZOPBAqENQ==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } + } } } }, @@ -705,45 +744,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "msalv1": { - "version": "npm:@azure/msal-node@1.18.4", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.18.4.tgz", - "integrity": "sha512-Kc/dRvhZ9Q4+1FSfsTFDME/v6+R2Y1fuMty/TfwqE5p9GTPw08BPbKgeWinE8JRHRp+LemjQbUZsn4Q4l6Lszg==", - "requires": { - "@azure/msal-common": "13.3.1", - "jsonwebtoken": "^9.0.0", - "uuid": "^8.3.0" - }, - "dependencies": { - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - } - } - }, - "msalv2": { - "version": "npm:@azure/msal-node@2.13.1", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.13.1.tgz", - "integrity": "sha512-sijfzPNorKt6+9g1/miHwhj6Iapff4mPQx1azmmZExgzUROqWTM1o3ACyxDja0g47VpowFy/sxTM/WsuCyXTiw==", - "requires": { - "@azure/msal-common": "14.14.2", - "jsonwebtoken": "^9.0.0", - "uuid": "^8.3.0" - }, - "dependencies": { - "@azure/msal-common": { - "version": "14.14.2", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.14.2.tgz", - "integrity": "sha512-XV0P5kSNwDwCA/SjIxTe9mEAsKB0NqGNSuaVrkCCE2lAyBr/D6YtD80Vkdp4tjWnPFwjzkwldjr1xU/facOJog==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - } - } - }, "node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", diff --git a/_generated/AzureStaticWebAppV0/task.json b/_generated/AzureStaticWebAppV0/task.json index 320515c2ac70..5cd25a5f311b 100644 --- a/_generated/AzureStaticWebAppV0/task.json +++ b/_generated/AzureStaticWebAppV0/task.json @@ -14,7 +14,7 @@ "demands": [], "version": { "Major": 0, - "Minor": 246, + "Minor": 247, "Patch": 0 }, "preview": true, @@ -160,6 +160,22 @@ "defaultValue": "", "required": false, "helpMarkDown": "Directory location of the Data API source files relative to working directory" + }, + { + "name": "azure_access_token", + "type": "string", + "label": "Azure Access Token", + "defaultValue": "", + "required": false, + "helpMarkDown": "Access Token used for deployment. Not required if passed as a variable" + }, + { + "name": "default_hostname", + "type": "string", + "label": "Default Hostname", + "defaultValue": "", + "required": false, + "helpMarkDown": "Default hostname for deployment. Not required if passed as an environment variable" } ], "execution": { @@ -173,7 +189,7 @@ } }, "_buildConfigMapping": { - "Default": "0.246.0", - "Node20_229_8": "0.246.1" + "Default": "0.247.0", + "Node20_229_8": "0.247.1" } } \ No newline at end of file diff --git a/_generated/AzureStaticWebAppV0/task.loc.json b/_generated/AzureStaticWebAppV0/task.loc.json index ff219b6b9801..f16c52ca943e 100644 --- a/_generated/AzureStaticWebAppV0/task.loc.json +++ b/_generated/AzureStaticWebAppV0/task.loc.json @@ -14,7 +14,7 @@ "demands": [], "version": { "Major": 0, - "Minor": 246, + "Minor": 247, "Patch": 0 }, "preview": true, @@ -160,6 +160,22 @@ "defaultValue": "", "required": false, "helpMarkDown": "ms-resource:loc.input.help.data_api_location" + }, + { + "name": "azure_access_token", + "type": "string", + "label": "ms-resource:loc.input.label.azure_access_token", + "defaultValue": "", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.azure_access_token" + }, + { + "name": "default_hostname", + "type": "string", + "label": "ms-resource:loc.input.label.default_hostname", + "defaultValue": "", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.default_hostname" } ], "execution": { @@ -173,7 +189,7 @@ } }, "_buildConfigMapping": { - "Default": "0.246.0", - "Node20_229_8": "0.246.1" + "Default": "0.247.0", + "Node20_229_8": "0.247.1" } } \ No newline at end of file diff --git a/_generated/AzureStaticWebAppV0_Node20/Strings/resources.resjson/en-US/resources.resjson b/_generated/AzureStaticWebAppV0_Node20/Strings/resources.resjson/en-US/resources.resjson index 4cdb7b7282de..3562e0e09675 100644 --- a/_generated/AzureStaticWebAppV0_Node20/Strings/resources.resjson/en-US/resources.resjson +++ b/_generated/AzureStaticWebAppV0_Node20/Strings/resources.resjson/en-US/resources.resjson @@ -36,5 +36,9 @@ "loc.input.label.production_branch": "Production Branch", "loc.input.help.production_branch": "Production branch. When specified and Deployment Environment is empty, deployments from other branches will be preview environments", "loc.input.label.data_api_location": "Data api location", - "loc.input.help.data_api_location": "Directory location of the Data API source files relative to working directory" + "loc.input.help.data_api_location": "Directory location of the Data API source files relative to working directory", + "loc.input.label.azure_access_token": "Azure Access Token", + "loc.input.help.azure_access_token": "Access Token used for deployment. Not required if passed as a variable", + "loc.input.label.default_hostname": "Default Hostname", + "loc.input.help.default_hostname": "Default hostname for deployment. Not required if passed as an environment variable" } \ No newline at end of file diff --git a/_generated/AzureStaticWebAppV0_Node20/index.ts b/_generated/AzureStaticWebAppV0_Node20/index.ts index 4970cd651483..4b1809baaf26 100644 --- a/_generated/AzureStaticWebAppV0_Node20/index.ts +++ b/_generated/AzureStaticWebAppV0_Node20/index.ts @@ -12,6 +12,8 @@ const routesLocationInputName = 'routes_location'; const buildTimeoutInMinutesInputName = 'build_timeout_in_minutes'; const configFileLocationInputName = 'config_file_location'; const apiTokenInputName = 'azure_static_web_apps_api_token'; +const accessTokenInputName = 'azure_access_token'; +const defaultHostnameInputName = 'default_hostname'; const deploymentEnvironmentInputName = 'deployment_environment'; const productionBranchInputName = 'production_branch'; const dataApiLocationInputName = 'data_api_location'; @@ -87,7 +89,9 @@ async function createDockerEnvVarFile(envVarFilePath: string) { const skipApiBuild: boolean = tl.getBoolInput('skip_api_build', false); const isStaticExport: boolean = tl.getBoolInput('is_static_export', false); const apiToken: string = process.env[apiTokenInputName] || tl.getInput(apiTokenInputName, false) || ""; - + const accessToken: string = process.env[accessTokenInputName] || tl.getInput(accessTokenInputName, false) || ""; + const defaultHostname: string = process.env[defaultHostnameInputName] || tl.getInput(defaultHostnameInputName, false) || ""; + const systemVerbose = getNullableBooleanFromString(process.env['SYSTEM_DEBUG']); const inputVerbose = getNullableBooleanFromString(tl.getInput('verbose', false)); @@ -114,7 +118,9 @@ async function createDockerEnvVarFile(envVarFilePath: string) { addSystemVariableToString("VERBOSE", verbose.toString()); addInputStringToString("DEPLOYMENT_TOKEN", apiToken, apiTokenInputName); - + addInputStringToString("AZURE_ACCESS_TOKEN", accessToken, accessTokenInputName); + addInputStringToString("DEFAULT_HOSTNAME", defaultHostname, defaultHostnameInputName); + process.env['SWA_DEPLOYMENT_CLIENT'] = deploymentClient; process.env['SWA_WORKING_DIR'] = workingDirectory; process.env['SWA_WORKSPACE_DIR'] = containerWorkingDir; diff --git a/_generated/AzureStaticWebAppV0_Node20/task.json b/_generated/AzureStaticWebAppV0_Node20/task.json index 3b075815172e..83be2c603f69 100644 --- a/_generated/AzureStaticWebAppV0_Node20/task.json +++ b/_generated/AzureStaticWebAppV0_Node20/task.json @@ -14,7 +14,7 @@ "demands": [], "version": { "Major": 0, - "Minor": 246, + "Minor": 247, "Patch": 1 }, "preview": true, @@ -160,6 +160,22 @@ "defaultValue": "", "required": false, "helpMarkDown": "Directory location of the Data API source files relative to working directory" + }, + { + "name": "azure_access_token", + "type": "string", + "label": "Azure Access Token", + "defaultValue": "", + "required": false, + "helpMarkDown": "Access Token used for deployment. Not required if passed as a variable" + }, + { + "name": "default_hostname", + "type": "string", + "label": "Default Hostname", + "defaultValue": "", + "required": false, + "helpMarkDown": "Default hostname for deployment. Not required if passed as an environment variable" } ], "execution": { @@ -177,7 +193,7 @@ } }, "_buildConfigMapping": { - "Default": "0.246.0", - "Node20_229_8": "0.246.1" + "Default": "0.247.0", + "Node20_229_8": "0.247.1" } } \ No newline at end of file diff --git a/_generated/AzureStaticWebAppV0_Node20/task.loc.json b/_generated/AzureStaticWebAppV0_Node20/task.loc.json index 684e1705af6c..56856d8b8346 100644 --- a/_generated/AzureStaticWebAppV0_Node20/task.loc.json +++ b/_generated/AzureStaticWebAppV0_Node20/task.loc.json @@ -14,7 +14,7 @@ "demands": [], "version": { "Major": 0, - "Minor": 246, + "Minor": 247, "Patch": 1 }, "preview": true, @@ -160,6 +160,22 @@ "defaultValue": "", "required": false, "helpMarkDown": "ms-resource:loc.input.help.data_api_location" + }, + { + "name": "azure_access_token", + "type": "string", + "label": "ms-resource:loc.input.label.azure_access_token", + "defaultValue": "", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.azure_access_token" + }, + { + "name": "default_hostname", + "type": "string", + "label": "ms-resource:loc.input.label.default_hostname", + "defaultValue": "", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.default_hostname" } ], "execution": { @@ -177,7 +193,7 @@ } }, "_buildConfigMapping": { - "Default": "0.246.0", - "Node20_229_8": "0.246.1" + "Default": "0.247.0", + "Node20_229_8": "0.247.1" } } \ No newline at end of file From b05a4d31c667ed2a94c9b6c40370bb026a0e78c1 Mon Sep 17 00:00:00 2001 From: Mitali Karmarkar Date: Wed, 2 Oct 2024 20:50:41 -0700 Subject: [PATCH 10/11] fix task.loc.json --- Tasks/AzureStaticWebAppV0/task.loc.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tasks/AzureStaticWebAppV0/task.loc.json b/Tasks/AzureStaticWebAppV0/task.loc.json index 5f6602a834df..e5dc20fb2e49 100644 --- a/Tasks/AzureStaticWebAppV0/task.loc.json +++ b/Tasks/AzureStaticWebAppV0/task.loc.json @@ -164,18 +164,18 @@ { "name": "azure_access_token", "type": "string", - "label": "Azure Access Token", + "label": "ms-resource:loc.input.label.azure_access_token", "defaultValue": "", "required": false, - "helpMarkDown": "Access Token used for deployment. Not required if passed as a variable" + "helpMarkDown": "ms-resource:loc.input.help.azure_access_token" }, { "name": "default_hostname", "type": "string", - "label": "Default Hostname", + "label": "ms-resource:loc.input.label.default_hostname", "defaultValue": "", "required": false, - "helpMarkDown": "Default hostname for deployment. Not required if passed as an environment variable" + "helpMarkDown": "ms-resource:loc.input.help.default_hostname" } ], "execution": { From 99cb04d26bae626427f8ab2393bf06988c1553e3 Mon Sep 17 00:00:00 2001 From: Mitali Karmarkar Date: Thu, 3 Oct 2024 10:29:05 -0700 Subject: [PATCH 11/11] add new env vars --- Tasks/AzureStaticWebAppV0/envVarDenylist.json | 4 +++- _generated/AzureStaticWebAppV0/envVarDenylist.json | 4 +++- _generated/AzureStaticWebAppV0_Node20/envVarDenylist.json | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Tasks/AzureStaticWebAppV0/envVarDenylist.json b/Tasks/AzureStaticWebAppV0/envVarDenylist.json index 7cf7327e85dd..e3de6be36ee2 100644 --- a/Tasks/AzureStaticWebAppV0/envVarDenylist.json +++ b/Tasks/AzureStaticWebAppV0/envVarDenylist.json @@ -34,5 +34,7 @@ "ROUTES_LOCATION", "ORIGINAL_PATH", "DEPLOYMENT_ACTION", - "NUGET_PACKAGES" + "NUGET_PACKAGES", + "AZURE_ACCESS_TOKEN", + "DEFAULT_HOSTNAME" ] \ No newline at end of file diff --git a/_generated/AzureStaticWebAppV0/envVarDenylist.json b/_generated/AzureStaticWebAppV0/envVarDenylist.json index 7cf7327e85dd..e3de6be36ee2 100644 --- a/_generated/AzureStaticWebAppV0/envVarDenylist.json +++ b/_generated/AzureStaticWebAppV0/envVarDenylist.json @@ -34,5 +34,7 @@ "ROUTES_LOCATION", "ORIGINAL_PATH", "DEPLOYMENT_ACTION", - "NUGET_PACKAGES" + "NUGET_PACKAGES", + "AZURE_ACCESS_TOKEN", + "DEFAULT_HOSTNAME" ] \ No newline at end of file diff --git a/_generated/AzureStaticWebAppV0_Node20/envVarDenylist.json b/_generated/AzureStaticWebAppV0_Node20/envVarDenylist.json index 7cf7327e85dd..e3de6be36ee2 100644 --- a/_generated/AzureStaticWebAppV0_Node20/envVarDenylist.json +++ b/_generated/AzureStaticWebAppV0_Node20/envVarDenylist.json @@ -34,5 +34,7 @@ "ROUTES_LOCATION", "ORIGINAL_PATH", "DEPLOYMENT_ACTION", - "NUGET_PACKAGES" + "NUGET_PACKAGES", + "AZURE_ACCESS_TOKEN", + "DEFAULT_HOSTNAME" ] \ No newline at end of file