GithubHelp home page GithubHelp logo

dotnet-isolated-func-dapr's Introduction

Dotnet Isolated Azure Function Dapr Extension docker image

This project addresses an issue with building a .NET isolated Azure Function Docker image with Dapr, where it looks for Microsoft.Azure.WebJobs.Extensions.Dapr with version >= 99.99.99.

Solution

To fix this issue, you need to create a folder called local-packages in the root directory of the project and create a nuget.config file to let the dotnet build use the local NuGet package.

nuget.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="nuget.local" value="local-packages" />
  </packageSources>
</configuration>

Dockerfile

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

COPY . /src/dotnet-function-app
RUN cd /src/dotnet-function-app && \
mkdir -p /home/site/wwwroot && \
dotnet publish *.csproj --configfile nuget.config --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-isolated:4.0-dotnet-isolated8.0-appservice
FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4.0-dotnet-isolated8.0
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureFunctionsJobHost__Logging__Console__IsEnabled=true

COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"]

Docker Build and Push

To build the Docker image:

docker build -t mdashique/dotnet-isolated-func-dapr:0.1 .

To push the Docker image:

docker push docker.io/mdashique/dotnet-isolated-func-dapr:0.1

This is the sample docker image for Dotnet Isolated Azure Function Dapr Extension.

Conclusion

By following these steps, you should be able to build and push a .NET isolated Azure Function Docker image that correctly references the Microsoft.Azure.WebJobs.Extensions.Dapr package.

dotnet-isolated-func-dapr's People

Contributors

ashiquemd avatar

Watchers

 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.