Coder Social home page Coder Social logo

demo.funky.containers's Introduction

Azure functions in containers

CancelHotelReservation Function

SendEmail function

Generate report function

References

  • Problem when building the Docker image for Azure functions V4 with .NET 6

https://giters.com/Azure/azure-functions-dotnet-worker/issues/718 Azure/azure-functions-dotnet-worker#718

If you just create the function app using func init commands and so forth, at the time of the docker image build you'll face some issues.

Best way I found to resolve this was to create the solution using Rider and in it's command window to execute the command func init --docker-only. This will create the correct docker file for you.

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS installer-env

# Build requires 3.1 SDK
COPY --from=mcr.microsoft.com/dotnet/core/sdk:3.1 /usr/share/dotnet /usr/share/dotnet

COPY . /src/dotnet-function-app
RUN cd /src/dotnet-function-app && \
    mkdir -p /home/site/wwwroot && \
    dotnet publish *.csproj --output /home/site/wwwroot

# To enable ssh & remote debugging on app service change the base image to the one below
# FROM mcr.microsoft.com/azure-functions/dotnet:4-appservice
FROM mcr.microsoft.com/azure-functions/dotnet:4
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureFunctionsJobHost__Logging__Console__IsEnabled=true

COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"]
  • Installing the last Azure Functions Core Tools

    • Uninstall what you have currently. I used chocolatey

choco uninstall azure-functions-core-tools

  • The install the latest using this link
  • Building docker images without cache

If you would like to create the image without using the cached images and would like to pull the base images back use the below commands.

docker build --no-cache

docker build --no-cache --pull

https://www.codegrepper.com/code-examples/shell/how+to+clear+docker+build+cache

demo.funky.containers's People

Contributors

cheranga avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.