Skip to content

Commit

Permalink
[Functions] Upgrade to Microsoft.Web API version 2023-12-01 and add s…
Browse files Browse the repository at this point in the history
…upport for creating function apps on container apps (#25348)

* Upgrade to API version 2023-12-01

* Add support to create function apps ACA

* Use ManagedEnvironmentId to get the subscription id

* Update DefaultCentauriImage and update error messages

* Update Stacks and tab completers initialization logic

* Update logic to retrieve managed environment

* Add function app ACA test cases

* Update docs

* Add GetRandomStringValue function

* Fix typo in app name

* Add new test recordings

* Update string comparison logic

* Update stack's definition

* Update examples

* Rename MinReplicas to ScaleMinReplica and MaxReplicas to ScaleMaxReplica

* Update functions ACA test cases

* Update docs with new param names
  • Loading branch information
Francisco-Gamino authored Jun 24, 2024
1 parent 18158ad commit b6e37ef
Show file tree
Hide file tree
Showing 53 changed files with 10,416 additions and 8,871 deletions.
68 changes: 43 additions & 25 deletions src/Functions/Functions.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,27 @@ directive:
```
``` yaml
commit: 78eac0bd58633028293cb1ec1709baa200bed9e2
commit: d9f06f3de6cb00796a91b86b622dcf50340952a2
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2019-08-01/AppServiceCertificateOrders.json
- $(repo)/specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2019-08-01/CertificateRegistrationProvider.json
- $(repo)/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2019-08-01/Domains.json
- $(repo)/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2019-08-01/TopLevelDomains.json
- $(repo)/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2019-08-01/DomainRegistrationProvider.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/Certificates.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/CommonDefinitions.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/DeletedWebApps.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/Diagnostics.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/Provider.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/Recommendations.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/ResourceProvider.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/WebApps.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/StaticSites.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/AppServiceEnvironments.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/AppServicePlans.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/ResourceHealthMetadata.json
- $(repo)/specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-12-01/AppServiceCertificateOrders.json
- $(repo)/specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-12-01/CertificateRegistrationProvider.json
- $(repo)/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-12-01/Domains.json
- $(repo)/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-12-01/TopLevelDomains.json
- $(repo)/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-12-01/DomainRegistrationProvider.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/Certificates.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/CommonDefinitions.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/DeletedWebApps.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/Diagnostics.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/Provider.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/Recommendations.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/ResourceProvider.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/WebApps.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/StaticSites.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/AppServiceEnvironments.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/AppServicePlans.json
- $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2023-12-01/ResourceHealthMetadata.json
module-version: 1.0.1
title: Functions
subject-prefix: ''
Expand Down Expand Up @@ -126,6 +126,9 @@ metadata:
- Update-AzFunctionAppSetting

directive:
- remove-operation: WebApps_GetProductionSiteDeploymentStatus
- remove-operation: WebApps_GetSlotSiteDeploymentStatusSlot
- remove-operation: Workflows_RegenerateAccessKey
- from: WebApps.json
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}"].delete.responses.200
transform: delete $.schema
Expand Down Expand Up @@ -219,16 +222,16 @@ directive:
subject: SystemAssignedIdentity(.*)
hide: true
- where:
subject: WebAppBasicPublishingCredentialsPolicy
subject: (.*)BasicPublishingCredentialsPolicy(.*)
hide: true
- where:
subject: WebAppFunctionKey(.*)
hide: true
- where:
subject: WebAppScmAllowed
subject: (.*)ScmAllowed(.*)
hide: true
- where:
subject: WebAppSettingKeyVaultReference
subject: WebAppSettingKeyVaultReference(.*)
hide: true
- where:
subject: WebAppSyncStatus(.*)
Expand All @@ -245,7 +248,7 @@ directive:
hide: true
# Cmdlets to remove
- where:
subject: WebAppFtpAllowed
subject: (.*)WebAppFtpAllowed(.*)
remove: true
- where:
subject: WebAppPremierAddOn(.*)
Expand Down Expand Up @@ -443,7 +446,7 @@ directive:
subject: (.*)WebAppTriggered(.*)
remove: true
- where:
subject: (.*)WebAppUsage(.*)
subject: (.*)Usage(.*)
remove: true
- where:
subject: (.*)AzWebAppWeb(.*)
Expand All @@ -461,7 +464,7 @@ directive:
subject: (.*)Connection(.*)
remove: true
- where:
subject: (.*)WebAppDeployment(.*)
subject: (.*)OneDeploy(.*)
remove: true
- where:
subject: (.*)WebAppHost(.*)
Expand Down Expand Up @@ -512,7 +515,7 @@ directive:
subject: (.*)WebAppClone(.*)
remove: true
- where:
subject: Move(.*)
subject: (.*)Move(.*)
remove: true
- where:
subject: (.*)WebAppRepository(.*)
Expand All @@ -538,6 +541,21 @@ directive:
- where:
subject: (.*)StaticSite(.*)
remove: true
- where:
subject: (.*)Backup(.*)
remove: true
- where:
subject: (.*)CustomName(.*)
remove: true
- where:
subject: (.*)CustomHostName(.*)
remove: true
- where:
subject: (.*)Workflow(.*)
remove: true
- where:
subject: (.*)AseRegion(.*)
remove: true
- from: source-file-csharp
where: $
transform: $ = $.replace(/sb.AppendLine\(\$@\"\{Indent\}AliasesToExport = \{aliasesList\}\"\);/, '')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801
namespace Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201
{
public partial class AppServicePlan :
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServicePlan,
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServicePlanInternal,
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.IAppServicePlan,
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.IAppServicePlanInternal,
Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.IValidates
{
// This gets set via PowerShell. For more info, please see custom/HelperScripts/HelperFunctions.ps1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801
namespace Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201
{
public partial class Site :
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ISite,
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ISiteInternal,
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.ISite,
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.ISiteInternal,
Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.IValidates
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<View>
<Name>FunctionApp</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.Site</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.Site</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down Expand Up @@ -36,7 +36,7 @@
<View>
<Name>FunctionAppPlan</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.AppServicePlan</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.AppServicePlan</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down
15 changes: 12 additions & 3 deletions src/Functions/Functions.Autorest/custom/Functions.types.ps1xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<Types>
<Type>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.Site</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.Site</Name>
<Members>
<AliasProperty>
<Name>Status</Name>
Expand All @@ -13,12 +13,21 @@
</AliasProperty>
<ScriptProperty>
<Name>SubscriptionId</Name>
<GetScriptBlock>($this.ServerFarmId -split "/")[2]</GetScriptBlock>
<GetScriptBlock>
if ($this.ManagedEnvironmentId)
{
($this.ManagedEnvironmentId -split "/")[2]
}
else
{
($this.ServerFarmId -split "/")[2]
}
</GetScriptBlock>
</ScriptProperty>
</Members>
</Type>
<Type>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.AppServicePlan</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.AppServicePlan</Name>
<Members>
<AliasProperty>
<Name>ResourceGroupName</Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,80 @@
}
]
},
{
"displayText": ".NET 8 In-process",
"value": "dotnet8",
"minorVersions": [
{
"displayText": ".NET 8 (LTS) In-process",
"value": "8 (LTS), in-process model",
"stackSettings": {
"windowsRuntimeSettings": {
"isHidden": true,
"runtimeVersion": "v8.0",
"remoteDebuggingSupported": false,
"appInsightsSettings": {
"isSupported": true
},
"gitHubActionSettings": {
"isSupported": true,
"supportedVersion": "8.0.x"
},
"appSettingsDictionary": {
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"FUNCTIONS_INPROC_NET8_ENABLED": "1"
},
"siteConfigPropertiesDictionary": {
"use32BitWorkerProcess": true,
"netFrameworkVersion": "v8.0"
},
"supportedFunctionsExtensionVersions": [
"~4"
],
"supportedFunctionsExtensionVersionsInfo": [
{
"version": "~4",
"isDeprecated": false,
"isDefault": false
}
],
"endOfLifeDate": "Tue Nov 10 2026 00:00:00 GMT+0000 (Coordinated Universal Time)"
},
"linuxRuntimeSettings": {
"isHidden": true,
"runtimeVersion": "DOTNET|8.0",
"remoteDebuggingSupported": false,
"appInsightsSettings": {
"isSupported": true
},
"gitHubActionSettings": {
"isSupported": true,
"supportedVersion": "8.0.x"
},
"appSettingsDictionary": {
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"FUNCTIONS_INPROC_NET8_ENABLED": "1"
},
"siteConfigPropertiesDictionary": {
"use32BitWorkerProcess": true,
"linuxFxVersion": "DOTNET|8.0"
},
"supportedFunctionsExtensionVersions": [
"~4"
],
"supportedFunctionsExtensionVersionsInfo": [
{
"version": "~4",
"isDeprecated": false,
"isDefault": false
}
],
"endOfLifeDate": "Tue Nov 10 2026 00:00:00 GMT+0000 (Coordinated Universal Time)"
}
}
}
]
},
{
"displayText": ".NET 6 In-process",
"value": "dotnet6",
Expand Down Expand Up @@ -1455,13 +1529,14 @@
"isDeprecated": false,
"isDefault": true
}
]
],
"endOfLifeDate": "Tue Nov 10 2026 00:00:00 GMT+0000 (Coordinated Universal Time)"
},
"linuxRuntimeSettings": {
"runtimeVersion": "PowerShell|7.4",
"isDefault": false,
"isPreview": true,
"isHidden": true,
"isHidden": false,
"remoteDebuggingSupported": false,
"appInsightsSettings": {
"isSupported": true
Expand All @@ -1485,7 +1560,8 @@
"isDeprecated": false,
"isDefault": true
}
]
],
"endOfLifeDate": "Tue Nov 10 2026 00:00:00 GMT+0000 (Coordinated Universal Time)"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function Get-AzFunctionApp {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ISite])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.ISite])]
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Description('Gets function apps in a subscription.')]
[CmdletBinding(DefaultParametersetname="GetAll")]
param(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function Get-AzFunctionAppAvailableLocation {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IGeoRegion])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.IGeoRegion])]
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Description('Gets the location where a function app for the given os and plan type is available.')]
[CmdletBinding()]
param(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function Get-AzFunctionAppPlan {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IAppServicePlan])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.IAppServicePlan])]
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Description('Get function apps plans in a subscription.')]
[CmdletBinding(DefaultParameterSetName='GetAll')]
param(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function Get-AzFunctionAppSetting {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IStringDictionary])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.IStringDictionary])]
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Description('Gets app settings for a function app.')]
[CmdletBinding(DefaultParameterSetName='ByName', SupportsShouldProcess=$true, ConfirmImpact='Medium')]
param(
Expand All @@ -23,7 +23,7 @@ function Get-AzFunctionAppSetting {
${SubscriptionId},

[Parameter(ParameterSetName='ByObjectInput', Mandatory=$true, ValueFromPipeline=$true)]
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.ISite]
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.ISite]
[ValidateNotNull()]
${InputObject},

Expand Down
Loading

0 comments on commit b6e37ef

Please sign in to comment.