Azure / Azure/azure-functions-openapi-extension
Question: Multiple Azure Function Apps projects in one solution - in-process solution
- Dominant language
- C#
- Stars
- 388
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
Hello, I would like to request assistance with using OpenAPI for a solution where I have multiple Azure Functions Apps projects. My solution has one common Startup file added to each of the projects as a Project Reference. I am using .NET 6.
I have installed Microsoft.Azure.WebJobs.Extensions.OpenApi for all Azure Function App projects and the project with the Startup file (the Startup project contains only this class + configuration).
When I run a single function locally, the documentation is generated. However, when I run my entire local server, I receive an error: "Could not load file or assembly 'Microsoft.Azure.WebJobs'" - I also have this package installed.
Is it possible to generate documentation for my scenario? Do I need to add any additional configuration?
Sample solution structure:
Server
- AzFuncApp1
-- Function11
-- Function12
- AzFuncApp2
-- Function21
-- Function22
- StartupProject
-- StartupClass
For the functions I'm interested in, I have added:
```
[OpenApiOperation(operationId: "AddTags")]
[OpenApiSecurity("function_key", SecuritySchemeType.ApiKey, Name = "code", In = OpenApiSecurityLocationType.Query)]
[OpenApiRequestBody("application/json", typeof(IReadOnlyList),
Description = "JSON request body containing { hours, capacity}")]
[OpenApiResponseWithBody(statusCode: HttpStatusCode.OK, contentType: "application/json", bodyType: typeof(StatusResponse),
Description = "Statuses:\n\r - 0 - Ok status,\n\r - 1 - test")]
```
Is it possible to generate documentation for my scenario? Do I need to add any additional configuration?
Best regards,
Dawid
Contributor guide
Research direction
Start by comparing the shared StartupProject reference and package setup across AzFuncApp1 and AzFuncApp2, then run one function app and the entire local server to reproduce the Microsoft.Azure.WebJobs assembly error. Check how Microsoft.Azure.WebJobs.Extensions.OpenApi is loaded in each project. Done means documentation generates for the multi-project solution without the assembly-load failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, openapi
- Domain
- api, backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100