This extension provides an Azure Functions app with Open API capability for better discoverability to consuming parties
Перейти к файлу
Justin Yoo 3607ab87c4
Add implicit DI feature for out-of-proc worker (#523)
2022-12-20 17:14:37 +09:00
.devcontainer Add devcontainer settings (#497) 2022-10-17 20:07:17 +09:00
.github .NET 7 support for out-of-process worker (#522) 2022-12-20 14:14:30 +09:00
.vscode Update vscode settings 2022-04-29 10:25:38 +09:00
actions Update OpenAPI doc script 2022-10-24 09:02:41 +00:00
builds .NET 7 support for out-of-process worker (#522) 2022-12-20 14:14:30 +09:00
docs Add doc for authN scenarios (#500) 2022-10-18 16:12:15 +09:00
images Revising .NET 5 Isolated Worker (#187) 2021-08-04 23:47:45 +09:00
release-notes Add release note for v1.4.0 2022-08-22 17:40:12 +09:00
samples Add implicit DI feature for out-of-proc worker (#523) 2022-12-20 17:14:37 +09:00
src Add implicit DI feature for out-of-proc worker (#523) 2022-12-20 17:14:37 +09:00
templates Revising .NET 5 Isolated Worker (#187) 2021-08-04 23:47:45 +09:00
test .NET 7 support for out-of-process worker (#522) 2022-12-20 14:14:30 +09:00
test-integration .NET 7 support for out-of-process worker (#522) 2022-12-20 14:14:30 +09:00
.editorconfig Initial code commit (#1) 2020-08-25 21:26:37 +09:00
.gitignore Revising .NET 5 Isolated Worker (#187) 2021-08-04 23:47:45 +09:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-07-20 11:55:55 -07:00
CONTRIBUTING.md Add issue template 2021-09-25 11:21:30 +09:00
LICENSE Initial LICENSE commit 2020-07-20 11:55:57 -07:00
Microsoft.Azure.WebJobs.Extensions.OpenApi.sln .NET 7 support for out-of-process worker (#522) 2022-12-20 14:14:30 +09:00
README.md Update README 2022-10-20 16:13:13 +00:00
SECURITY.md Initial SECURITY.md commit 2020-07-20 11:55:58 -07:00
Settings.StyleCop Initial code commit (#1) 2020-08-25 21:26:37 +09:00
global.json Add global.json to avoid pre-released .NET SDK 2022-02-09 14:09:07 +09:00
key.snk Add sign key 2021-10-07 00:50:10 +09:00

README.md

Azure Functions OpenAPI Extension

Out-of-Proc Worker In-Proc Worker

Acknowledgement

Getting Started

GitHub Actions Support

If you are using GitHub Actions as your preferred CI/CD pipeline, you can run the GitHub Action into your workflow to automatically generate the OpenAPI document. Find more details at the Build OpenAPI action page.

Generic CI/CD Pipeline Support

Alternatively, you can run either PowerShell script or bash shell script to generate the OpenAPI document within your own CI/CD pipeline other than GitHub Actions. Here are two script files:

  • PowerShell: Get-OpenApiDocument.ps1

    ./actions/Get-OpenApiDocument.ps1 `
        -FunctionAppPath    <function app directory> `
        -BaseUri            <function app base URI> `
        -Endpoint           <endpoint for OpenAPI document> `
        -OutputPath         <output directory for generated OpenAPI document> `
        -OutputFilename     <OpenAPI document name> `
        -Delay              <delay in second between run function app and document generation> `
        -UseWindows         <switch indicating whether to use Windows OS or not>
    

    For more details, run Get-OpenApiDocument.ps1 -Help

    You can also remotely invoke this PowerShell script:

    & $([Scriptblock]::Create($(Invoke-RestMethod https://aka.ms/azfunc-openapi/generate-openapi.ps1))) `
        -FunctionAppPath    <function app directory> `
        -BaseUri            <function app base URI> `
        -Endpoint           <endpoint for OpenAPI document> `
        -OutputPath         <output directory for generated OpenAPI document> `
        -OutputFilename     <OpenAPI document name> `
        -Delay              <delay in second between run function app and document generation> `
        -UseWindows         <switch indicating whether to use Windows OS or not>
    
  • Bash shell: get-openapi-document.sh

    ./actions/get-openapi-document.sh \
        -p|--functionapp-path   <function app directory> \
        -u|--base-uri           <function app base URI> \
        -e|--endpoint           <endpoint for OpenAPI document> \
        -o|--output-path        <output directory for generated OpenAPI document> \
        -f|--output-filename    <OpenAPI document name> \
        -d|--delay              <delay in second between run function app and document generation>
    

    For more details, run get-openapi-document.sh --help

    You can also remotely invoke this bash shell script:

    curl -fsSL https://aka.ms/azfunc-openapi/generate-openapi.sh \
        | bash -s -- \
            -p|--functionapp-path   <function app directory> \
            -u|--base-uri           <function app base URI> \
            -e|--endpoint           <endpoint for OpenAPI document> \
            -o|--output-path        <output directory for generated OpenAPI document> \
            -f|--output-filename    <OpenAPI document name> \
            -d|--delay              <delay in second between run function app and document generation>
    

Sample Azure Function Apps with OpenAPI Document Enabled

Here are sample apps using the project references:

Azure Functions V1 Support

This library supports Azure Functions V3 and onwards. If you still want to get your v1 and v2 runtime app supported, find the community contribution or the proxy feature.

Known Issues

Missing .dll Files

Due to the Azure Functions Runtime limitation, sometimes some of .dll files are removed while publishing the function app. In this case, try the following workaround with your function app .csproj file.

<Project Sdk="Microsoft.NET.Sdk">
  ...
  <PropertyGroup>
    ...
    <_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
  </PropertyGroup>
  ...
</Project>

Empty Swagger UI When Deployed through Azure Pipelines

Swagger UI Error When Empty Project Referenced

Issues?

While using this library, if you find any issue, please raise an issue on the Issue page.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.