Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples of deploying a Python Function App #5397

Closed
a8ree opened this issue Jan 14, 2020 · 8 comments
Closed

Add examples of deploying a Python Function App #5397

a8ree opened this issue Jan 14, 2020 · 8 comments

Comments

@a8ree
Copy link

a8ree commented Jan 14, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.12.18
AzureRM v1.40.0

Affected Resource(s)

azurerm_app_service_plan
azurerm_function_app

Terraform Configuration Files

Here is the module invocation



module "function_app" {

source = "./modules/functionapp_v1"

name = "a8reeenginetest"

resource_group_name = module.air_resourcegroup.name

app_service_plan_id = azurerm_app_service_plan.serviceplan.id

location = var.location

environment = var.environment

function_version = "~2"

#release = "release 2019-12-10:001"

primary_connection_string = azurerm_storage_account.functionsta.primary_connection_string



app_settings = {

FUNCTIONS_WORKER_RUNTIME = "python"

APPINSIGHTS_INSTRUMENTATIONKEY = module.air_appinsights.instrumentation_key

WEBSITE_NODE_DEFAULT_VERSION = "10.14.1"

}

}



and the function app





#version = 1.0 # Release Date: 26-11-2019

resource "azurerm_function_app" "main" {

name = var.name

location = var.location

resource_group_name = var.resource_group_name

app_service_plan_id = var.app_service_plan_id

storage_connection_string = var.primary_connection_string

https_only = true

version = var.function_version

client_affinity_enabled = false



tags = "${merge(var.tags, map("environment", var.environment), map("release", var.release))}"







site_config {

always_on = true

}



identity {

type = "SystemAssigned"

}



app_settings = var.app_settings



/*lifecycle {

ignore_changes = ["app_settings"]

}*/

}



It is deploying to the following app service plan



resource "azurerm_app_service_plan" "serviceplan" {

name = "a8reeenginetest"

location = var.location

resource_group_name = module.air_resourcegroup.name

kind = "Linux"

reserved = true

sku {

tier = "Dynamic"

size = "P1V2"

}

Expected Behavior

An operational Function App should be deployed

Actual Behavior

The Function App is not correctly deployed.

When my code is deployed, there is an error when going into the Function App settings in the portal

Error:

Error retrieving master key. <title>404 Not Found</title>

Not Found

The requested URL was not found on this server.

Session Id: 586f62f9be7a48ec86143daa57bf01af

Timestamp: 2020-01-13T14:12:45.060Z

Steps to Reproduce

  1. terraform apply
  2. Open Azure Portal and try to access the resource 'Function App settings'
  3. Error is displayed

References

Link to Reddit discussion where other user states the same issue:
https://www.reddit.com/r/Terraform/comments/eo4xz4/cant_create_a_function_app_without_error/

  • #0000
@umsheikh83
Copy link

umsheikh83 commented Jan 23, 2020

Experiencing the same issue. @a8ree did you find the root cause by any chance or a workaround?

@a8ree
Copy link
Author

a8ree commented Jan 24, 2020

@umsheikh83 no, I've got a case open with Hashicorp which has been passed to engineering. It seems to be an issue with linux plans. Setting to 'elastic' or 'windows' will work but there is some sort of issue when deploying on linux - which doesn't happen when you using the Azure Portal to deploy

@katbyte
Copy link
Collaborator

katbyte commented Jun 1, 2020

@a8ree - we have fixed a bug wth libnux deployments in #7140 and updated the docs in #7146 - could you take a look and see if your still experiancing this issue?

@pc-tradelab
Copy link

Hello any update on that issue ? I still have a problem depoying a very simple python function app. #7146 is useful , however a working example with python code would be great ( in particular the example folder of this repo does not containe any example of how to deploy an app function) .

@ghost ghost removed the waiting-response label Jun 12, 2020
@tombuildsstuff tombuildsstuff changed the title Unable to deploy a working Azure Function App Add examples of deploying a Python Function App Aug 28, 2020
@borkod
Copy link
Contributor

borkod commented Oct 2, 2020

Hello. I've created an example used to demonstrate how to provision a python functions app. It includes sample python code. I was able to deploy it using VS code. README file has links to references on how to deploy code to function app using a number of methods. Hope this helps! Code is part of PR: #8724

@jbinko
Copy link
Contributor

jbinko commented Jan 25, 2021

Not entirely sure - Can this be closed? as PR: #8724 seems to be merged into master. https://github.com/terraform-providers/terraform-provider-azurerm/tree/master/examples/app-service/function-python/SampleApp

@favoretti
Copy link
Collaborator

Since this issue seems to have been addressed in the latest versions of the provider (or a valid workaround was provided) - I'm going to close it. Please open a new updated bug report if this is still relevant. Thank you.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants