Azure-docs: Not available for Linux

Created on 18 Mar 2020  Â·  11Comments  Â·  Source: MicrosoftDocs/azure-docs

This is seems a huge gap, is this on the roadmap?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 azure-functionsvc cxp product-question triaged

All 11 comments

Hi @benc-uk Thanks for reaching out. We will review and update as appropriate.

Please use custom containers or App Service plan for linux

Hi, I'm trying that but it's very unclear what the base Docker image needs to be.

I've tried various mcr.microsoft.com/azure-functions images but none work. I don't think I need any runtime (I'm using a pre-built Golang Linux binary as my server). I've tried mcr.microsoft.com/azure-functions/base:2.0-alpine but I get an error "No function script files present"
I notice there's no v3.0 images available for the mcr.microsoft.com/azure-functions/base image. Only v2.0

Here's my really simple Dockerfile

FROM golang:1.13-alpine as go-build
WORKDIR /build

COPY go.mod .
COPY main.go .
RUN go build -o goserver

# =================================

FROM mcr.microsoft.com/azure-functions/base:2.0-alpine
WORKDIR /home/site/wwwroot

ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureFunctionsJobHost__Logging__Console__IsEnabled=true

COPY host.json .
COPY HttpFunction/ ./HttpFunction
COPY --from=go-build build/goserver .

I've built & deployed containers to Functions before
And the code works on locally (using Functions core tools v3.0.2358)

I only see language runtime images there. I don't need any language support, it's a custom handler

I tried using both the node:3.0 and dotnet:3.0 images but neither start my custom server, there's always some sort of error

local tools reports version 3.0.13159.0 where is the working Docker image that supports this?

I've solved it
The issue was with the Golang build stage in my Dockerfile, which was using Alpine as a base image, this results in a incompatible binary with any of the Functions images, and cryptic error messages such as "file not found"

I switched to golang:1.13-stretch and now it works

A working example in the docs (or the sample repo) would be very much appreciated

Here is a sample docker file using node base image:

# To enable ssh & remote debugging on app service change the base image to the one below
# FROM mcr.microsoft.com/azure-functions/node:2.0-appservice
FROM mcr.microsoft.com/azure-functions/node:2.0

ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureFunctionsJobHost__Logging__Console__IsEnabled=true

COPY . /home/site/wwwroot

RUN cd /home/site/wwwroot && \
    npm install

Copy any of the samples from: https://github.com/Azure-Samples/functions-custom-handlers to the dir with the dockerfile.

Will add this to sample repo as well.

@benc-uk So for now I will proceed with closure of this and If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

@pragnagopa I'm having the same issue where my custom image is working fine locally with the custom handler but when I deploy it to Azure, the host doesn't seem to be trying to start the my server & showing

40mwarn: Host.Startup[0]
2020-05-17T23:28:37.851123301Z       No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
2020-05-17T23:28:37.856314860Z info: Microsoft.Azure.WebJobs.Script.WebHost.WebScriptHostHttpRoutesManager[0]

I've tried mcr.microsoft.com/azure-functions/node:3.0-node12-slim & mcr.microsoft.com/azure-functions/node:2.0, same result, working locally but not on Azure.

This issue is now closed. Please open a seperate issue with repro steps.

Was this page helpful?
0 / 5 - 0 ratings