I am trying to roll out an Azure Function with bicep. Everything up to ‘Microsoft.Web/sites’ and everything around it (Blob and such) works and I can use VS Code to deploy my python code to that function afterwards.
When I try to deploy my code using Bicep aswell, I get the following error:
{
"status": "Failed",
"error": {
"code": "BadRequest",
"message": ""
}
}
What did I do wrong? I am using a Flex consumption plan and my bicep code for ‘Microsoft.Web/sites/functions’ is below.
resource function 'Microsoft.Web/sites/functions@2020-12-01' = {
parent: functionApp
name: functionNameComputed
properties: {
config: {
scriptFile: 'function_app.py' // tried with and without this option
entryPoint: 'function_app' // tried with and without this option
disabled: false
bindings: [
{
name: 'req'
type: 'httpTrigger'
direction: 'in'
authLevel: 'function'
methods: [
'get'
]
}
{
name: '$return'
type: 'http'
direction: 'out'
}
]
}
files: {
'function_app.py': loadTextContent('function_app.py')
'requirements.txt': loadTextContent('requirements.txt')
}
}
}