azure-maven-plugins
azure-maven-plugins copied to clipboard
Functions - "$ mvn package" goal should fill up local.setting.json for developers
Plugin name and version
Azure Functions Plugin - Beta-6
Plugin configuration in your pom.xml
NA
Expected behavior
When developers run $ mvn package
, the POM.xml
file carries all the necessary app settings. The plugin can use them to populate local.settings.json
file. This will make it easy for developers to run locally using $ mvn azure-functions:run
Actual behavior
Developers must manually populate local.settings.json
file. This takes time and is error prone. We tried to automate by writing some scripts to populate local.settings.json
and calling these scripts from package goal.
See examples: Script - https://github.com/Microsoft/inventory-hub-java-on-azure/blob/master/function-apps/Notify-Inventory/post-process-function.json.sh
Augment package goal - https://github.com/Microsoft/inventory-hub-java-on-azure/blob/master/function-apps/Notify-Inventory/pom.xml#L231
Not sure if this is handy for local versus remote deployment.
@nicenemo - this is for local deployment
Gave this one some thought - I realized that the local tools actually follow the following behavior:
- Look for a value from the environment variables
- Look for a value in local.settings.json
With that said I think you can actually get exactly what you want with core tools today. You just need to make sure the name of the environment variables match what the code describes. In other words instead of needing to map:
EventHubConnectionString: "%MyEventHubConnectionString%"
, just have an environment variable in something like setup-env
be EventHubConnectionString
. Any reason you'd need the extra mapping step?