dotnet / sdk-container-builds

Libraries and build tooling to create container images from .NET projects using MSBuild
https://learn.microsoft.com/en-us/dotnet/core/docker/publish-as-container
MIT License
179 stars 34 forks source link

Does it support Azure function apps at all? #411

Open findajay opened 1 year ago

findajay commented 1 year ago

Is it possible to containerize azure function apps using this sdk ?

baronfel commented 1 year ago

Hi @findajay - do you have a sample application we could try? I looked at some existing Azure Functions documentation here which suggests that isolated Azure Functions have to use a specific base image. If that's all that is required you could try pointing to that specific base image by using the ContainerBaseImage MSBuild property. In the meantime we can reach out to our partner teams about a more deep integration.

findajay commented 1 year ago

@baronfel Thanks for your response. I have tried using mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated6.0 this base image for .net6 isolated function app and it does not work for me. I will upload the code to my GitHub and share the link but I am not doing anything special, just created a new .net6 isolated function app using visual studio and tried building container image using sdk-container.

findajay commented 1 year ago

@baronfel Here is the sample app https://github.com/findajay/functionwithdocker/tree/master/functionwithdocker. In this app I am able to generate container image using dockerfile but not by using skd container dotnet publish.
Note : It does also work for web application in same repository https://github.com/findajay/functionwithdocker/tree/master/WebApplication1

findajay commented 1 year ago

@baronfel Can you prioritize this issue in June 30 milestone. We have been waiting a long for this? Thanks

baronfel commented 1 year ago

I did a sample of what integration with AzureFunctions might look like in this gist - this is something the Azure Functions team would be involved in maintaining, though.

findajay commented 1 year ago

@baronfel Thanks for taking time and focus on this. I hope azure functions team will take it up.

baronfel commented 1 year ago

I need to reach out to them to make their getting-started templates compatible with our tech anyway, so I expect this will come up :)

ggirard07 commented 1 year ago

How can I track the progress on this? Is it going to be part of this issue or in another one on the functions team side? Thanks!

findajay commented 1 year ago

I think changes has been done as part of this ticket https://github.com/dotnet/sdk-container-builds/issues/402. Not sure if they reached destination repository or not. @baronfel Could you please confirm this if possible ?

baronfel commented 1 year ago

No, #402 is about publish profile support for console applications, not Azure Functions support for this tech.

baronfel commented 5 months ago

If this would be useful for you, please check out the issue I created on the azure-functions-core-tools repo: https://github.com/Azure/azure-functions-core-tools/issues/3355