diff --git a/src/Functions/Functions.Autorest/custom/FunctionsStack/functionAppStacks.json b/src/Functions/Functions.Autorest/custom/FunctionsStack/functionAppStacks.json index cc7309442b61..ee55dba1a421 100644 --- a/src/Functions/Functions.Autorest/custom/FunctionsStack/functionAppStacks.json +++ b/src/Functions/Functions.Autorest/custom/FunctionsStack/functionAppStacks.json @@ -8,51 +8,18 @@ "value": "dotnet", "preferredOs": "windows", "majorVersions": [ - { - "displayText": ".NET Framework 4.8", - "value": "dotnetframework48", - "minorVersions": [ - { - "displayText": ".NET Framework 4.8", - "value": "4.8", - "stackSettings": { - "windowsRuntimeSettings": { - "runtimeVersion": "v4.0", - "remoteDebuggingSupported": false, - "appInsightsSettings": { - "isSupported": true - }, - "gitHubActionSettings": { - "isSupported": true, - "supportedVersion": "4.8.x" - }, - "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" - }, - "siteConfigPropertiesDictionary": { - "use32BitWorkerProcess": true, - "netFrameworkVersion": "v4.0" - }, - "supportedFunctionsExtensionVersions": [ - "~4" - ] - } - } - } - ] - }, { "displayText": ".NET 8 Isolated", "value": "dotnet8isolated", "minorVersions": [ { "displayText": ".NET 8 Isolated", - "value": "8 (LTS) Isolated", + "value": "8 (LTS), isolated worker model", "stackSettings": { "windowsRuntimeSettings": { "runtimeVersion": "v8.0", "isHidden": false, - "isPreview": true, + "isDefault": true, "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true @@ -62,7 +29,8 @@ "supportedVersion": "8.0.x" }, "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED": "1" }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": false, @@ -71,12 +39,19 @@ "supportedFunctionsExtensionVersions": [ "~4" ], - "endOfLifeDate": "Tue Dec 01 2026 00:00:00 GMT+0000 (Coordinated Universal Time)" + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], + "endOfLifeDate": "Tue Nov 10 2026 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { "runtimeVersion": "DOTNET-ISOLATED|8.0", "isHidden": false, - "isPreview": true, + "isDefault": true, "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true @@ -86,7 +61,8 @@ "supportedVersion": "8.0.x" }, "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED": "1" }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": false, @@ -95,7 +71,14 @@ "supportedFunctionsExtensionVersions": [ "~4" ], - "endOfLifeDate": "Tue Dec 01 2026 00:00:00 GMT+0000 (Coordinated Universal Time)" + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], + "endOfLifeDate": "Tue Nov 10 2026 00:00:00 GMT+0000 (Coordinated Universal Time)" } } } @@ -107,7 +90,7 @@ "minorVersions": [ { "displayText": ".NET 7 Isolated", - "value": "7 (STS) Isolated", + "value": "7 (STS), isolated worker model", "stackSettings": { "windowsRuntimeSettings": { "runtimeVersion": "v7.0", @@ -120,7 +103,8 @@ "supportedVersion": "7.0.x" }, "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED": "1" }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": false, @@ -129,6 +113,13 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Tue May 14 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { @@ -142,7 +133,8 @@ "supportedVersion": "7.0.x" }, "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED": "1" }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": false, @@ -151,65 +143,14 @@ "supportedFunctionsExtensionVersions": [ "~4" ], - "endOfLifeDate": "Tue May 14 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" - } - } - } - ] - }, - { - "displayText": ".NET 6", - "value": "dotnet6", - "minorVersions": [ - { - "displayText": ".NET 6 (LTS)", - "value": "6 (LTS)", - "stackSettings": { - "windowsRuntimeSettings": { - "runtimeVersion": "v6.0", - "isDefault": true, - "remoteDebuggingSupported": false, - "appInsightsSettings": { - "isSupported": true - }, - "gitHubActionSettings": { - "isSupported": true, - "supportedVersion": "6.0.x" - }, - "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet" - }, - "siteConfigPropertiesDictionary": { - "use32BitWorkerProcess": true, - "netFrameworkVersion": "v6.0" - }, - "supportedFunctionsExtensionVersions": [ - "~4" + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } ], - "endOfLifeDate": "Tue Nov 12 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" - }, - "linuxRuntimeSettings": { - "runtimeVersion": "DOTNET|6.0", - "isDefault": true, - "remoteDebuggingSupported": false, - "appInsightsSettings": { - "isSupported": true - }, - "gitHubActionSettings": { - "isSupported": true, - "supportedVersion": "6.0.x" - }, - "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet" - }, - "siteConfigPropertiesDictionary": { - "use32BitWorkerProcess": true, - "linuxFxVersion": "DOTNET|6.0" - }, - "supportedFunctionsExtensionVersions": [ - "~4" - ], - "endOfLifeDate": "Tue Nov 12 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" + "endOfLifeDate": "Tue May 14 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" } } } @@ -221,7 +162,7 @@ "minorVersions": [ { "displayText": ".NET 6 (LTS) Isolated", - "value": "6 (LTS) Isolated", + "value": "6 (LTS), isolated worker model", "stackSettings": { "windowsRuntimeSettings": { "runtimeVersion": "v6.0", @@ -234,7 +175,8 @@ "supportedVersion": "6.0.x" }, "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED": "1" }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": false, @@ -243,6 +185,13 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Tue Nov 12 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { @@ -256,7 +205,8 @@ "supportedVersion": "6.0.x" }, "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED": "1" }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": false, @@ -265,6 +215,13 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Tue Nov 12 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -272,116 +229,110 @@ ] }, { - "displayText": ".NET 5 (non-LTS)", - "value": "dotnet5", + "displayText": ".NET Framework 4.8", + "value": "dotnetframework48", "minorVersions": [ { - "displayText": ".NET 5 (non-LTS)", - "value": "5 (non-LTS)", + "displayText": ".NET Framework 4.8", + "value": ".NET Framework 4.8, isolated worker model", "stackSettings": { "windowsRuntimeSettings": { - "runtimeVersion": "v5.0", - "isHidden": true, - "remoteDebuggingSupported": false, - "appInsightsSettings": { - "isSupported": true - }, - "gitHubActionSettings": { - "isSupported": true, - "supportedVersion": "5.0.x" - }, - "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" - }, - "siteConfigPropertiesDictionary": { - "use32BitWorkerProcess": true - }, - "supportedFunctionsExtensionVersions": [ - "~3" - ], - "endOfLifeDate": "Sun May 08 2022 00:00:00 GMT+0000 (Coordinated Universal Time)", - "isDeprecated": true - }, - "linuxRuntimeSettings": { - "runtimeVersion": "DOTNET-ISOLATED|5.0", - "isHidden": true, + "runtimeVersion": "v4.0", "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true }, "gitHubActionSettings": { "isSupported": true, - "supportedVersion": "5.0.x" + "supportedVersion": "4.8.x" }, "appSettingsDictionary": { "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": true, - "linuxFxVersion": "DOTNET-ISOLATED|5.0" + "netFrameworkVersion": "v4.0" }, "supportedFunctionsExtensionVersions": [ - "~3" + "~4" ], - "endOfLifeDate": "Sun May 08 2022 00:00:00 GMT+0000 (Coordinated Universal Time)", - "isDeprecated": true + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ] } } } ] }, { - "displayText": ".NET Core 3", - "value": "dotnetcore3", + "displayText": ".NET 6 In-process", + "value": "dotnet6", "minorVersions": [ { - "displayText": ".NET Core 3.1", - "value": "3.1", + "displayText": ".NET 6 (LTS) In-process", + "value": "6 (LTS), in-process model", "stackSettings": { "windowsRuntimeSettings": { - "runtimeVersion": "3.1", + "runtimeVersion": "v6.0", + "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true }, - "remoteDebuggingSupported": false, "gitHubActionSettings": { "isSupported": true, - "supportedVersion": "3.1.301" + "supportedVersion": "6.0.x" }, "appSettingsDictionary": { "FUNCTIONS_WORKER_RUNTIME": "dotnet" }, "siteConfigPropertiesDictionary": { - "use32BitWorkerProcess": true + "use32BitWorkerProcess": true, + "netFrameworkVersion": "v6.0" }, "supportedFunctionsExtensionVersions": [ - "~3" + "~4" ], - "endOfLifeDate": "Sat Dec 03 2022 00:00:00 GMT+0000 (Coordinated Universal Time)", - "isDeprecated": true + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], + "endOfLifeDate": "Tue Nov 12 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { - "runtimeVersion": "dotnet|3.1", + "runtimeVersion": "DOTNET|6.0", + "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true }, - "remoteDebuggingSupported": false, "gitHubActionSettings": { "isSupported": true, - "supportedVersion": "3.1.301" + "supportedVersion": "6.0.x" }, "appSettingsDictionary": { "FUNCTIONS_WORKER_RUNTIME": "dotnet" }, "siteConfigPropertiesDictionary": { - "use32BitWorkerProcess": false, - "linuxFxVersion": "dotnet|3.1" + "use32BitWorkerProcess": true, + "linuxFxVersion": "DOTNET|6.0" }, "supportedFunctionsExtensionVersions": [ - "~3" + "~4" + ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } ], - "endOfLifeDate": "Sat Dec 03 2022 00:00:00 GMT+0000 (Coordinated Universal Time)", - "isDeprecated": true + "endOfLifeDate": "Tue Nov 12 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" } } } @@ -413,6 +364,13 @@ }, "supportedFunctionsExtensionVersions": [ "~2" + ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~2", + "isDeprecated": true, + "isDefault": true + } ] }, "linuxRuntimeSettings": { @@ -434,6 +392,13 @@ }, "supportedFunctionsExtensionVersions": [ "~2" + ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~2", + "isDeprecated": true, + "isDefault": true + } ] } } @@ -463,6 +428,13 @@ }, "supportedFunctionsExtensionVersions": [ "~1" + ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~1", + "isDeprecated": true, + "isDefault": true + } ] } } @@ -486,12 +458,12 @@ "value": "20", "minorVersions": [ { - "displayText": "Node.js 20", - "value": "20", + "displayText": "Node.js 20 LTS", + "value": "20 LTS", "stackSettings": { "windowsRuntimeSettings": { "runtimeVersion": "~20", - "isPreview": true, + "isDefault": true, "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true @@ -511,11 +483,18 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Sat May 30 2026 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { "runtimeVersion": "Node|20", - "isPreview": true, + "isDefault": true, "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true @@ -534,6 +513,13 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Sat May 30 2026 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -550,7 +536,6 @@ "stackSettings": { "windowsRuntimeSettings": { "runtimeVersion": "~18", - "isDefault": true, "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true @@ -570,11 +555,17 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Wed Apr 30 2025 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { "runtimeVersion": "Node|18", - "isDefault": true, "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true @@ -593,6 +584,13 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Wed Apr 30 2025 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -629,6 +627,13 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Sun Jun 30 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { @@ -652,6 +657,13 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Sun Jun 30 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -688,6 +700,18 @@ "~4", "~3" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + }, + { + "version": "~3", + "isDeprecated": true, + "isDefault": false + } + ], "endOfLifeDate": "Sun Apr 30 2023 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { @@ -711,125 +735,19 @@ "~4", "~3" ], - "endOfLifeDate": "Sun Apr 30 2023 00:00:00 GMT+0000 (Coordinated Universal Time)" - } - } - } - ] - }, - { - "displayText": "Node.js 12", - "value": "12", - "minorVersions": [ - { - "displayText": "Node.js 12 LTS", - "value": "12 LTS", - "stackSettings": { - "windowsRuntimeSettings": { - "runtimeVersion": "~12", - "isDeprecated": true, - "remoteDebuggingSupported": false, - "appInsightsSettings": { - "isSupported": true - }, - "gitHubActionSettings": { - "isSupported": true, - "supportedVersion": "12.x" - }, - "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "node", - "WEBSITE_NODE_DEFAULT_VERSION": "~12" - }, - "siteConfigPropertiesDictionary": { - "use32BitWorkerProcess": true - }, - "supportedFunctionsExtensionVersions": [ - "~3" + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + }, + { + "version": "~3", + "isDeprecated": true, + "isDefault": false + } ], - "endOfLifeDate": "Tue Dec 13 2022 00:00:00 GMT+0000 (Coordinated Universal Time)" - }, - "linuxRuntimeSettings": { - "runtimeVersion": "Node|12", - "isDeprecated": true, - "remoteDebuggingSupported": false, - "appInsightsSettings": { - "isSupported": true - }, - "gitHubActionSettings": { - "isSupported": true, - "supportedVersion": "12.x" - }, - "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "node" - }, - "siteConfigPropertiesDictionary": { - "use32BitWorkerProcess": false, - "linuxFxVersion": "Node|12" - }, - "supportedFunctionsExtensionVersions": [ - "~3" - ], - "endOfLifeDate": "Tue Dec 13 2022 00:00:00 GMT+0000 (Coordinated Universal Time)" - } - } - } - ] - }, - { - "displayText": "Node.js 10", - "value": "10", - "minorVersions": [ - { - "displayText": "Node.js 10 LTS", - "value": "10 LTS", - "stackSettings": { - "windowsRuntimeSettings": { - "runtimeVersion": "~10", - "isDeprecated": true, - "remoteDebuggingSupported": false, - "appInsightsSettings": { - "isSupported": true - }, - "gitHubActionSettings": { - "isSupported": true, - "supportedVersion": "10.x" - }, - "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "node", - "WEBSITE_NODE_DEFAULT_VERSION": "~10" - }, - "siteConfigPropertiesDictionary": { - "use32BitWorkerProcess": true - }, - "supportedFunctionsExtensionVersions": [ - "~2", - "~3" - ], - "endOfLifeDate": "Fri Apr 30 2021 00:00:00 GMT+0000 (Coordinated Universal Time)" - }, - "linuxRuntimeSettings": { - "runtimeVersion": "Node|10", - "isDeprecated": true, - "remoteDebuggingSupported": false, - "appInsightsSettings": { - "isSupported": true - }, - "gitHubActionSettings": { - "isSupported": true, - "supportedVersion": "10.x" - }, - "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "node" - }, - "siteConfigPropertiesDictionary": { - "use32BitWorkerProcess": false, - "linuxFxVersion": "Node|10" - }, - "supportedFunctionsExtensionVersions": [ - "~2", - "~3" - ], - "endOfLifeDate": "Fri Apr 30 2021 00:00:00 GMT+0000 (Coordinated Universal Time)" + "endOfLifeDate": "Sun Apr 30 2023 00:00:00 GMT+0000 (Coordinated Universal Time)" } } } @@ -863,6 +781,13 @@ "supportedFunctionsExtensionVersions": [ "~2" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~2", + "isDeprecated": true, + "isDefault": true + } + ], "endOfLifeDate": "Tue Dec 31 2019 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -895,6 +820,13 @@ "supportedFunctionsExtensionVersions": [ "~1" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~1", + "isDeprecated": true, + "isDefault": true + } + ], "endOfLifeDate": "Tue Apr 30 2019 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -944,6 +876,13 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Sun Oct 31 2027 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -975,6 +914,13 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Sat Oct 31 2026 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -1006,6 +952,18 @@ "~4", "~3" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + }, + { + "version": "~3", + "isDeprecated": true, + "isDefault": false + } + ], "endOfLifeDate": "Fri Oct 31 2025 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -1035,6 +993,18 @@ "~4", "~3" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + }, + { + "version": "~3", + "isDeprecated": true, + "isDefault": false + } + ], "endOfLifeDate": "Thu Oct 31 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -1065,54 +1035,120 @@ "~3", "~2" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + }, + { + "version": "~3", + "isDeprecated": true, + "isDefault": false + }, + { + "version": "~2", + "isDeprecated": true, + "isDefault": false + } + ], "endOfLifeDate": "Fri Jun 30 2023 00:00:00 GMT+0000 (Coordinated Universal Time)" } } - }, + } + ] + } + ] + } + }, + { + "id": null, + "name": "java", + "type": "Microsoft.Web/functionAppStacks?stackOsType=All", + "properties": { + "displayText": "Java", + "value": "java", + "preferredOs": "windows", + "majorVersions": [ + { + "displayText": "Java 21", + "value": "21", + "minorVersions": [ { - "displayText": "Python 3.6", - "value": "3.6", + "displayText": "Java 21", + "value": "21.0", "stackSettings": { + "windowsRuntimeSettings": { + "runtimeVersion": "21", + "isPreview": true, + "isHidden": true, + "isAutoUpdate": true, + "isDefault": false, + "remoteDebuggingSupported": false, + "appInsightsSettings": { + "isSupported": true + }, + "gitHubActionSettings": { + "isSupported": true, + "supportedVersion": "21" + }, + "appSettingsDictionary": { + "FUNCTIONS_WORKER_RUNTIME": "java" + }, + "siteConfigPropertiesDictionary": { + "use32BitWorkerProcess": true, + "javaVersion": "21", + "netFrameworkVersion": "v6.0" + }, + "supportedFunctionsExtensionVersions": [ + "~4" + ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], + "endOfLifeDate": "Mon Sep 01 2031 00:00:00 GMT+0000 (Coordinated Universal Time)" + }, "linuxRuntimeSettings": { - "runtimeVersion": "Python|3.6", - "isDeprecated": true, + "runtimeVersion": "Java|21", + "isPreview": true, + "isHidden": false, + "isAutoUpdate": true, + "isDefault": false, "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true }, "gitHubActionSettings": { "isSupported": true, - "supportedVersion": "3.6" + "supportedVersion": "21" }, "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "python" + "FUNCTIONS_WORKER_RUNTIME": "java" }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": false, - "linuxFxVersion": "Python|3.6" + "linuxFxVersion": "Java|21" }, "supportedFunctionsExtensionVersions": [ - "~2", - "~3" + "~4" + ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } ], - "endOfLifeDate": "Fri Sep 30 2022 00:00:00 GMT+0000 (Coordinated Universal Time)" + "endOfLifeDate": "Mon Sep 01 2031 00:00:00 GMT+0000 (Coordinated Universal Time)" } } } ] - } - ] - } - }, - { - "id": null, - "name": "java", - "type": "Microsoft.Web/functionAppStacks?stackOsType=All", - "properties": { - "displayText": "Java", - "value": "java", - "preferredOs": "windows", - "majorVersions": [ + }, { "displayText": "Java 17", "value": "17", @@ -1146,6 +1182,13 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Mon Sep 01 2031 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { @@ -1172,6 +1215,13 @@ "supportedFunctionsExtensionVersions": [ "~4" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ], "endOfLifeDate": "Mon Sep 01 2031 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -1209,6 +1259,18 @@ "~4", "~3" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + }, + { + "version": "~3", + "isDeprecated": true, + "isDefault": false + } + ], "endOfLifeDate": "Tue Sep 01 2026 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { @@ -1233,6 +1295,18 @@ "~4", "~3" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + }, + { + "version": "~3", + "isDeprecated": true, + "isDefault": false + } + ], "endOfLifeDate": "Tue Sep 01 2026 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -1272,6 +1346,23 @@ "~3", "~2" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + }, + { + "version": "~3", + "isDeprecated": true, + "isDefault": false + }, + { + "version": "~2", + "isDeprecated": true, + "isDefault": false + } + ], "endOfLifeDate": "Sat Mar 01 2025 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { @@ -1297,6 +1388,18 @@ "~4", "~3" ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + }, + { + "version": "~3", + "isDeprecated": true, + "isDefault": false + } + ], "endOfLifeDate": "Sat Mar 01 2025 00:00:00 GMT+0000 (Coordinated Universal Time)" } } @@ -1320,13 +1423,13 @@ "value": "7", "minorVersions": [ { - "displayText": "PowerShell 7.2", - "value": "7.2", + "displayText": "PowerShell 7.4", + "value": "7.4", "stackSettings": { "windowsRuntimeSettings": { - "runtimeVersion": "7.2", - "isDefault": true, - "isPreview": false, + "runtimeVersion": "7.4", + "isDefault": false, + "isPreview": true, "isHidden": false, "remoteDebuggingSupported": false, "appInsightsSettings": { @@ -1340,19 +1443,25 @@ }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": true, - "powerShellVersion": "7.2", - "netFrameworkVersion": "v6.0" + "powerShellVersion": "7.4", + "netFrameworkVersion": "v8.0" }, "supportedFunctionsExtensionVersions": [ "~4" ], - "endOfLifeDate": "Fri Nov 08 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ] }, "linuxRuntimeSettings": { - "runtimeVersion": "PowerShell|7.2", - "isDefault": true, - "isPreview": false, - "isHidden": false, + "runtimeVersion": "PowerShell|7.4", + "isDefault": false, + "isPreview": true, + "isHidden": true, "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true @@ -1365,22 +1474,30 @@ }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": false, - "linuxFxVersion": "PowerShell|7.2" + "linuxFxVersion": "PowerShell|7.4" }, "supportedFunctionsExtensionVersions": [ "~4" ], - "endOfLifeDate": "Fri Nov 08 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } + ] } } }, { - "displayText": "PowerShell 7.0", - "value": "7.0", + "displayText": "PowerShell 7.2", + "value": "7.2", "stackSettings": { "windowsRuntimeSettings": { - "runtimeVersion": "~7", - "isDeprecated": true, + "runtimeVersion": "7.2", + "isDefault": true, + "isPreview": false, + "isHidden": false, "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true @@ -1393,20 +1510,26 @@ }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": true, - "powerShellVersion": "~7", + "powerShellVersion": "7.2", "netFrameworkVersion": "v6.0" }, "supportedFunctionsExtensionVersions": [ - "~4", - "~3" + "~4" + ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } ], - "endOfLifeDate": "Sat Dec 03 2022 00:00:00 GMT+0000 (Coordinated Universal Time)" + "endOfLifeDate": "Fri Nov 08 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" }, "linuxRuntimeSettings": { - "runtimeVersion": "PowerShell|7", - "isAutoUpdate": true, + "runtimeVersion": "PowerShell|7.2", + "isDefault": true, "isPreview": false, - "isDeprecated": true, + "isHidden": false, "remoteDebuggingSupported": false, "appInsightsSettings": { "isSupported": true @@ -1419,47 +1542,19 @@ }, "siteConfigPropertiesDictionary": { "use32BitWorkerProcess": false, - "linuxFxVersion": "PowerShell|7" + "linuxFxVersion": "PowerShell|7.2" }, "supportedFunctionsExtensionVersions": [ "~4" ], - "endOfLifeDate": "Sat Dec 03 2022 00:00:00 GMT+0000 (Coordinated Universal Time)" - } - } - } - ] - }, - { - "displayText": "PowerShell Core 6", - "value": "6", - "minorVersions": [ - { - "displayText": "PowerShell Core 6.2", - "value": "6.2", - "stackSettings": { - "windowsRuntimeSettings": { - "runtimeVersion": "~6", - "remoteDebuggingSupported": false, - "appInsightsSettings": { - "isSupported": true - }, - "gitHubActionSettings": { - "isSupported": true - }, - "appSettingsDictionary": { - "FUNCTIONS_WORKER_RUNTIME": "powershell" - }, - "siteConfigPropertiesDictionary": { - "use32BitWorkerProcess": true, - "powerShellVersion": "~6" - }, - "isDeprecated": true, - "supportedFunctionsExtensionVersions": [ - "~2", - "~3" + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + } ], - "endOfLifeDate": "Fri Sep 30 2022 00:00:00 GMT+0000 (Coordinated Universal Time)" + "endOfLifeDate": "Fri Nov 08 2024 00:00:00 GMT+0000 (Coordinated Universal Time)" } } } @@ -1505,6 +1600,23 @@ "~4", "~3", "~2" + ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + }, + { + "version": "~3", + "isDeprecated": true, + "isDefault": false + }, + { + "version": "~2", + "isDeprecated": true, + "isDefault": false + } ] }, "linuxRuntimeSettings": { @@ -1528,6 +1640,23 @@ "~4", "~3", "~2" + ], + "supportedFunctionsExtensionVersionsInfo": [ + { + "version": "~4", + "isDeprecated": false, + "isDefault": true + }, + { + "version": "~3", + "isDeprecated": true, + "isDefault": false + }, + { + "version": "~2", + "isDeprecated": true, + "isDefault": false + } ] } } diff --git a/src/Functions/Functions.Autorest/custom/Get-AzFunctionApp.ps1 b/src/Functions/Functions.Autorest/custom/Get-AzFunctionApp.ps1 index cafa4122d01e..c54f1836404b 100644 --- a/src/Functions/Functions.Autorest/custom/Get-AzFunctionApp.ps1 +++ b/src/Functions/Functions.Autorest/custom/Get-AzFunctionApp.ps1 @@ -85,6 +85,8 @@ function Get-AzFunctionApp { process { + RegisterFunctionsTabCompleters + $apps = $null $locationToUse = $null $parameterSetName = $PsCmdlet.ParameterSetName diff --git a/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppAvailableLocation.ps1 b/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppAvailableLocation.ps1 index d0703a5598a8..f241b6e8cf9d 100644 --- a/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppAvailableLocation.ps1 +++ b/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppAvailableLocation.ps1 @@ -73,6 +73,8 @@ function Get-AzFunctionAppAvailableLocation { process { + RegisterFunctionsTabCompleters + # Remove bound parameters from the dictionary that cannot be process by the intenal cmdlets $paramsToRemove = @( "OSType", diff --git a/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppPlan.ps1 b/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppPlan.ps1 index e200c1aaaa7a..6ae3d77af041 100644 --- a/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppPlan.ps1 +++ b/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppPlan.ps1 @@ -81,6 +81,8 @@ function Get-AzFunctionAppPlan { process { + RegisterFunctionsTabCompleters + $plans = $null $locationToUse = $null $parameterSetName = $PsCmdlet.ParameterSetName diff --git a/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppSetting.ps1 b/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppSetting.ps1 index 1a946328faf5..161767c15390 100644 --- a/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppSetting.ps1 +++ b/src/Functions/Functions.Autorest/custom/Get-AzFunctionAppSetting.ps1 @@ -76,6 +76,8 @@ function Get-AzFunctionAppSetting { ) process { + + RegisterFunctionsTabCompleters if ($PsCmdlet.ParameterSetName -eq "ByObjectInput") { diff --git a/src/Functions/Functions.Autorest/custom/HelperFunctions.ps1 b/src/Functions/Functions.Autorest/custom/HelperFunctions.ps1 index 8cce0b9f4796..88a7db52a5d0 100644 --- a/src/Functions/Functions.Autorest/custom/HelperFunctions.ps1 +++ b/src/Functions/Functions.Autorest/custom/HelperFunctions.ps1 @@ -1843,11 +1843,7 @@ function ParseMinorVersion ( [Parameter(Mandatory=$false)] [System.String] - $RuntimeName, - - [Parameter(Mandatory=$false)] - [System.String] - $RuntimeVersion, + $StackMinorVersion, [Parameter(Mandatory=$false)] [System.String] @@ -1862,7 +1858,7 @@ function ParseMinorVersion $RuntimeFullName, [Parameter(Mandatory=$false)] - [Switch] + [Bool] $StackIsLinux ) @@ -1870,7 +1866,7 @@ function ParseMinorVersion if ($RuntimeSettings.supportedFunctionsExtensionVersions -notcontains "~$DefaultFunctionsVersion") { $supportedFunctionsExtensionVersions = $RuntimeSettings.supportedFunctionsExtensionVersions -join ", " - Write-Debug "$DEBUG_PREFIX Minimium required Functions version '$DefaultFunctionsVersion' is not supported. Current supported Functions versions: $supportedFunctionsExtensionVersions. Skipping..." + Write-Debug "$DEBUG_PREFIX Minimium required Functions version '$DefaultFunctionsVersion' is not supported. Runtime supported Functions versions: $supportedFunctionsExtensionVersions. Skipping..." return } else @@ -1878,29 +1874,38 @@ function ParseMinorVersion Write-Debug "$DEBUG_PREFIX Minimium required Functions version '$DefaultFunctionsVersion' is supported." } - if (-not $RuntimeName) - { - $RuntimeName = GetRuntimeName -AppSettingsDictionary $RuntimeSettings.AppSettingsDictionary - } + $runtimeName = GetRuntimeName -AppSettingsDictionary $RuntimeSettings.AppSettingsDictionary - if ($runtimeName -like "dotnet*" -or $runtimeName -like "node*") + $version = $null + if ($RuntimeName -eq "Java" -and $RuntimeSettings.RuntimeVersion -eq "1.8") { - $RuntimeVersion = GetRuntimeVersion -Version $RuntimeVersion + # Java 8 is only supported in Windows. The display value is 8; however, the actual SiteConfig.JavaVersion is 1.8 + $version = $StackMinorVersion } - - # Some runtimes do not have a version like custom handler - if (-not $runtimeVersion -and $RuntimeSettings.RuntimeVersion) + else { - $version = GetRuntimeVersion -Version $RuntimeSettings.RuntimeVersion -StackIsLinux $StackIsLinux.IsPresent - $RuntimeVersion = $version + $version = $RuntimeSettings.RuntimeVersion } + $runtimeVersion = GetRuntimeVersion -Version $version -StackIsLinux $StackIsLinux + # For Java function app, the version from the Stacks API is 8.0, 11.0, and 17.0. However, this is a breaking change which cannot be supported in the current release. - # We will convert the version to 8, 11, and 17. This change will be reverted for the November 2023 breaking release. + # We will convert the version to 8, 11, and 17. This change will be reverted for the May 2024 breaking release. if ($RuntimeName -eq "Java") { - $RuntimeVersion = [int]$RuntimeVersion - Write-Debug "$DEBUG_PREFIX Runtime version for Java is modified to be compatible with the current release. Current version '$RuntimeVersion'" + $runtimeVersion = [int]$runtimeVersion + Write-Debug "$DEBUG_PREFIX Runtime version for Java is modified to be compatible with the current release. Current version '$runtimeVersion'" + } + + # For DotNet function app, the version from the Stacks API is 6.0. 7.0, and 8.0. However, this is a breaking change which cannot be supported in the current release. + # We will convert the version to 6, 7, and 8. This change will be reverted for the May 2024 breaking release. + if ($RuntimeName -like "DotNet*") + { + if ($runtimeVersion.EndsWith(".0")) + { + $runtimeVersion = [int]$runtimeVersion + } + Write-Debug "$DEBUG_PREFIX Runtime version for $runtimeName is modified to be compatible with the current release. Current version '$runtimeVersion'" } $runtime = [Runtime]::new() @@ -1926,10 +1931,10 @@ function ParseMinorVersion return } - if ($RuntimeVersion -and ($runtimeName -ne "custom")) + if ($runtimeVersion -and ($runtimeName -ne "custom")) { - Write-Debug "$DEBUG_PREFIX Runtime version: $RuntimeVersion" - $runtime.Version = $RuntimeVersion + Write-Debug "$DEBUG_PREFIX Runtime version: $runtimeVersion" + $runtime.Version = $runtimeVersion } else { @@ -1947,7 +1952,7 @@ function ParseMinorVersion $runtime.PreferredOs = $PreferredOs } - $targetOs = if ($StackIsLinux.IsPresent) { 'Linux' } else { 'Windows' } + $targetOs = if ($StackIsLinux) { 'Linux' } else { 'Windows' } Write-Debug "$DEBUG_PREFIX Runtime '$runtimeName' for '$targetOs' parsed successfully." return $runtime @@ -1959,23 +1964,28 @@ function GetRuntimeVersion [Microsoft.Azure.PowerShell.Cmdlets.Functions.DoNotExportAttribute()] param ( - [Parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] + [Parameter(Mandatory=$false)] [System.String] $Version, [Parameter(Mandatory=$false)] - [Switch] + [Bool] $StackIsLinux ) - if ($StackIsLinux.IsPresent) + if (-not $Version) + { + # Some runtimes do not have a version like custom handler + return + } + + if ($StackIsLinux) { $Version = $Version.Split('|')[1] } else { - $valuesToReplace = @('STS', 'non-', 'LTS', 'Isolated', '(', ')', '~', 'custom') + $valuesToReplace = @('v', '~') foreach ($value in $valuesToReplace) { if ($Version.Contains($value)) @@ -1986,8 +1996,7 @@ function GetRuntimeVersion } $Version = $Version.Trim() - - return $Version + return $Version } function GetDictionary @@ -2123,27 +2132,26 @@ function SetLinuxandWindowsSupportedRuntimes { $preferredOs = $stackDefinition.properties.preferredOs - # runtime name is the $stackDefinition.Name - $runtimeName = $stackDefinition.properties.value - Write-Debug "$DEBUG_PREFIX Parsing runtime name: $runtimeName" + $stackName = $stackDefinition.properties.value + Write-Debug "$DEBUG_PREFIX Parsing stack name: $stackName" foreach ($majorVersion in $stackDefinition.properties.majorVersions) { foreach ($minorVersion in $majorVersion.minorVersions) { $runtimeFullName = $minorVersion.DisplayText - $runtimeVersion = $minorVersion.value Write-Debug "$DEBUG_PREFIX runtime full name: $runtimeFullName" - Write-Debug "$DEBUG_PREFIX runtime version: $runtimeVersion" + $stackMinorVersion = $minorVersion.value + Write-Debug "$DEBUG_PREFIX stack minor version: $stackMinorVersion" $runtime = $null if (ContainsProperty -Object $minorVersion.stackSettings -PropertyName "windowsRuntimeSettings") { - $runtime = ParseMinorVersion -RuntimeVersion $runtimeVersion ` - -RuntimeSettings $minorVersion.stackSettings.windowsRuntimeSettings ` + $runtime = ParseMinorVersion -RuntimeSettings $minorVersion.stackSettings.windowsRuntimeSettings ` -RuntimeFullName $runtimeFullName ` - -PreferredOs $preferredOs + -PreferredOs $preferredOs ` + -StackMinorVersion $stackMinorVersion if ($runtime) { @@ -2153,11 +2161,10 @@ function SetLinuxandWindowsSupportedRuntimes if (ContainsProperty -Object $minorVersion.stackSettings -PropertyName "linuxRuntimeSettings") { - $runtime = ParseMinorVersion -RuntimeVersion $runtimeVersion ` - -RuntimeSettings $minorVersion.stackSettings.linuxRuntimeSettings ` + $runtime = ParseMinorVersion -RuntimeSettings $minorVersion.stackSettings.linuxRuntimeSettings ` -RuntimeFullName $runtimeFullName ` -PreferredOs $preferredOs ` - -StackIsLinux + -StackIsLinux $true if ($runtime) { @@ -2168,44 +2175,60 @@ function SetLinuxandWindowsSupportedRuntimes } } } -SetLinuxandWindowsSupportedRuntimes -# New-AzFunction app ArgumentCompleter for the RuntimeVersion parameter -# The values of RuntimeVersion depend on the selection of the Runtime parameter -$GetRuntimeVersionCompleter = { - - param ($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) +# This method pulls down the Functions stack definitions from the ARM API and builds a list of supported runtimes and runtime versions. +# This is used to build the tab completers for the New-AzFunctionApp cmdlet. +function RegisterFunctionsTabCompleters +{ + [Microsoft.Azure.PowerShell.Cmdlets.Functions.DoNotExportAttribute()] + param () - if ($fakeBoundParameters.ContainsKey('Runtime')) + if ($env:FunctionsTabCompletersRegistered) { - # RuntimeVersions is defined in SetLinuxandWindowsSupportedRuntimes - $AllRuntimeVersions[$fakeBoundParameters.Runtime] | Where-Object { - $_ -like "$wordToComplete*" - } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) } + return } -} -# New-AzFunction app ArgumentCompleter for the Runtime parameter -$GetAllRuntimesCompleter = { + SetLinuxandWindowsSupportedRuntimes - param ($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) + # New-AzFunction app ArgumentCompleter for the RuntimeVersion parameter + # The values of RuntimeVersion depend on the selection of the Runtime parameter + $GetRuntimeVersionCompleter = { - $runtimeValues = $AllRuntimeVersions.Keys | Sort-Object | ForEach-Object { $_ } + param ($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) - $runtimeValues | Where-Object { $_ -like "$wordToComplete*" } -} + if ($fakeBoundParameters.ContainsKey('Runtime')) + { + # RuntimeVersions is defined in SetLinuxandWindowsSupportedRuntimes + $AllRuntimeVersions[$fakeBoundParameters.Runtime] | Where-Object { + $_ -like "$wordToComplete*" + } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) } + } + } -# New-AzFunction app ArgumentCompleter for the Runtime parameter -$GetAllFunctionsVersionsCompleter = { + # New-AzFunction app ArgumentCompleter for the Runtime parameter + $GetAllRuntimesCompleter = { - param ($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) + param ($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) - $functionsVersions = $AllFunctionsExtensionVersions | Sort-Object | ForEach-Object { $_ } + $runtimeValues = $AllRuntimeVersions.Keys | Sort-Object | ForEach-Object { $_ } - $functionsVersions | Where-Object { $_ -like "$wordToComplete*" } -} + $runtimeValues | Where-Object { $_ -like "$wordToComplete*" } + } + + # New-AzFunction app ArgumentCompleter for the Runtime parameter + $GetAllFunctionsVersionsCompleter = { + + param ($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) -# Register tab completers -Register-ArgumentCompleter -CommandName New-AzFunctionApp -ParameterName FunctionsVersion -ScriptBlock $GetAllFunctionsVersionsCompleter -Register-ArgumentCompleter -CommandName New-AzFunctionApp -ParameterName Runtime -ScriptBlock $GetAllRuntimesCompleter -Register-ArgumentCompleter -CommandName New-AzFunctionApp -ParameterName RuntimeVersion -ScriptBlock $GetRuntimeVersionCompleter + $functionsVersions = $AllFunctionsExtensionVersions | Sort-Object | ForEach-Object { $_ } + + $functionsVersions | Where-Object { $_ -like "$wordToComplete*" } + } + + # Register tab completers + Register-ArgumentCompleter -CommandName New-AzFunctionApp -ParameterName FunctionsVersion -ScriptBlock $GetAllFunctionsVersionsCompleter + Register-ArgumentCompleter -CommandName New-AzFunctionApp -ParameterName Runtime -ScriptBlock $GetAllRuntimesCompleter + Register-ArgumentCompleter -CommandName New-AzFunctionApp -ParameterName RuntimeVersion -ScriptBlock $GetRuntimeVersionCompleter + + $env:FunctionsTabCompletersRegistered = $true +} diff --git a/src/Functions/Functions.Autorest/custom/New-AzFunctionApp.ps1 b/src/Functions/Functions.Autorest/custom/New-AzFunctionApp.ps1 index 8e23c640fbaa..7a71acd7a27f 100644 --- a/src/Functions/Functions.Autorest/custom/New-AzFunctionApp.ps1 +++ b/src/Functions/Functions.Autorest/custom/New-AzFunctionApp.ps1 @@ -210,6 +210,9 @@ function New-AzFunctionApp { ) process { + + RegisterFunctionsTabCompleters + # Remove bound parameters from the dictionary that cannot be process by the intenal cmdlets. $paramsToRemove = @( "StorageAccountName", diff --git a/src/Functions/Functions.Autorest/custom/New-AzFunctionAppPlan.ps1 b/src/Functions/Functions.Autorest/custom/New-AzFunctionAppPlan.ps1 index e9eb6b187ee8..6fce0099cb46 100644 --- a/src/Functions/Functions.Autorest/custom/New-AzFunctionAppPlan.ps1 +++ b/src/Functions/Functions.Autorest/custom/New-AzFunctionAppPlan.ps1 @@ -122,6 +122,9 @@ function New-AzFunctionAppPlan { ${ProxyUseDefaultCredentials} ) process { + + RegisterFunctionsTabCompleters + # Remove bound parameters from the dictionary that cannot be process by the intenal cmdlets. foreach ($paramName in @("Sku", "WorkerType", "MaximumWorkerCount", "MinimumWorkerCount", "Location", "Tag")) { diff --git a/src/Functions/Functions.Autorest/custom/Remove-AzFunctionApp.ps1 b/src/Functions/Functions.Autorest/custom/Remove-AzFunctionApp.ps1 index b0f7d67f0f4b..5f4aeaab42b1 100644 --- a/src/Functions/Functions.Autorest/custom/Remove-AzFunctionApp.ps1 +++ b/src/Functions/Functions.Autorest/custom/Remove-AzFunctionApp.ps1 @@ -83,6 +83,9 @@ function Remove-AzFunctionApp { ${ProxyUseDefaultCredentials} ) process { + + RegisterFunctionsTabCompleters + # The input object is an ISite. This needs to be transformed into a FunctionsIdentity if ($PsCmdlet.ParameterSetName -eq "ByObjectInput") { diff --git a/src/Functions/Functions.Autorest/custom/Remove-AzFunctionAppPlan.ps1 b/src/Functions/Functions.Autorest/custom/Remove-AzFunctionAppPlan.ps1 index 88a6081d9282..422741272d30 100644 --- a/src/Functions/Functions.Autorest/custom/Remove-AzFunctionAppPlan.ps1 +++ b/src/Functions/Functions.Autorest/custom/Remove-AzFunctionAppPlan.ps1 @@ -84,6 +84,9 @@ function Remove-AzFunctionAppPlan { ) process { + + RegisterFunctionsTabCompleters + if ($PsCmdlet.ParameterSetName -eq "ByObjectInput") { if ($PSBoundParameters.ContainsKey("InputObject")) diff --git a/src/Functions/Functions.Autorest/custom/Remove-AzFunctionAppSetting.ps1 b/src/Functions/Functions.Autorest/custom/Remove-AzFunctionAppSetting.ps1 index d7c8903b03d8..aed56f30f8bf 100644 --- a/src/Functions/Functions.Autorest/custom/Remove-AzFunctionAppSetting.ps1 +++ b/src/Functions/Functions.Autorest/custom/Remove-AzFunctionAppSetting.ps1 @@ -86,6 +86,8 @@ function Remove-AzFunctionAppSetting { ) process { + RegisterFunctionsTabCompleters + # Remove bound parameters from the dictionary that cannot be process by the intenal cmdlets $paramsToRemove = @( "AppSettingName" diff --git a/src/Functions/Functions.Autorest/custom/Restart-AzFunctionApp.ps1 b/src/Functions/Functions.Autorest/custom/Restart-AzFunctionApp.ps1 index d7888d825c64..b1d53043416b 100644 --- a/src/Functions/Functions.Autorest/custom/Restart-AzFunctionApp.ps1 +++ b/src/Functions/Functions.Autorest/custom/Restart-AzFunctionApp.ps1 @@ -85,6 +85,8 @@ function Restart-AzFunctionApp { process { + RegisterFunctionsTabCompleters + # The input object is an ISite. This needs to be transformed into a FunctionsIdentity if ($PsCmdlet.ParameterSetName -eq "ByObjectInput") { diff --git a/src/Functions/Functions.Autorest/custom/Start-AzFunctionApp.ps1 b/src/Functions/Functions.Autorest/custom/Start-AzFunctionApp.ps1 index 7f2c0b2aa76d..a1e5e2d30867 100644 --- a/src/Functions/Functions.Autorest/custom/Start-AzFunctionApp.ps1 +++ b/src/Functions/Functions.Autorest/custom/Start-AzFunctionApp.ps1 @@ -81,6 +81,8 @@ function Start-AzFunctionApp { process { + RegisterFunctionsTabCompleters + # The input object is an ISite. This needs to be transformed into a FunctionsIdentity. if ($PsCmdlet.ParameterSetName -eq "ByObjectInput") { diff --git a/src/Functions/Functions.Autorest/custom/Stop-AzFunctionApp.ps1 b/src/Functions/Functions.Autorest/custom/Stop-AzFunctionApp.ps1 index 4ae957eb697e..c8b8551baa54 100644 --- a/src/Functions/Functions.Autorest/custom/Stop-AzFunctionApp.ps1 +++ b/src/Functions/Functions.Autorest/custom/Stop-AzFunctionApp.ps1 @@ -85,6 +85,8 @@ function Stop-AzFunctionApp { process { + RegisterFunctionsTabCompleters + # The input object is an ISite. This needs to be transformed into a FunctionsIdentity. if ($PsCmdlet.ParameterSetName -eq "ByObjectInput") { diff --git a/src/Functions/Functions.Autorest/custom/Update-AzFunctionApp.ps1 b/src/Functions/Functions.Autorest/custom/Update-AzFunctionApp.ps1 index 47c80bfc561d..32f7c40bd521 100644 --- a/src/Functions/Functions.Autorest/custom/Update-AzFunctionApp.ps1 +++ b/src/Functions/Functions.Autorest/custom/Update-AzFunctionApp.ps1 @@ -129,6 +129,9 @@ function Update-AzFunctionApp { ) process { + + RegisterFunctionsTabCompleters + # Remove bound parameters from the dictionary that cannot be process by the intenal cmdlets. $paramsToRemove = @( "PlanName", diff --git a/src/Functions/Functions.Autorest/custom/Update-AzFunctionAppPlan.ps1 b/src/Functions/Functions.Autorest/custom/Update-AzFunctionAppPlan.ps1 index 49f877512477..ffb50ddb8553 100644 --- a/src/Functions/Functions.Autorest/custom/Update-AzFunctionAppPlan.ps1 +++ b/src/Functions/Functions.Autorest/custom/Update-AzFunctionAppPlan.ps1 @@ -117,6 +117,9 @@ function Update-AzFunctionAppPlan { ${ProxyUseDefaultCredentials} ) process { + + RegisterFunctionsTabCompleters + # Remove bound parameters from the dictionary that cannot be process by the intenal cmdlets. foreach ($paramName in @("Sku", "MaximumWorkerCount", "MinimumWorkerCount", "Tag")) { diff --git a/src/Functions/Functions.Autorest/custom/Update-AzFunctionAppSetting.ps1 b/src/Functions/Functions.Autorest/custom/Update-AzFunctionAppSetting.ps1 index b7c7869be7f6..d50ed31da9f0 100644 --- a/src/Functions/Functions.Autorest/custom/Update-AzFunctionAppSetting.ps1 +++ b/src/Functions/Functions.Autorest/custom/Update-AzFunctionAppSetting.ps1 @@ -85,6 +85,8 @@ function Update-AzFunctionAppSetting { ) process { + RegisterFunctionsTabCompleters + # Remove bound parameters from the dictionary that cannot be process by the intenal cmdlets $paramsToRemove = @( "AppSetting" diff --git a/src/Functions/Functions.Autorest/test/New-AzFunctionApp.Tests.ps1 b/src/Functions/Functions.Autorest/test/New-AzFunctionApp.Tests.ps1 index 08d743200cac..e80cb941afc6 100644 --- a/src/Functions/Functions.Autorest/test/New-AzFunctionApp.Tests.ps1 +++ b/src/Functions/Functions.Autorest/test/New-AzFunctionApp.Tests.ps1 @@ -16,6 +16,7 @@ Describe 'New-AzFunctionApp' { It 'CustomDockerImage' { $functionName = $env.functionNameContainer + $expectedLinuxFxVersion = "DOCKER|divyag2411/test:customcontainer" try { @@ -28,6 +29,7 @@ Describe 'New-AzFunctionApp' { $functionApp = Get-AzFunctionApp -Name $functionName -ResourceGroupName $env.resourceGroupNameLinuxPremium $functionApp.OSType | Should -Be "Linux" $functionApp.Runtime | Should -Be "Custom Image" + $functionApp.SiteConfig.LinuxFxVersion | Should -Be $expectedLinuxFxVersion # For a custom container image, the app setting `FUNCTIONS_EXTENSION_VERSION` should not be set. # TODO: Uncomment this line once https://msazure.visualstudio.com/Antares/_workitems/edit/6386493 has been fixed.