You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/openapi-core.md
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -139,6 +139,27 @@ public class OpenApiConfigurationOptions : IOpenApiConfigurationOptions
139
139
```
140
140
141
141
142
+
### Force HTTP or HTTPS for Swagger UI ###
143
+
144
+
> **NOTE**: If you use the [Linux Dedicated Plan](https://docs.microsoft.com/azure/azure-functions/dedicated-plan?WT.mc_id=github-0000-juyoo), you can consider this HTTP/HTTPS enforcement settings.
145
+
146
+
If you want to force either HTTP or HTTPS, configure the following properties on the `IOpenApiConfigurationOptions` interface.
You can set either property to `true`, and based on the combination of both, your Swagger UI renders contents through either HTTP or HTTPS. However, if you set both properties to `true`, HTTPS takes precedence.
Instead of implementing `IOpenApiConfigurationOptions`, you can inherit `DefaultOpenApiConfigurationOptions`. As `Info`, `Servers` and `OpenApiVersion` properties have the modifier of `virtual`, you can freely override them or leave them as default.
@@ -172,6 +193,9 @@ public class MyOpenApiConfigurationOptions : DefaultOpenApiConfigurationOptions
Copy file name to clipboardExpand all lines: docs/openapi-in-proc.md
+2-76Lines changed: 2 additions & 76 deletions
Original file line number
Diff line number
Diff line change
@@ -28,80 +28,6 @@ While using this library, if you find any issue, please raise a ticket on the [I
28
28
For detailed getting started document, find this [Enable OpenAPI Endpoints on Azure Functions (Preview) – In-Process Model](enable-open-api-endpoints-in-proc.md) page.
29
29
30
30
31
-
## Configuration ##
31
+
## Advanced Configuration in General ##
32
32
33
-
For the extension's advanced configuration, it expects the following config keys.
34
-
35
-
36
-
### Configure Authorization Level ###
37
-
38
-
As a default, all endpoints to render Swagger UI and OpenAPI documents have the authorisation level of `AuthorizationLevel.Anonymous`. However, if you want to secure those endpoints, change their authorisation level to `AuthorizationLevel.Function` and pass the API Key through either request header or querystring parameter. This can be done through the environment variables. Here's the sample `local.settings.json` file. The other values are omitted for brevity.
39
-
40
-
```json
41
-
{
42
-
"Values": {
43
-
"OpenApi__ApiKey": "",
44
-
"OpenApi__AuthLevel__Document": "Anonymous",
45
-
"OpenApi__AuthLevel__UI": "Anonymous"
46
-
}
47
-
}
48
-
```
49
-
50
-
You can have granular controls to both Swagger UI and OpenAPI documents by setting the authorisation level to `Anonymous`, `User`, `Function`, `System` or `Admin`. Make sure that you MUST provide the `OpenApi__AuthKey` value, if you choose the `OpenApi__AuthLevel__Document` value other than `Anonymous`. Otherwise, it will throw an error.
51
-
52
-
> [!NOTE]
53
-
> Both Swagger UI and OpenAPI document pages are allowed `Anonymous` access by default.
54
-
55
-
56
-
### Configure Swagger UI Visibility ###
57
-
58
-
You may want to only enable the Swagger UI page during the development time, and disable the page when publishing it to Azure. You can configure an environment variable to enable/disable the Swagger UI page. Here's the sample `local.settings.json` file. The other values are omitted for brevity.
59
-
60
-
```json
61
-
{
62
-
"Values": {
63
-
"OpenApi__HideSwaggerUI": "false"
64
-
}
65
-
}
66
-
```
67
-
68
-
If you set the `OpenApi__HideSwaggerUI` value to `true`, the Swagger UI page won't be showing up, and you will see the 404 error.
69
-
70
-
> [!NOTE]
71
-
> The default value for `OpenApi__HideSwaggerUI` is `false`.
72
-
73
-
74
-
### Configure OpenAPI Information ###
75
-
76
-
As a default, the OpenAPI document automatically generated provides a minimum set of information like:
77
-
78
-
* OpenAPI Version: `2.0`
79
-
* OpenAPI Document Title: `OpenAPI Document on Azure Functions`
80
-
* OpenAPI Document Version: `1.0.0`
81
-
82
-
You may want to provide consumers with more details by implementing the `IOpenApiConfigurationOptions` interface or inheriting the `DefaultOpenApiConfigurationOptions` class. On the other hand, you can use the following environment variables to avoid the app from being recompiled and redeployed. Here's the sample `local.settings.json` file. The other values are omitted for brevity.
There's a chance that you want to expose the UI and OpenAPI document through [Azure API Management](https://docs.microsoft.com/azure/api-management/api-management-key-concepts?WT.mc_id=github-0000-juyoo) or load balancing services like [Azure Front Door](https://docs.microsoft.com/azure/frontdoor/front-door-overview?WT.mc_id=github-0000-juyoo). You can configure an environment variable to add them. Here's the sample `local.settings.json` file. The other values are omitted for brevity.
Copy file name to clipboardExpand all lines: docs/openapi-out-of-proc.md
+2-50Lines changed: 2 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -22,54 +22,6 @@ While using this library, if you find any issue, please raise a ticket on the [I
22
22
For detailed getting started document, find this [Enable OpenAPI Endpoints on Azure Functions (Preview) – Out-of-Process Model](enable-open-api-endpoints-out-of-proc.md) page.
23
23
24
24
25
-
## Configuration ##
25
+
## Advanced Configuration in General ##
26
26
27
-
For the extension's advanced configuration, it expects the following config keys.
28
-
29
-
30
-
### Configure Authorization Level ###
31
-
32
-
As a default, all endpoints to render Swagger UI and OpenAPI documents have the authorisation level of `AuthorizationLevel.Anonymous`.
33
-
34
-
> **NOTE**: Currently, this out-of-process worker extension only supports the `AuthorizationLevel.Anonymous` access.
35
-
36
-
37
-
### Configure Swagger UI Visibility ###
38
-
39
-
Unlike the in-process worker model, this out-of-process worker model currently doesn't support hiding Swagger UI.
40
-
41
-
42
-
### Configure OpenAPI Information ###
43
-
44
-
As a default, the OpenAPI document automatically generated provides a minimum set of information like:
45
-
46
-
* OpenAPI Version: `2.0`
47
-
* OpenAPI Document Title: `OpenAPI Document on Azure Functions`
48
-
* OpenAPI Document Version: `1.0.0`
49
-
50
-
You may want to provide consumers with more details by implementing the `IOpenApiConfigurationOptions` interface or inheriting the `DefaultOpenApiConfigurationOptions` class. On the other hand, you can use the following environment variables to avoid the app from being recompiled and redeployed. Here's the sample `local.settings.json` file. The other values are omitted for brevity.
There's a chance that you want to expose the UI and OpenAPI document through [Azure API Management](https://docs.microsoft.com/azure/api-management/api-management-key-concepts?WT.mc_id=github-0000-juyoo) or load balancing services like [Azure Front Door](https://docs.microsoft.com/azure/frontdoor/front-door-overview?WT.mc_id=github-0000-juyoo). You can configure an environment variable to add them. Here's the sample `local.settings.json` file. The other values are omitted for brevity.
0 commit comments