I use the maven-plugin-for-azure-functions
to create a Java Function App with a custom Trigger Binding. The custom trigger is created by another .Net project and publishs its artifacts via an Azure Devops Artifacts feed as an universal package.
I consume the custom trigger as universal package to get rid of the .Net dependencies during my Java Function App build.
While I download the package and copy its content into the stagingDirectory
, the maven-plugin-for-azure-functions
tries to install some extensions, too.
[INFO] Step 8 of 8: Installing function extensions if needed
...
[INFO] Function extension installation done.
The step creates a extensions.csproj
with some default extensions and overrides the files of my custom extension. I tried to remove the PackageReference
elements, but it's reverted with every package
run.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<WarningsAsErrors></WarningsAsErrors>
<DefaultItemExcludes>**</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid" Version="2.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.1.3" />
</ItemGroup>
</Project>
How can I disable the function extensions installation?
I found some workaround for the implicit extension installation of the plugin.
During the
prepare-package
phase, I replace thehost.json
with some dummy file, which suppresses the installation process.Therefore the plugin skips the extension installation.
I moved the script for the universal package download to the
package
phase, which is executed after the plugin. The script also reverts thehost.json
by removing theextensionBundle
property and copies the reverted file to thestagingDirectory
.The resulting archive contains the
bin
folder of the universal package finally with the correcthost.json
.