Open fuellbie opened 1 year ago
Thanks @fuellbie for raising this issue, the error message was thrown by the api, not by terraform provider. In order to narrow down the issue, can you help to try using rest api/ azure portal to create the function to see if the function can be created successfully?
I'm getting the same error using Terraform and the function is getting created correctly using the func
cli.
Just stumbled upon this very same error with the function not being created. It seem that State: "Running"
is not a vital part of the information, as stopping the Function App and retrying gives State: "Stopped"
. So that's just the current state of the Function App.
What seems suspicious to me is that InProgressOperationID: <nil>
I am also in similar state , i am getting the same error while publishing the code with more than few files/using the Zip deployment..
Hello All,
Is there any update on the error above. I am creating a function_app_function with event hub trigger but landing up on the same error.
Hey all, I hit this issue today, but was able to resolve it by setting the app setting WEBSITE_RUN_FROM_PACKAGE
to 0
.
I do believe a better error message is needed for this though.
Hello, Anyone got a solution to that problem? I do need to use this: WEBSITE_RUN_FROM_PACKAGE to use a zip file in my function which includes requirements and the .py itself.
I completely scrapped the azurerm_function_app_function resource block and made use of azurerm_function_app to deploy the code as well . There 2 options you can choose from
to troubleshoot do a ssh to the node and see the /var/log for errors..
This happens to me when I try to upload python file using the
azurerm_linux_function_app
. It works fine without the file block. In comparison, I use the same setup but withazurerm_windows_function_app
and a powershell script, and Terraform creates the resources and uploads the code just fine. So... maybe something up with theazurerm_linux_function_app
?
What im trying to do basiclly is to create a function app inside it a function that i can develop in portal (Its just a small script) and i need the 'requests' package from python. Now Iv'e even tried creating a requirements.txt manually in the wwwroot folder and enabled PYTHON_ENABLE_WORKER_EXTENSIONS=1 and I still get the error No module named requests. There is microsoft documentation of how to do it with VScode but since i need it to be in terrafrom that doesn't help at all. Any ideas about that?
FWIW this works for me:
...
resource "azurerm_service_plan" "example" {
name = "example"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
os_type = "Linux"
sku_name = "Y1"
}
resource "azurerm_linux_function_app" "example" {
lifecycle {
ignore_changes = [
name
]
}
name = "xxxxxxxxxxxx"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
storage_account_name = azurerm_storage_account.example.name
storage_account_access_key = azurerm_storage_account.example.primary_access_key
service_plan_id = azurerm_service_plan.example.id
site_config {
application_stack {
python_version = "3.9"
}
}
identity {
type = "SystemAssigned"
}
app_settings = {
AzureWebJobsDisableHomepage = true
SCM_DO_BUILD_DURING_DEPLOYMENT = true
ENABLE_ORYX_BUILD = true
FUNCTIONS_WORKER_RUNTIME = "python"
}
}
resource "azurerm_function_app_function" "example" {
name = "myfunc"
function_app_id = azurerm_linux_function_app.example.id
language = "Python"
file {
name = "mycode.py"
content = file("mycode.py")
}
config_json = jsonencode({
"bindings" = [
{
"authLevel" = "anonymous"
"direction" = "in"
"methods" = [
"get",
"post",
]
"name" = "req"
"type" = "httpTrigger"
},
{
"direction" = "out"
"name" = "$return"
"type" = "http"
},
]
})
}
Hi all,
I had the same issue and, simply, couldn't work out a way around it. So I had to come up with a way to do this from scratch using bash and terraform respectively. This solution is open source. I hope it helps.
https://github.com/BeAllAround/azure-function-app
Only requirements would be https://github.com/BeAllAround/azure-function-app?tab=readme-ov-file#requirements
Cheers!
Is there an existing issue for this?
Community Note
Terraform Version
1.3.6
AzureRM Provider Version
3.36.0
Affected Resource(s)/Data Source(s)
azurerm_function_app_function
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The Function App Function should be deployed successfully without an Error. If something is wrong with the terraform code or the Azure environment, I expect a helpful error message.
Actual Behaviour
Error message just says
State: "Running"
, which is not a helpful information to debug the problem.Steps to Reproduce
No response
Important Factoids
No response
References
No response