-
Notifications
You must be signed in to change notification settings - Fork 7
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
Deploy using VS or VS Code #3
Comments
It's great that you will find this project helpful! I can completely understand you wanting to avoid the Java environment (it can be a massive pain). But, that was exactly the goal of sharing this project -- to hopefully help you get past that and get on to more important things. Unfortunately I don't think there is an easier way around other than to just install IntelliJ IDEA Community -- it's by far the easiest and best Java IDE's and using it to publish the project to Azure Functions is likely the easiest and most efficient way to get it up and running . . . other than having someone else do it for you. The Maven parts should all be in place, so the key steps are:
There may be a way to automate deployment via some GitHub Actions, but I've not worked through that because once I got the environment up and running, it's just soo easy to deploy as needed via the Toolkit in the IDE. Remember to give the project a Star, Thanks! |
@rdorris FYI.... I'm investigating the use of VS Code . . . I'll get back to you if I get it working. |
I've installed java and maven and opened the project in code. Installed a bunch of extensions for java build/debug and hit run. Got the following... anything useful to you? [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ apachefop-serverless-az-func --- |
my java: I did have to add |
As noted in the Readme and in my post above, Azure Functions only supports very specific versions of Java 8 (aka v1.8), or Java 11. And I’ve updated this project to now use Java 11 with Functions runtime V3! So you need to make sure your system is using the Zulu Java 11, anything else will not work due to dependencies of the Azure Functions libraries! |
Yep, starting at the beginning and uninstalled everything. And have installed Azure Functions 3.0.3477 |
I’ve logged off for the day… as noted above I tried to get VSCode to import the current project and load it, but it was missing various key project elements…. But even after adding a valid I did get some really odd module import conflicts but those then magically disappeared after banging on it a while (figuratively speaking). But all that leads me too believe that even more project setup/config issues exist. I think the next strategy is to get a ”Hello World” Java Azure Function working and running locally first, and then migrate the ApacheFOP.Serverless source into that working solution folder for VSCode, and that may make it more reliable. In theory both VSCode & IntelliJ project settings/config can coexist together so this would be a really nice thing to commit with the solution….but it’ll take more time next week to iron out a working POC and try again. |
Ok, I didn't realize you were marching down the IntelliJ Path... here's one last response (before my Wife kills me)... Add each of the following Keys into that App Settings list for your run configuration and see if this helps it to run locally:
I guess the run configuration is not saved with the project.... I do suppose I could beef up the Readme file a bit. And probably even do a video of a from scratch setup; I just haven't been able to afford any downtime to uninstall it all since I use this pretty often for my projects . . . 😁 |
So I did as you suggested... I created a new java function project in VS and then copied over your code. Few configuration changes here and there and I think I have it working! |
Do you want any of the stuff I did to get it working in VS Code? |
@rdorris Yes I did get the very generous coffee donation you sent! It's very much appreciated and totally made my day! I will certainly enjoy several E22's!!! Yes, that's awesome that you have it working well in VSCode! I really do think that would be an excellent addition to the project -- as I wasn't aware that VSCode experience with Java would be very good, but as you noted it's perfect for those that don't want/need to install another IDE (though there is still some setup specific for Java). But, absolutely, please submit a PR for me to check out 👍👍👍! |
AzureFOP.zip |
Awesome, yes I knew something would need to be excluded but I could not quickly find where the conflict was being caused....There is definitely a different behavior between VS Code Java Extensions and Maven . . . whereby Maven was resolving conflicts just fine. Bravo for tracking them down! So are you liking the experience via VS Code? |
I’m in VS Studio all day but thought the java work would be easier to get installed in VS Code. It was fairly simple to build a “hello world” java azure function and then copy over your code.
Had to do a little searching to see how dependencies were resolved in pom.xml and a quick stackoverflow search to figure out the appropriate excludes. Deploying from VS Code was click-simple.
I did want to deploy via CI/CD with Azure DevOps, but I’d have to learn more about Maven, and that was more effort than I wanted to invest right now.
In the end, I’ve got it running on Azure Functions and creating PDF’s for me. They don’t look great yet, but we’re moving forward at least.
By the way, we use Altova Stylevision to create xslt files for converting our xml into html, Word, and FO. I’m then sending the fo file to the Azure Function. I think it will be much better than our old way of using a 3rd party package to convert from html to pdf directly.
Thanks again for your work on this!
|
Gotcha... so you guys are already syndicating content to different formats... yeah Apache FOP should work much better than Html to Pdf converters. If you're interested I wrote a whole blog piece on that topic (as I often have to explain this to clients so it was easier to just consolidate it into a couple articles:
Once you get the hang of the Xsl-FO markup you can create pretty decent looking reports... with combination of portrait/landscape, etc. The main tip for layout is to realize that the old-days of table-based-layouts work really well with Xsl-FO :-) and always avoid absolute positioning. Nesting tables and creating helper functions to create default empty blocks and table structures will greatly help. At our current client we post-process the docs with PdfSharp helpers to then merge in other Pdfs and Images uploaded by users that have been resized and normalized . . . Good Luck! |
I started playing around with this project. @cajuncoding, big thanks. I managed to deploy it without installing java or IntelliJ. I used GitHub Actions and @rdorris code posted in #3 (comment) and following the steps found here. I changed only the following settings:
Now I have a CI/CD in place for a java Azure Function without even having java installed locally on my dev machine! I will further test in the future but at the moment the sample works. @cajuncoding, @rdorris great work! |
@eferfolja that's great! Of course you won't be able to test/debug the actual code locally, but if you're just debugging your own Xsl-FO markup then you may not need to actually run locally. Because the event log is returned to you if you have the debugging enabled in the Azure Function configuration values... (I've fixed a couple encoding bugs recently affecting that)... If you don't mind, give the project a Star 🌟 Thanks for Sharing! 👏👏👏 |
FYI @rdorris I finally had time to work through this and have now fully updated the project to work with VS Code & IntelliJ IDEA. 🙌 now tagged as version All configuration files for both VS Code & IntelliJ (of which both use folder context configs) have been included in the code and checked into the repository. This should make it easier for anyone to get up and running with either IDE ✅. I also resolved several issues as follows:
Have also now tested all of the following to now be working in both VS Code & IntelliJ IDEA:
|
This project looks like exactly what I need. However, and as you hint at in the readme, I have little experience with Java/Maven/etc but do use VS and Azure daily (C#/Asp.net core).
Would you be able to provide simple instructions using VS or VS Code for deployment? I'm trying to avoid the installation of another IDE and SDK.
Thanks for building this!
The text was updated successfully, but these errors were encountered: