Skip to content

Commit 0173123

Browse files
authored
Merge pull request #281039 from mattchenderson/dotnet-zip
updating zip structure reference
2 parents 05fac04 + 034e5f7 commit 0173123

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
@@ -711,7 +711,7 @@ You can create your function app and other required resources in Azure using one
711711
+ [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).
712712
+ [Azure portal](./functions-create-function-app-portal.md): You can create the required resources in the [Azure portal](https://portal.azure.com).
713713

714-
### Publish code project
714+
### Publish your application
715715

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

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

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

726+
#### Deployment payload
727+
728+
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.
729+
730+
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:
731+
732+
- `.azurefunctions/`
733+
- `extensions.json`
734+
- `functions.metadata`
735+
- `host.json`
736+
- `worker.config.json`
737+
- Your project executable (a console app)
738+
- Other supporting files and directories peer to that executable
739+
740+
These files are generated by the build process, and they are not meant to be edited directly.
741+
742+
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 immediately visible.
743+
726744
### Deployment requirements
727745

728746
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)