Skip to content

Commit b989334

Browse files
updating zip structure reference
1 parent c973d46 commit b989334

File tree

5 files changed

+48
-26
lines changed

5 files changed

+48
-26
lines changed

articles/azure-functions/deployment-zip-push.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,14 @@ To speed up development, you might find it easier to deploy your function app pr
2424

2525
For more information, see the [.zip deployment reference](https://github.com/projectkudu/kudu/wiki/Deploying-from-a-zip-file).
2626

27-
## Deployment .zip file requirements
28-
29-
The .zip file that you use for push deployment must contain all of the files needed to run your function.
30-
3127
>[!IMPORTANT]
3228
> When you use .zip deployment, any files from an existing deployment that aren't found in the .zip file are deleted from your function app.
3329
34-
[!INCLUDE [functions-folder-structure](../../includes/functions-folder-structure.md)]
30+
## Deployment .zip file requirements
3531

36-
A function app includes all of the files and folders in the `wwwroot` directory. A .zip file deployment includes the contents of the `wwwroot` directory, but not the directory itself. When deploying a C# class library project, you must include the compiled library files and dependencies in a `bin` subfolder in your .zip package.
32+
[!INCLUDE [functions-deployment-zip-structure](../../includes/functions-deployment-zip-structure.md)]
3733

38-
When you are developing on a local computer, you can manually create a .zip file of the function app project folder using built-in .zip compression functionality or third-party tools.
34+
A zip deployment process extracts the zip archive's files and folders in the `wwwroot` directory. If you include the parent directory when creating the archive, the system will not find the files it expects to see in `wwwroot`.
3935

4036
## <a name="cli"></a>Deploy by using Azure CLI
4137

articles/azure-functions/dotnet-isolated-process-guide.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ You can create your function app and other required resources in Azure using one
692692
+ [Deployment templates](./functions-infrastructure-as-code.md): You can use ARM templates and Bicep files to automate the deployment of the required resources to Azure. Make sure your template includes any [required settings](#deployment-requirements).
693693
+ [Azure portal](./functions-create-function-app-portal.md): You can create the required resources in the [Azure portal](https://portal.azure.com).
694694

695-
### Publish code project
695+
### Publish your application
696696

697697
After creating your function app and other required resources in Azure, you can deploy the code project to Azure using one of these methods:
698698

@@ -704,6 +704,24 @@ After creating your function app and other required resources in Azure, you can
704704

705705
For more information, see [Deployment technologies in Azure Functions](functions-deployment-technologies.md).
706706

707+
#### Deployment payload
708+
709+
Many of the deployment methods make use of a zip archive. If you are creating the zip archive yourself, it must follow the structure outlined in this section. If it does not, your app may experience errors at startup.
710+
711+
The deployment payload should match the output of a `dotnet publish` command, though without the enclosing parent folder. The zip archive should be made from the following files:
712+
713+
- `.azurefunctions/`
714+
- `extensions.json`
715+
- `functions.metadata`
716+
- `host.json`
717+
- `worker.config.json`
718+
- Your project executable (a console app)
719+
- Other supporting files and directories peer to that executable
720+
721+
These files are generated by the build process, and they are not meant to be edited directly.
722+
723+
When preparing a zip archive for deployment, you should only compress the contents of the output directory, not the enclosing directory itself. When the archive is extracted into the current working directory, the files listed above need to be be immediately visible.
724+
707725
### Deployment requirements
708726

709727
There are a few requirements for running .NET functions in the isolated worker model in Azure, depending on the operating system:

articles/azure-functions/run-functions-from-deployment-package.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ The following table indicates the recommended `WEBSITE_RUN_FROM_PACKAGE` values
6060

6161
[!INCLUDE [Function app settings](../../includes/functions-app-settings.md)]
6262

63+
### Creating the zip archive
64+
65+
[!INCLUDE [functions-deployment-zip-structure](../../includes/functions-deployment-zip-structure.md)]
66+
6367
## Use WEBSITE_RUN_FROM_PACKAGE = 1
6468

6569
This section provides information about how to run your function app from a local package file.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
author: ggailey777
3+
ms.service: azure-functions
4+
ms.topic: include
5+
ms.date: 07/16/2024
6+
ms.author: glenga
7+
---
8+
9+
The zip archive you deploy must contain all of the files needed to run your function app. You can manually create a zip archive from the contents of a Functions project folder using built-in .zip compression functionality or third-party tools.
10+
11+
The archive must include the [host.json](../articles/azure-functions/functions-host-json.md) file at the root of the extracted folder. The selected language stack for the function app creates additional requirements:
12+
13+
* [.NET (isolated worker model)](../articles/azure-functions/dotnet-isolated-process-guide.md#deployment-payload)
14+
* [.NET (in-process model)](../articles/azure-functions/functions-dotnet-class-library.md#functions-class-library-project)
15+
* [Java](../articles/azure-functions/functions-reference-java.md#folder-structure)
16+
* [JavaScript](../articles/azure-functions/functions-reference-node.md?tabs=javascript#folder-structure)
17+
* [TypeScript](../articles/azure-functions/functions-reference-node.md?tabs=typescript#folder-structure)
18+
* [PowerShell](../articles/azure-functions/functions-reference-powershell.md#folder-structure)
19+
* [Python](../articles/azure-functions/functions-reference-python.md#folder-structure)
20+
21+
> [!IMPORTANT]
22+
> Make sure to compress the contents of any output folder, rather than the parent folder itself. When Azure Functions extracts the contents of the zip archive, it needs to immediately see the `host.json` file.

includes/functions-folder-structure.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)