Azure / azure-functions-java-library

Contains annotations for writing Azure Functions in Java
MIT License
42 stars 42 forks source link

Missing output trigger for cosmo db with 4.x extension #190

Closed pankajagrawal16 closed 1 year ago

pankajagrawal16 commented 1 year ago

Unable to find any version which is compatible with extension 4.x to use cosmodb with indentity.

Documentation here says https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb-v2-output?tabs=in-process%2Cfunctionsv2&pivots=programming-language-java

For use with extension version 4.x, you need to replace the string collection in property and attribute names with container.`

Last merge seems to have those changes but nothing available on maven yet ? Latest release is 2.2.0

shreyas-gopalakrishna commented 1 year ago

Hi @pankajagrawal16 Thanks for reaching out. The 3.0.0-SNAPSHOT is a pre-release for testing purposes only to sonatype. Once ready, we will release the production version to maven.

To overcome your error, could you try setting this environment variable to check if this helps to get your code running. FUNCTIONS_EXTENSIONBUNDLE_SOURCE_URI= https://functionscdnstaging.azureedge.net/public

pankajagrawal16 commented 1 year ago

Hi @shreyas-gopalakrishna Thanks for quick response. I understand. Where should this environment variable be set ?

shreyas-gopalakrishna commented 1 year ago

Can you try setting it in the local.settings.json if you are running locally. App settings if you are running in the portal.

pankajagrawal16 commented 1 year ago

@shreyas-gopalakrishna Donot seem to work just by using this environment var in local json.

I updated host.json to use use 4.x extension bundle like this:

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle.Preview",
    "version": "[4.0.0, 5.0.0)"
  }
}

and added suggested env var in local json file. And it still fails. Anything else that i should have done ?

shreyas-gopalakrishna commented 1 year ago

Could you try removing the preview in host.json This PR can be an example

pankajagrawal16 commented 1 year ago

Hey @shreyas-gopalakrishna , I can confirm that it works with above config in the PR. Do we know of any ETA about when this will be release to maven central as well ?

shreyas-gopalakrishna commented 1 year ago

We are planning to release it soon. No ETA yet. Optimistically if all tests go okay, it can be by end of this year

pankajagrawal16 commented 1 year ago

ok, good to know. For some reason, things worked fine locally but when I tried deploying my function to cloud, it fails with error. Yet to figure out why. Anything you can think of already?

kaibocai commented 1 year ago

@pankajagrawal16 you should be able to run it on the cloud. The v4 bundle has been fully released. The azure-functions-java-library 3.0.0 has been released to maven central as well, it can be found at https://repo.maven.apache.org/maven2/com/microsoft/azure/functions/azure-functions-java-library/3.0.0/

Let me know if you have more questions. Thanks.

pankajagrawal16 commented 1 year ago

Sounds great. I can try it out sometime this week.