Deploying Azure Function with Bicep: Python HTTP Trigger

Sarva, Pavan 20 Reputation points
2023-11-02T12:37:08.4966667+00:00

Could you please provide instructions for deploying an Azure function (http trigger, python) using bicep scripts? Is it necessary to deploy source code as part of this step? There is no problem with building an Azure Function App using bicep but for creating function (http trigger, python run time) there it appears that some specific procedures are necessary further to creating function resource as described in following link.

https://learn.microsoft.com/en-us/azure/templates/microsoft.web/sites/functions?pivots=deployment-language-bicep


The error message is as follows:

{"status":"Failed","error":{"code":"DeploymentFailed","target": ..... "Message": "Encountered an error (InternalServerError) from host runtime."\r\n },\r\n {\r\n "Code": "BadRequest"\r\n },\r\n {\r\n "ErrorEntity": {\r\n "Code": "BadRequest",\r\n "Message": "Encountered an error (InternalServerError) from host runtime."\r\n }\r\n }\r\n ],\r\n "Innererror": null\r\n}"}]}}

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
3,723 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 14,216 Reputation points Microsoft Employee
    2023-11-03T10:28:02.1866667+00:00

    @Sarva, Pavan Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    Yes, HTTP trigger function source code need to be a part of your bicep scripts and your need to pass the function source code using the files` property under `Microsoft.Web/sites/functions@2022-09-01 resource block.

    You can refer to this GitHub sample in which we are deploying dotnet function app with Http trigger and storing the function app keys in the key vault.

    Feel free to reach back to me if you have any further questions on this.

    0 comments No comments