question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Creating a Function App on Linux, using the Portal, Results in a non-functional App Service

See original GitHub issue

Creating a Function App on Linux, using the Portal, Results in a non-functional App Service

It is possible to create a Function App on Linux via the Azure CLI and by using the Portal.

However…

  1. If I create a Function App on Linux via the CLI I end up with a working app
  2. If I create a Function App on Linux via the Portal I end up with a non-functional app

Either there are some steps that need better documenting, or the Azure Portal needs to do a better job of setting these Function apps up.

Repro Steps

The following describes the steps followed to create a Function App on Linux using the CLI and using the Portal. Prior to performing these steps there are some common steps that need to be followed.

Common Steps

  • Using the functions CLI, create a new docker based function app (func init –docker)
  • Using the functions CLI, add a single JavaScript HTTP trigger endpoint, leaving the default “hello” code in place (func function new)
  • Tag and push the docker image to Docker Hub (the same issue is present if you use Azure Container Registry)
  • Create a resource group (mine is called xyzazfuncdocker)
  • Create a storage account within the resource group (mine is called xyzazfuncdocker)

My docker image can be found here: https://hub.docker.com/r/martinpeck/azfuncdocker/

Steps to Create a Function App for Linux using CLI

  1. Create an App Service Plan

az appservice plan create --name xyzazfuncdocker8 --resource-group xyzazfuncdocker --sku S1 --is-linux

  1. Create a Function App, using the App Service Plan

az functionapp create --name xyzazfuncdocker8 --storage-account xyzazfuncdocker --resource-group xyzazfuncdocker --plan xyzazfuncdocker8 --deployment-container-image-name martinpeck/azfuncdocker:v1.0.0

  1. Test the API using curl

curl -i https://xyzazfuncdocker8.azurewebsites.net/api/http-trigger\?name\=Martin

  1. Observe that the function app responds with an HTTP 200 and the test “Hello Martin”

Steps to Create a Function App for Linux using Portal

  1. Create new Function App using the Portal

image

  1. Provide all of the information required to create the Function App, illustrated here with instructions

  2. Give it a name

  3. Use the resource group we’ve previously created

  4. Switch to Linux (Preview)

  5. Click on Service Plan

  6. Create a new Service Plan

  7. Name the Service Plan, set the location, then click OK

  8. Select the storage account we’ve previously created, and click “Create”

image

  1. Once deployed, observe that the Portal shows the two Function Apps using different icons. The one created using the CLI has the Functions logo, while the portal one has a generic logo.

image

  1. Open the App Service Plan and configure it to use your container, making sure you select Docker Hub and provide the tag for your container. Additionally, turn on CD

image

  1. Test the API using curl and observe that an HTTP 404 is returned.
curl -i https://xyzazfuncdocker10.azurewebsites.net/api/http-trigger\?name\=Martin
HTTP/1.1 404 Not Found
Server: Kestrel
Date: Wed, 04 Apr 2018 15:40:49 GMT
Content-Length: 0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
martinpeckcommented, Apr 11, 2018

Set that app setting to false on your app that you created from portal, and reload the app. It should work.

I’ll give this a go and confirm whether it works after this change.

I wasn’t sure is this was purely a Functions portal issue, or something else, hence I ended up logging it here.

0reactions
ahmelsayedcommented, Jan 15, 2020

I think that was unrelated to this issue. The original issue reported here has been fixed for a while in the UX now. I’ll close this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure function HTTP triggered on linux container
On top of this, I needed to turn on: WEBSITES_ENABLE_APP_SERVICE_STORAGE: true in my azure app service configuration, and I needed to set the ......
Read more >
Azure function - Portal editing is disabled
I can't edit functions on a portal anymore. I just got a message "This function has been edited through an external editor.
Read more >
Creating Linux .NET 6 Azure Function Apps via the Azure CLI
In this blog I am going to a create a simple function app prototype that will be hosted on the Linux platform, built...
Read more >
Azure linux app service plan. If you deploy your app using Git, or
App Service Free account Quickly create powerful cloud apps for web and ... Login using an account from the Azure tenant containing the...
Read more >
Troubleshooting Python deployments on App Service Linux -
There are different ways to deploy a Python application to Azure App Service Linux. In this post we are covering the most common...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found