Skip to content
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

App builder extension method to register extension options #1843

Merged
merged 8 commits into from
Aug 29, 2023

Conversation

liliankasem
Copy link
Member

@liliankasem liliankasem commented Aug 17, 2023

Issue describing the changes in this PR

Related issue: #1826

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

@liliankasem liliankasem changed the title Extension method to register extension options for FSharp projects Extension method to register extension options Aug 17, 2023
@liliankasem liliankasem marked this pull request as ready for review August 18, 2023 19:18
@liliankasem
Copy link
Member Author

@mattchenderson we will need to update the docs to make sure folks are aware that if they use Cosmos, Tables or Blob extensions, they will need to register via the ext method:

module Program

open Microsoft.Extensions.Hosting
open Microsoft.Azure.Functions.Worker

module Program =
    [<EntryPoint>]
    let main _ =
        let hostBuilder = new HostBuilder()

        // FSharp applications need to configure the Cosmos, Blob and/or Table extensions manually.
        hostBuilder.ConfigureFunctionsWorkerDefaults(fun (context: HostBuilderContext) (appBuilder: IFunctionsWorkerApplicationBuilder) ->
            appBuilder.ConfigureCosmosDB() |> ignore
            appBuilder.ConfigureBlobStorage() |> ignore
            appBuilder.ConfigureTables() |> ignore
        ) |> ignore

        let host = hostBuilder.Build()
        host.Run()

        0

Probably calls for a templates update as well

@liliankasem liliankasem requested a review from jviau August 22, 2023 17:58
@liliankasem liliankasem changed the title Extension method to register extension options App builder extension method to register extension options Aug 28, 2023
@liliankasem liliankasem merged commit 170945f into main Aug 29, 2023
23 checks passed
@liliankasem liliankasem deleted the liliankasem/funcbuilderexts branch August 29, 2023 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants