Functions are not showing up in Azure Function App
84017655
21
Reputation points
I have deployed an Azure Function App using Bicep and YAML pipeline. Function app uses java as
FUNCTIONS_WORKER_RUNTIME and is hosted on a P1v3 Service Plan.
Problem is that when I deploy functions on Function App, functions do not show up on Overview balde as shown above despite service pipeline runs successfully. I tried to attach Bicep and YAML file but .bicep and .yml extensions are not supported. Kindly help me in resolving this issue.
Here is Bicep code to deploy function App:
@description('Enter name of Integration')
param IntegrationName string
@description('Enter Service Name for KICS Resources')
param ServiceNameKicksMember string
@description('Enter location for your resources')
param Location string
@description('Enter Environment of the resource')
@allowed([
'Dev'
'Prod'
])
param Environment string
//Service Plan Sku
param SpSkuName string
param SpSkuTier string
// KeyVault
param KeyVaultName string
param KeyVaultRGName string
// Define the names for resources.
var aiName = toLower('ai-${IntegrationName}-weu-${Environment}')
var funcName = toLower('func-${Environment}')
var appPlanName = toLower('sp-weu-${Environment}')
var lwsName = toLower('lws-${IntegrationName}-weu-${Environment}')
var storageName = toLower('stoweu${Environment}')
// Function App Configurations
param LinuxFxVersion string
resource appInsightsComponents 'Microsoft.Insights/components@2020-02-02-preview' existing = {
name: aiName
}
resource logAnalyticsWorkspacesqlDbName 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = {
name: lwsName
}
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: storageName
location: Location
kind: 'StorageV2'
sku: {
name: 'Standard_LRS'
}
tags: resourceGroup().tags
}
resource keyVault 'Microsoft.KeyVault/vaults@2021-11-01-preview' existing = {
name: KeyVaultName
scope: resourceGroup(KeyVaultRGName)
}
resource appServicePlan 'Microsoft.Web/serverfarms@2024-04-01' = {
name: appPlanName
location: Location
properties: {
reserved: true
}
sku: {
name: SpSkuName
tier: SpSkuTier
}
tags: resourceGroup().tags
kind: 'linux'
}
resource azureFunction 'Microsoft.Web/sites@2024-04-01' = {
name: funcName
location: Location
kind: 'functionapp'
identity: {
type: 'SystemAssigned'
}
tags: resourceGroup().tags
properties: {
serverFarmId: appServicePlan.id
httpsOnly: true
reserved: true
siteConfig: {
linuxFxVersion: LinuxFxVersion
appSettings: [
{
name: 'AzureWebJobsStorage'
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${storageAccount.listKeys().keys[0].value}'
}
{
name: 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING'
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${storageAccount.listKeys().keys[0].value}'
}
{
name: 'WEBSITE_CONTENTSHARE'
value: toLower(funcName)
}
{
name: 'StorageConnection'
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${storageAccount.listKeys().keys[0].value}'
}
{
name: 'FUNCTIONS_EXTENSION_VERSION'
value: '~4'
}
{
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
value: appInsightsComponents.properties.ConnectionString
}
{
name: 'ApplicationInsightsAgent_EXTENSION_VERSION'
value: '~3'
}
{
name: 'APPLICATIONINSIGHTS_ENABLE_AGENT'
value: 'true'
}
{
name: 'XDT_MicrosoftApplicationInsights_Mode'
value: 'recommended'
}
{
name: 'FUNCTIONS_WORKER_RUNTIME'
value: 'java'
}
{
name: 'WEBSITE_RUN_FROM_PACKAGE'
value: '1'
}
]
}
}
}
Here is YAML file to deploy service/functions. I have removed confidential information.
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger: none
name: '$(Build.DefinitionName)-$(SourceBranchName)-$(rev:r)'
pool:
vmImage: ubuntu-latest
stages:
- stage: 'Build'
displayName: QTFunctionsApp-CI
jobs:
- job: 'Build'
displayName: 'Build Function App'
pool:
vmImage: 'ubuntu-latest'
demands: npm
steps:
- task: JavaToolInstaller@1
inputs:
versionSpec: '21'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: MavenAuthenticate@0
inputs:
artifactsFeeds: 'clubmatas-central'
- task: Maven@4
inputs:
azureSubscription: ''
mavenPomFile: 'AzureFunctions/MemberQueueTriggerFunc/pom.xml'
goals: 'package'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
- task: CopyFiles@2
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: '**/azure-functions/**'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(build.artifactstagingdirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/MemberQueueTriggerFunc/$(Build.BuildId).zip'
replaceExistingArchive: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: ''
publishLocation: 'Container'
- stage: 'Deploy'
dependsOn: Build
condition: succeeded()
displayName: 'QTMemberFunc-CD'
jobs:
- job:
displayName: 'Deploy to Dev'
steps:
- download: current
artifact: ''
- script: dir $(System.DefaultWorkingDirectory)
displayName: 'List contents of agent directory in Deploy stage'
- script: dir $(Pipeline.Workspace)/
displayName: 'List contents of downloaded artifact'
- task: AzureFunctionApp@2
inputs:
connectedServiceNameARM: ''
appType: 'functionAppLinux'
appName: 'func-dev'
package: '$(Pipeline.Workspace)//**/*.zip'
deploymentMethod: 'auto'
Sign in to answer