-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Discussion] Azure Functions Runtime 2.0.11946 release with breaking changes for Java HttpTrigger Functions #57
Comments
FYI: @jdneo , @brunoborges , @JonathanGiles , @selvasingh @asavaritayal |
The new example shows building a response with a simple String. Is the .body(xxx).build() method capable of turning HashMaps into JSON automatically, as was previously the case prior to 2.0.11888 (using HttpRequestMessage.createResponse(HTTP_CODE, HashMap) when the function is defined to have a return type of HttpResponseMessage <HashMap<String, Object>>? This is critical to know, and I am not particularly interested in delving into MS source code. |
@TurtleBeach - Yes. It should work. Can you please share code snippet? that will help us verify it. |
@pragnagopa Here is what ought to be a working function (extracted from a function that works with 2.0.11857). The returns are still with old syntax, but presumably you can see what I expect to accomplish. As you can also surmise, I will have to change every return in every Http triggered function (6 functions, structured similarly, so almost every error causes an immediate return. I don't want to start making changes until (1) you tell me the new methods work, and (2) the maven tooling is ready to support the new release. I was planning a soft launch next week - this throws a very large wrench into the works. Let me know if you can't see the file.
|
@TurtleBeach - We posted the announcement as a heads up. Runtime release has not started yet. I will update the announcement once I have the exact ETA for the release. And yes, we will have maven plugin to use with the runtime changes. |
@pragnagopa I neglected to include samples of what I expect for return payloads, based on the code snippet: |
Here is the simplified version of your code I verified
Invocation result:
|
@pragnagopa Thanks! |
maven tools are now available in staging repo. I have updated the announcement issue with instructions on how to use the tooling. Will update the annoucement again once I have the exact ETA for rolling out the runtime. |
Hi @pragnagopa |
@betarabbit Before the newest maven tools are published, staging repo is needed. Newest staging repo is https://oss.sonatype.org/content/repositories/commicrosoftazure-2491/ |
@jdneo Thanks for confirmation. Do you have an ETA for it, by the way? |
@betarabbit It will be about 1-2 days after the server side new runtime updated. |
@jdneo, all Is this is related with issues that you mention before (or others) and 2.0.11946-alpha runtime is not ready yet or I miss something? |
Hi @lpawlik91 @pragnagopa Could be better to answer this question. But from my knowledge, the new runtime |
@lpawlik91 - for using latest runtime beta is the right version. Deployment for 2.0.11946-alpha is still in progress. I will update the announcement issue once the release completes |
New version of Azure Functions Maven plugin & archetype have been published: Since it will take about 2-3 days for Maven Central to update the newest artifact version. So before the newest version is updated, you may need to explicit set the archetype version during generating:
|
To anyone experiencing the same problem: Updating to maven-plugin beta-4 (with java-library beta-5) solves the problem with "Error: At least one binding has to be defined" error during runtime. |
@pragnagopa : Are the modificiations in settings.xml and pom.xml (pluginRepository) you mentioned in Azure/app-service-announcements#122 (comment) still necessary (besides the version change)? |
@hf-kklein No it's not necessary. The modification is used for staging verification. Since we have published tools to Maven Central. They can be removed. Just update
is fine. |
Since the upgrade, I'm seeing that my functions no longer return an HTTP response - eventually timing out. I've created a new sample project using archetypeVersion=1.13 and the same issue occurs. Logging shows
But nothing is returned to the caller. Nothing further is logged. This occurs both locally (using azure-functions:run, having updated the plugin to beta-4 and the java-library to beta-5) and when deployed to Azure. Any advice on how to debug/resolve this issue? |
@jo3yk I can only suggest looking carefully at your request.createResponse() code. I haven't started a new function from archetype, but after changing the maven and library references (along with getting the latest CLI code) my existing functions are working. For what it's worth comments on 2.0.11946 deployment: I am very disappointed that request.createResponseBuilder( ).body().build() still requires an enum. Assuming that MS eventually will support non-standard returns, I have to assume the argument will revert to an integer - which will entail another breaking change. Though I haven't looked at the source behind createResponseBuilder, I cannot imagine that it would have been hard to change the signature to an int now and do whatever was necessary inside the method to convert to an internal enum (though even an internal use of an enum is questionable in my view). Very frustrating. The use of an enum as the HttpMethod in the Http triggered function signature is marginally more understandable, though it gets transformed to a String in the "function.json" file so I am not sure why that had to be changed too. I get the feeling someone read Blochs' books and decided everything in the world should be an enum without further thought. The portal doesn't handle "WebHookType" : NONE in function.json in a way that makes sense to me. On the Azure portal, the default type for "Mode" is WebHook (it should be "Standard") - and more disconcerting, the type cannot be changed unless the function is running. Although it did not seem to affect my functions (I changed the mode to Standard, which then correctly set the Authentication to "function", which was in function.json, and also set the access method to POST, which was also in function.json), saved settings, and restarted the function and everything worked. I fear, however, that a default mode setting of WebHook will eventually cause problems if the real mode should be "Standard". |
@TurtleBeach Thanks for your reply. On the new sample project, I haven't made any changes to the generated code, I'm just trying (and failing) to run it as-is - so the response code is simply
|
Are you sure you have V2 CLI installed? I don't pretend to understand all the convoluted interactions between the libraries, maven, and CLI, but I do know they must be in synch. Scroll down to V2 Windows (assuming you are on a Windows platform: |
Thanks for the idea @TurtleBeach. I had v2.0.1-beta31 installed. I've just upgraded to v2.0.1-beta33, but it's made no difference. On further testing, the issue does seem to be specific to HttpResponseMessage - if I return a String instead, I get a response. In the HttpResponseMessage case, no exceptions are thrown, the function just seems to hang. It would be good to get some input from Microsoft. |
Could you provide a minimal working example of both the version that works and the modificated version that hangs?
|
@jo3yk - Please install latest version of Azure Functions CLI 2.0.1-beta.34 and run func, it should show following version info:
|
@hf-kklein Sure, the version that hangs is the unmodified generated archetype, using archetypeVersion=1.13. So the function is:
The working version simply changes the return type to String:
@pragnagopa I've upgraded to the latest version using chocolatey, that's 2.0.1-beta33. Do I have to use NPM instead to install beta34? And if so, do I need to uninstall the chocolatey version first? |
@jo3yk - We will publish to chocolatey soon. |
I just updated chocolatey and APT with the latest release |
@pragnagopa @ahmelsayed Thanks for making the update available - I can confirm that everything appears to be working now that I've upgraded. Thanks for your help! |
Discussion issue for Azure/app-service-announcements#122
The text was updated successfully, but these errors were encountered: