Skip to content

Commit

Permalink
Some fixes around flex deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mligtenberg committed Dec 9, 2024
1 parent 6695fe2 commit 3d54909
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
36 changes: 33 additions & 3 deletions Deployment/testFunctions/parts/linuxFunctionFlex.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ param testPath string
param sku string = ''
param sortOrder int
param useDotnetIsolated bool = false
var deploymentStorageContainerName = 'deployments'

@allowed(['dotnet', 'dotnet-isolated', 'node', 'java', 'powershell', 'python'])
param workerRuntime string

@allowed(['Csharp', 'Nodejs', 'Python', 'Java', 'Fsharp'])
param language string

@allowed(['dotnet-isolated|8.0', 'node|20'])
param fxVersion string
@allowed(['8.0', '20'])
param functionAppRuntimeVersion string

@allowed(['~4'])
param runtimeVersion string

var fxVersion = '${language}|${functionAppRuntimeVersion}'

resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' = {
name: '${functionName}stor'
location: location
Expand All @@ -44,6 +47,14 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' = {
resource tableServices 'tableServices' = {
name: 'default'
}

resource blobServices 'blobServices' = {
name: 'default'

resource deployments 'containers' = {
name: deploymentStorageContainerName
}
}
}

resource functionFarm 'Microsoft.Web/serverfarms@2022-03-01' = {
Expand All @@ -59,13 +70,32 @@ resource functionFarm 'Microsoft.Web/serverfarms@2022-03-01' = {
}
}

resource function 'Microsoft.Web/sites@2022-03-01' = {
resource function 'Microsoft.Web/sites@2024-04-01' = {
name: functionName
location: location
kind: 'functionapp,linux'
properties: {
serverFarmId: functionFarm.id
httpsOnly: true
functionAppConfig: {
deployment: {
storage: {
type: 'blobContainer'
value: '${storageAccount.properties.primaryEndpoints.blob}${deploymentStorageContainerName}'
authentication: {
type: 'SystemAssignedIdentity'
}
}
}
scaleAndConcurrency: {
maximumInstanceCount: 10
instanceMemoryMB: 2048
}
runtime: {
name: workerRuntime
version: functionAppRuntimeVersion
}
}
siteConfig: {
ftpsState: 'FtpsOnly'
minTlsVersion: '1.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module csharpLinuxFlex '../../../../Deployment/testFunctions/parts/linuxFunction
registrationName: 'AzureCsharpNet8LinuxFlex'
testPath: '/api/Trigger'
sortOrder: 118
fxVersion: 'dotnet-isolated|8.0'
functionAppRuntimeVersion: '8.0'
useDotnetIsolated: true
}
}
2 changes: 1 addition & 1 deletion src/Azure/Nodejs/deployment.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module csharpLinuxFlex '../../../Deployment/testFunctions/parts/linuxFunctionFle
registrationName: 'AzureNodeLinux'
testPath: '/api/Test'
sortOrder: 205
fxVersion: 'node|20'
functionAppRuntimeVersion: '20'
}
}

Expand Down

0 comments on commit 3d54909

Please sign in to comment.