Creating a Function App on Linux, using the Portal, Results in a non-functional App Service
See original GitHub issueCreating 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…
- If I create a Function App on Linux via the CLI I end up with a working app
- 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
- Create an App Service Plan
az appservice plan create --name xyzazfuncdocker8 --resource-group xyzazfuncdocker --sku S1 --is-linux
- 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
- Test the API using curl
curl -i https://xyzazfuncdocker8.azurewebsites.net/api/http-trigger\?name\=Martin
- 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
- Create new Function App using the Portal
-
Provide all of the information required to create the Function App, illustrated here with instructions
-
Give it a name
-
Use the resource group we’ve previously created
-
Switch to Linux (Preview)
-
Click on Service Plan
-
Create a new Service Plan
-
Name the Service Plan, set the location, then click OK
-
Select the storage account we’ve previously created, and click “Create”
- 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.
- 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
- 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:
- Created 5 years ago
- Comments:11 (11 by maintainers)
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.
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.