We deploy Azure Function using the docker image. The application insights agent is manually provided as specified here: Java - Azure Application Insights Dynamic Tracing not working with docker images
This works fine when deployed via mvn azure-functions:deploy
. But doesn't work when deployed using azure dev-ops. These are the steps:
- We create the docker image and publish it to ACR
- We then provide the docker image to the below task:
Here is the ADO task
- task: AzureFunctionAppContainer@1
displayName: 'Azure Function App on Container Deploy: $(orchestratorfunctionappName)'
inputs:
azureSubscription: '${{ parameters.environments.serviceConnectionId }}'
appName: appName
imageName: 'appImage'
There is no clear documentation to provide the JAVA_OPTS
path
CodePudding user response:
Below worked for me:
- task: AzureFunctionAppContainer@1
displayName: 'Azure Function App on Container Deploy: $(orchestratorfunctionappName)'
inputs:
azureSubscription: '${{ parameters.environments.serviceConnectionId }}'
appName: appName
imageName: 'appImage'
appSettings: '-JAVA_OPTS "-javaagent:/home/site/wwwroot/applicationinsights-agent.jar"'
The agent needs to exist at that path on the image. (ref)