maven azure function to package/wrap additional resources (outside jar)

Andreas Nef 0 Reputation points
2023-09-22T08:45:00.85+00:00

Hi

I am working on a Maven azure function. Generally this is working fine, but I am struggling with resources that I would need to be deployed outside the jar file.

Currently, everything from /src/main/resources will end up within the jar package. However, certain third-party-libraries cannot read configurations from within the jar, but need local file paths.

  • Is there a way to automatically have the deploy process unpackage certain resources?
  • Can I specify resources to be part of the package but external to the jar? (I see that the dependencies for example are not bundled into the jar, but reside along it.)
  • Or do I have to do this "manually" during initialization?
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,916 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2023-09-26T20:02:49.39+00:00

    Hi @Andreas Nef

    If you haven't already, Azure Functions load third-party libraries that have been added to pom.xml or placed in the lib directory under the project root. As long as your third-party library doesn't need any special OS access, I would think worker would handle the install of these package references. This shouldn't be anything manually done by you. If you're doing this and hitting errors, please comment below with the dependency that isn't playing fair so we can look into it.

    Another option you can do is go the container app route. This will allow you complete flexibility in configuring your third-party libraries as need with access to whatever local paths that are required.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.