azure-maven-plugins
azure-maven-plugins copied to clipboard
Functions deploment failures with authentication via Service Principal
Plugin name and version
Plugin/Version:
azure-functions-maven-plugin
/ 1.4.0
Plugin configuration in your pom.xml
<azure.functions.maven.plugin.version>1.8.0</azure.functions.maven.plugin.version>
<azure.functions.java.library.version>1.4.0</azure.functions.java.library.version>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<version>${azure.functions.maven.plugin.version}</version>
<configuration>
<auth>
<client>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</client>
<tenant>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</tenant>
<certificate>path\to\your.pem</certificate>
<environment>AZURE</environment>
</auth>
<appName>${functionAppName}</appName>
<resourceGroup>functions-rg</resourceGroup>
<appServicePlanName>yourappserviceplan</appServicePlanName>
<region>eastus2</region>
<runtime>
<os>linux</os>
<javaVersion>8</javaVersion>
</runtime>
<appSettings>
<property>
<name>FUNCTIONS_EXTENSION_VERSION</name>
<value>~3</value>
</property>
</appSettings>
</configuration>
<executions>
<execution>
<id>package-functions</id>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
Expected behavior
Deployment succeeds
Actual behavior
Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.8.0:deploy (default-cli) on project Functions: Execution default-cli of goal com.microsoft.azure:azure-functions-maven-plugin:1.8.0:deploy failed: An API incompatibility was encountered while executing com.microsoft.azure:azure-functions-maven-plugin:1.8.0:deploy: java.lang.NoSuchMethodError: com.nimbusds.jwt.JWTClaimsSet.toJSONObject()Lnet/minidev/json/JSONObject;
Steps to reproduce the problem
Enable authentication with service principal certificate at azure-functions-maven-plugin configuration tag
<auth>
<client>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</client>
<tenant>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</tenant>
<certificate>path\to\your.pem</certificate>
<environment>AZURE</environment>
</auth>
Workaround
Downgrade nimbus-jose-jtw plugin from 9.0 to 8.20
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>8.20</version>
</dependency>
</dependencies>
@miguelch96 Thanks for your report, will looking into this issue soon
We cannot help since our dependency azure java sdk have version conflictions: see this issue: https://github.com/Azure/azure-sdk-for-java/issues/14898
Is there plan to resolve the issue in upcoming nimbus-jose-jwt plugin version?
Can you please provide an update on this when this issue will get resolved rather than applying an workaround
this issue should have disappeared in latest versions since we have upgraded the azure-sdk dependencies.