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: articles/azure-functions/functions-infrastructure-as-code.md
+99-22Lines changed: 99 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -436,7 +436,7 @@ For more information about the `sku` object, see [`SkuDefinition`](/azure/templa
436
436
::: zone pivot="dedicated-plan"
437
437
In the Dedicated (App Service) plan, your function app runs on dedicated VMs on Basic, Standard, and Premium SKUs in App Service plans, similar to web apps. For more information, see [Dedicated plan](./dedicated-plan.md).
438
438
439
-
For a sample Bicep file/Azure Resource Manager template, see [Function app on Azure App Service plan]
439
+
For a sample Bicep file/Azure Resource Manager template, see [Function app on Azure App Service plan].
440
440
441
441
In Functions, the Dedicated plan is just a regular App Service plan, which is defined by a `serverfarm` resource. You must provide at least the `name` value. For a list of supported plan names, see the `--sku` setting in [`az appservice plan create`](/cli/azure/appservice/plan#az-appservice-plan-create) for the current list of supported values for a Dedicated plan.
442
442
@@ -1208,7 +1208,14 @@ Your Bicep file or ARM template can optionally also define a deployment for your
In the Flex Consumption plan, your project code is deployed from a zip-compressed package published to a Blob storage container. For more information, see [Deployment](flex-consumption-plan.md#deployment). The specific storage account and container used for deployments, the authentication method, and credentials are set in the `functionAppConfig.deployment.storage` element of the `properties` for the site. The container and any application settings must exist when the app is created. For an example of how to create the storage container, see [Deployment container](#deployment-container).
1211
+
In the Flex Consumption plan, your project code is deployed from a zip-compressed package published to a Blob storage container. Deployment of your code to this container is done using _[one deploy](./functions-deployment-technologies.md#one-deploy)_. For more information, see [Deployment](flex-consumption-plan.md#deployment).
1212
+
1213
+
>[!IMPORTANT]
1214
+
>Don't upload your compressed deployment package directly in the deployment container. When you do this, your updated package won't get automatically deployed. You must instead define a package source that gets sent to the deployment container using one deploy.
1215
+
1216
+
### Deployment container
1217
+
1218
+
The specific storage account and container used for deployments, the authentication method, and credentials are set in the `functionAppConfig.deployment.storage` element of the `properties` for the site. The container and any application settings must exist when the app is created. For an example of how to create the storage container, see [Deployment container](#deployment-container).
1212
1219
1213
1220
This example uses a system assigned managed identity to access the specified blob storage container, which is created elsewhere in the deployment:
1214
1221
@@ -1239,25 +1246,34 @@ For a complete reference example, see [this ARM template](https://github.com/Azu
1239
1246
---
1240
1247
1241
1248
When using a connection string instead of managed identities, you need to instead set the `authentication.type` to `StorageAccountConnectionString` and set `authentication.storageAccountConnectionStringName` to the name of the application setting that contains the deployment storage account connection string.
1242
-
::: zone-end
1243
-
::: zone pivot="consumption-plan"
1244
-
Your Bicep file or ARM template can optionally also define a deployment for your function code using a [zip deployment package](./deployment-zip-push.md).
1245
-
::: zone-end
1246
-
::: zone pivot="dedicated-plan,premium-plan,consumption-plan"
1247
-
To successfully deploy your application by using Azure Resource Manager, it's important to understand how resources are deployed in Azure. In most examples, top-level configurations are applied by using `siteConfig`. It's important to set these configurations at a top level, because they convey information to the Functions runtime and deployment engine. Top-level information is required before the child `sourcecontrols/web` resource is applied. Although it's possible to configure these settings in the child-level `config/appSettings` resource, in some cases your function app must be deployed _before_`config/appSettings` is applied.
1248
1249
1249
-
##Zip deployment package
1250
+
### Deployment package
1250
1251
1251
-
Zip deployment is a recommended way to deploy your function app code. By default, functions that use zip deployment run in the deployment package itself. For more information, including the requirements for a deployment package, see [Zip deployment for Azure Functions](deployment-zip-push.md). When using resource deployment automation, you can reference the .zip deployment package in your Bicep or ARM template.
1252
+
The Flex Consumption plan uses _one deploy_ for deploying your code project. The code package itself is the same as you would use for zip deployment in other Functions hosting plans. To include one deployment in your template, use the `/onedeploy` resource definition for the remote URL that contains the deployment package. The Functions host must be able to access both this remote package source and the deployment container.
1252
1253
1253
-
To use zip deployment in your template, set the `WEBSITE_RUN_FROM_PACKAGE` setting in the app to `1` and include the `/zipDeploy` resource definition.
1254
-
::: zone-end
1255
-
::: zone pivot="consumption-plan"
1256
-
For a Consumption plan on Linux, instead set the URI of the deployment package directly in the `WEBSITE_RUN_FROM_PACKAGE` setting, as shown in [this example template](https://github.com/Azure-Samples/function-app-arm-templates/tree/main/function-app-linux-consumption#L152).
1257
-
::: zone-end
1258
-
::: zone pivot="dedicated-plan,premium-plan,consumption-plan"
1259
-
This example adds a zip deployment source to an existing app:
1254
+
This example adds a one deploy source to an existing app:
1255
+
1256
+
### [Bicep](#tab/bicep)
1257
+
1258
+
```bicep
1259
+
@description('The name of the function app.')
1260
+
param functionAppName string
1260
1261
1262
+
@description('The location into which the resources should be deployed.')
@@ -1298,6 +1314,27 @@ This example adds a zip deployment source to an existing app:
1298
1314
]
1299
1315
}
1300
1316
```
1317
+
---
1318
+
1319
+
::: zone-end
1320
+
::: zone pivot="consumption-plan"
1321
+
Your Bicep file or ARM template can optionally also define a deployment for your function code using a [zip deployment package](./deployment-zip-push.md).
1322
+
::: zone-end
1323
+
::: zone pivot="dedicated-plan,premium-plan,consumption-plan"
1324
+
To successfully deploy your application by using Azure Resource Manager, it's important to understand how resources are deployed in Azure. In most examples, top-level configurations are applied by using `siteConfig`. It's important to set these configurations at a top level, because they convey information to the Functions runtime and deployment engine. Top-level information is required before the child `sourcecontrols/web` resource is applied. Although it's possible to configure these settings in the child-level `config/appSettings` resource, in some cases your function app must be deployed _before_`config/appSettings` is applied.
1325
+
1326
+
## Zip deployment package
1327
+
1328
+
Zip deployment is a recommended way to deploy your function app code. By default, functions that use zip deployment run in the deployment package itself. For more information, including the requirements for a deployment package, see [Zip deployment for Azure Functions](deployment-zip-push.md). When using resource deployment automation, you can reference the .zip deployment package in your Bicep or ARM template.
1329
+
1330
+
To use zip deployment in your template, set the `WEBSITE_RUN_FROM_PACKAGE` setting in the app to `1` and include the `/zipDeploy` resource definition.
1331
+
::: zone-end
1332
+
::: zone pivot="consumption-plan"
1333
+
For a Consumption plan on Linux, instead set the URI of the deployment package directly in the `WEBSITE_RUN_FROM_PACKAGE` setting, as shown in [this example template](https://github.com/Azure-Samples/function-app-arm-templates/tree/main/function-app-linux-consumption#L152).
1334
+
::: zone-end
1335
+
::: zone pivot="dedicated-plan,premium-plan,consumption-plan"
1336
+
This example adds a zip deployment source to an existing app:
Keep the following things in mind when including zip deployment resources in your template:
@@ -1838,7 +1915,7 @@ These application settings are required for container deployments:
1838
1915
1839
1916
Keep these considerations in mind when working with site and application settings using Bicep files or ARM templates:
1840
1917
::: zone pivot="flex-consumption-plan"
1841
-
+ The optional `alwaysReady` setting contains an array of one or more `{name,instanceCount}` objects, with one for each [per-function scale group](flex-consumption-plan.md#per-function-scaling). These are the scale groups being used to make always-ready scale decisions. This example sets always-ready counts for both the `http` group and a single function named `helloworld`, which is of a non-grouped trigger type:
1918
+
+ The optional `alwaysReady` setting contains an array of one or more `{name,instanceCount}` objects, with one for each [per-function scale group](flex-consumption-plan.md#per-function-scaling). These are the scale groups being used to make always-ready scale decisions. This example sets always-ready counts for both the `http` group and a single function named `helloworld`, which is of a nongrouped trigger type:
1842
1919
### [Bicep](#tab/bicep)
1843
1920
```bicep
1844
1921
alwaysReady: [
@@ -2068,7 +2145,7 @@ Here's an example that uses HTML:
2068
2145
2069
2146
### Deploy using PowerShell
2070
2147
2071
-
The following PowerShell commands create a resource group and deploy a Bicep file or ARM template that creates a function app with its required resources. To run locally, you must have [Azure PowerShell](/powershell/azure/install-azure-powershell) installed. Run [`Connect-AzAccount`](/powershell/module/az.accounts/connect-azaccount) to sign in.
2148
+
The following PowerShell commands create a resource group and deploy a Bicep file or ARM template that creates a function app with its required resources. To run locally, you must have [Azure PowerShell](/powershell/azure/install-azure-powershell) installed. To sign in to Azure, you must first run [`Connect-AzAccount`](/powershell/module/az.accounts/connect-azaccount).
0 commit comments