Out-of-Proc Worker | In-Proc Worker |
---|---|
- Swagger UI version used for this library is v3.44.0 under the Apache 2.0 license.
- Enable OpenAPI documents to your Azure Functions HTTP Trigger: This document shows how to enable OpenAPI extension on your Azure Functions applications and render Swagger UI, and OpenAPI v2 and v3 documents on-the-fly.
- Securing Azure Functions Endpoints through OpenAPI Auth: This document shows many various scenarios to add authN features including the built-in features and OAuth2 auth flows.
- Azure Functions v1 Support: This document shows how to support Azure Functions v1 runtime with this OpenAPI extension.
- Integrating OpenAPI-enabled Azure Functions to Azure API Management: This document shows how to integrate the Azure Functions application with Azure API Management, via this OpenAPI extension.
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.
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>
Here are sample apps using the project references:
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.
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>
- Workaround: #306
- Workaround: #302
While using this library, if you find any issue, please raise an issue on the Issue page.
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 [email protected] with any additional questions or comments.