Skip to content

Commit 870c2e2

Browse files
authored
Merge pull request #189291 from anthonychu/20220221-add-apiruntime
[Static Web Apps] Add API runtime selection
2 parents fb887c0 + 6586a64 commit 870c2e2

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

articles/static-web-apps/apis.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: static-web-apps
55
author: craigshoemaker
66
ms.service: static-web-apps
77
ms.topic: conceptual
8-
ms.date: 11/08/2021
8+
ms.date: 02/22/2022
99
ms.author: cshoe
1010
---
1111

@@ -28,7 +28,7 @@ The following table contrasts the differences between using managed and existing
2828
| Feature | Managed Functions | Bring your own Functions |
2929
| --- | --- | --- |
3030
| Access to Azure Functions [triggers](../azure-functions/functions-triggers-bindings.md#supported-bindings) | Http only | All |
31-
| Supported Azure Functions [runtimes](../azure-functions/supported-languages.md#languages-by-runtime-version) | Node.js 12<br>.NET Core 3.1<br>.NET 6.0<br>Python 3.8 | All |
31+
| Supported Azure Functions [runtimes](../azure-functions/supported-languages.md#languages-by-runtime-version)<sup>1</sup> | Node.js 12<br>Node.js 14<br>Node.js 16 (preview)<br>.NET Core 3.1<br>.NET 6.0<br>Python 3.8<br>Python 3.9 | All |
3232
| Supported Azure Functions [hosting plans](../azure-functions/functions-scale.md) | Consumption | Consumption<br>Premium<br>Dedicated |
3333
| [Integrated security](user-information.md) with direct access to user authentication and role-based authorization data |||
3434
| [Routing integration](./configuration.md?#routes) that makes the _api_ route available to the web app securely without requiring custom CORS rules. |||
@@ -38,6 +38,8 @@ The following table contrasts the differences between using managed and existing
3838
| API functions available outside Azure Static Web Apps |||
3939
| [Key Vault references](../app-service/app-service-key-vault-references.md) |||
4040

41+
<sup>1</sup> To specify the runtime version in managed functions, add a configuration file to your frontend app and set the [`apiRuntime` property](configuration.md#platform). Support is subject to the [Azure Functions language runtime support policy](../azure-functions/language-support-policy.md).
42+
4143
## Configuration
4244

4345
API endpoints are available to the web app through the _api_ route.
@@ -61,7 +63,7 @@ Logs are only available if you add [Application Insights](monitor.md).
6163

6264
| Managed functions | Bring your own functions |
6365
| --- | --- |
64-
| <ul><li>Triggers are limited to [HTTP](../azure-functions/functions-bindings-http-webhook.md).</li><li>The Azure Functions app must either be in Node.js 12, .NET Core 3.1, .NET 6.0, or Python 3.8.</li><li>Some application settings are managed by the service, therefore the following prefixes are reserved by the runtime:<ul><li>*APPSETTING\_, AZUREBLOBSTORAGE\_, AZUREFILESSTORAGE\_, AZURE_FUNCTION\_, CONTAINER\_, DIAGNOSTICS\_, DOCKER\_, FUNCTIONS\_, IDENTITY\_, MACHINEKEY\_, MAINSITE\_, MSDEPLOY\_, SCMSITE\_, SCM\_, WEBSITES\_, WEBSITE\_, WEBSOCKET\_, AzureWeb*</li></ul></li></ul> | <ul><li>You are responsible to manage the Functions app deployment.</li></ul> |
66+
| <ul><li>Triggers are limited to [HTTP](../azure-functions/functions-bindings-http-webhook.md).</li><li>The Azure Functions app must either be in Node.js 12, Node.js 14, Node.js 16 (preview), .NET Core 3.1, .NET 6.0, Python 3.8, or Python 3.9.</li><li>Some application settings are managed by the service, therefore the following prefixes are reserved by the runtime:<ul><li>*APPSETTING\_, AZUREBLOBSTORAGE\_, AZUREFILESSTORAGE\_, AZURE_FUNCTION\_, CONTAINER\_, DIAGNOSTICS\_, DOCKER\_, FUNCTIONS\_, IDENTITY\_, MACHINEKEY\_, MAINSITE\_, MSDEPLOY\_, SCMSITE\_, SCM\_, WEBSITES\_, WEBSITE\_, WEBSOCKET\_, AzureWeb*</li></ul></li></ul> | <ul><li>You are responsible to manage the Functions app deployment.</li></ul> |
6567

6668
## Next steps
6769

articles/static-web-apps/configuration.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,35 @@ The following example configuration demonstrates how to override an error code.
312312
}
313313
```
314314

315+
## Platform
316+
317+
The `platform` section controls platform specific settings, such as the API language runtime version.
318+
319+
### Selecting the API language runtime version
320+
321+
To configure the API language runtime version, set the `apiRuntime` property in the `platform` section to one of the following supported values.
322+
323+
| Language runtime version | Operating system | Azure Functions version | `apiRuntime` value |
324+
|--|--|--|--|
325+
| .NET Core 3.1 | Windows | 3.x | `dotnet:3.1` |
326+
| .NET 6.0 in-process | Windows | 4.x | `dotnet:6.0` |
327+
| .NET 6.0 isolated | Windows | 4.x | `dotnet-isolated:6.0` |
328+
| Node.js 12.x | Linux | 3.x | `node:12` |
329+
| Node.js 14.x | Linux | 4.x | `node:14` |
330+
| Node.js 16.x (preview) | Linux | 4.x | `node:16` |
331+
| Python 3.8 | Linux | 3.x | `python:3.8` |
332+
| Python 3.9 | Linux | 4.x | `python:3.9` |
333+
334+
The following example configuration demonstrates how to use the `apiRuntime` property to select Node.js 16 as the API language runtime version.
335+
336+
```json
337+
{
338+
"platform": {
339+
"apiRuntime": "node:16"
340+
}
341+
}
342+
```
343+
315344
## Networking
316345

317346
The `networking` section controls the network configuration of your static web app. To restrict access to your app, specify a list of allowed IP address blocks in `allowedIpRanges`.
@@ -350,7 +379,7 @@ In addition to IP address blocks, you can also specify [service tags](../virtual
350379

351380
For details on how to restrict routes to authenticated users, see [Securing routes with roles](#securing-routes-with-roles).
352381

353-
### Disable cache for authenticated paths
382+
### Disabling cache for authenticated paths
354383

355384
If you set up [manual integration with Azure Front Door](front-door-manual.md), you may want to disable caching for your secured routes. If you have enabled [enterprise-grade edge](enterprise-edge.md) this is already configured for you.
356385

0 commit comments

Comments
 (0)