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

Updating microsoft azure packages #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Collin256
Copy link

Issue

While building our Azure Function apps our team attempted to use the wrapper on the Microsoft Azure Java Function Tutorial referenced in the README.md of this repository.

We followed the README.md instructions as described to wrap the function in the wrapper.

Expected behavior:

On mvn clean, install the function will compile and generate a jar file.

Actual behavior:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project fabrikam-functions: Compilation failure
[ERROR] /C:/Src/azure-functions/fabrikam-functions/src/main/java/com/fabrikam/Function.java:[35,56] incompatible types: com.microsoft.azure.functions.ExecutionContext cannot be converted to com.microsoft.azure.serverless.functions.ExecutionContext

Change

While investigating this issue, it was discovered taht Microsoft depricated (or removed) a previous package class "com.microsoft.azure.serverles.functions". This package is used by the class MetricWrapper.java in this repo (alogn with the example function and the test class).

src

The following files have been updated in the src folder to use the new package "com.microsoft.azure.functions" and the associated updated methods (also minor formatting updates):

  • java/com/signalfx/azurefunctions/
    • example/Function.java
    • wrapper/MetricWrapper.java
  • test/java/comsignlafx/azurefunctions/
    -TestCustomHandler.java

pom.xml

The pom.xml file has been updated to reference the newer Microsoft dependency in both main dependencies and the test dependencies. The pom project version was not updated as it appears there is a py script to handle this

README.md

The readme has been updated to reflect the new invocation of the new package classes.

Test

This change was tested locally by building the maven project and creating a 0.0.2 version in the local .m2 repository. That version was then packaged into a test function and deployed to Azure through VS Code. The function was then invoked and it was verified that MTS data from the function was visible in the (SignalFX) Azure Function dashboard.

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

Successfully merging this pull request may close these issues.

1 participant