@Václav Parma Thanks for posting your question in Microsoft Q&A, apologize for any inconvenience caused on this.
Ideally, when you perform Zip deploy all the project files will be deployed under wwwroot
folder as .zip file and function app will load the functions from that .zip file which is not same in case of Flex consumption plan.
In flex consumption plan, deployments follow a specific process. First, your project code is built and compressed into an application package, which is then deployed to a blob storage container. When your app starts up, it retrieves the package and runs your function code from it.
To deploy your functions code to flex consumption function app using bicep I would suggest you add a deployment script
in your bicep file to upload your function code to storage account.
Also, deployment scripts can run over the private endpoints and virtual networks.
Refer to the below documentation for more information about deployment scripts.
- Deployment scripts.
- Access private virtual networks.
- Run deployment script privately over a private endpoint.
Update from Azure Functions Engineering Team:
For Flex consumption, we do not support “zipdeploy”. Instead, we support “OneDeploy”, which can be used as below:
resource functionZipDeploy 'Microsoft.Web/sites/extensions@2022-09-01' = {
name: '${functionAppName}/OneDeploy'
properties: {
packageUri: '${packageUri}'
remoteBuild: true
}
}
This will build the package if you pass property “remoteBuild: true” and you can skip build if you pass property “remoteBuild: false”.
The result of this is same as what you experienced with zipdeploy as a .zip package is added to the wwwroot.
NOTE: We strictly recommend NOT to “upload their function zip to storage account” manually.
Hope this helps let me know if you have any further questions on this.
Please accept as Yes if the answer is helpful so that it can help others in the community.