Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions deploment failures with authentication via Service Principal #1139

Open
miguelch96 opened this issue Sep 9, 2020 · 4 comments
Open

Comments

@miguelch96
Copy link

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;

image

image

image

image

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>

image

image

@Flanker32
Copy link
Member

@miguelch96 Thanks for your report, will looking into this issue soon

@andxu
Copy link
Contributor

andxu commented Oct 30, 2020

We cannot help since our dependency azure java sdk have version conflictions:
see this issue:
Azure/azure-sdk-for-java#14898

@ParimaladeviVadivel
Copy link

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

@wangmingliang-ms
Copy link
Contributor

this issue should have disappeared in latest versions since we have upgraded the azure-sdk dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants