Skip to content

Add support for CosmosDB triggers in Functions#7248

Merged
captainsafia merged 2 commits intomainfrom
safia/cosmosdb-func
Jan 27, 2025
Merged

Add support for CosmosDB triggers in Functions#7248
captainsafia merged 2 commits intomainfrom
safia/cosmosdb-func

Conversation

@captainsafia
Copy link
Copy Markdown
Contributor

Description

Adds support for CosmosDB-based triggers to Azure Functions. Tested with the following:

  • Entra ID-based CosmosDB connection
  • Access key-based CosmosDB connection

Ran into issues testing with classic emulator on Windows but putting this out in the meanwhile. Marked CosmosDB as an unstable emulator since it's long startup times seem to be timing out the E2E tests locally.

The preview emulator doesn't yet support the change feed feature that the CosmosDB trigger takes a dependency on.

Contributes to #7087

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Comment thread src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBResource.cs Outdated
@davidfowl
Copy link
Copy Markdown
Contributor

What are the follow up changes?

Copy link
Copy Markdown
Contributor

@davidfowl davidfowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@captainsafia
Copy link
Copy Markdown
Contributor Author

What are the follow up changes?

  • Figure out what the deal is with the classic emulator. I have a suspicion that the issues I ran into are more so related some Functions issues in VS preview than the actual emulator.
  • Figure out when change feed support will be added to the preview emulator and validate the E2E with it then.

@davidfowl
Copy link
Copy Markdown
Contributor

OK no code changes per se but experience problems with the emulator.

@captainsafia
Copy link
Copy Markdown
Contributor Author

OK no code changes per se but experience problems with the emulator.

Yep -- I don't expect there to be any code changes.

@captainsafia captainsafia merged commit af28155 into main Jan 27, 2025
@captainsafia captainsafia deleted the safia/cosmosdb-func branch January 27, 2025 18:05
@eerhardt
Copy link
Copy Markdown
Member

Are there tests we can write for this functionality?

@captainsafia
Copy link
Copy Markdown
Contributor Author

Are there tests we can write for this functionality?

Yes, we can build on the AzureFunctionsTest that we include in the project-specific tests. The tests are super flaky for me locally so I wanted to include this without introducing issues into the CI build.

@github-actions github-actions Bot locked and limited conversation to collaborators Feb 27, 2025
@github-actions github-actions Bot added the area-integrations Issues pertaining to Aspire Integrations packages label Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants