Code Monkey home page Code Monkey logo

Comments (5)

eduardomourar avatar eduardomourar commented on September 4, 2024

I believe PSDepend and Powershell 6.1 should be part of the powershell azure functions docker image. Here is a way to work with the example PSCoreApp and install dependencies:

# Install powershell project dependencies
FROM mcr.microsoft.com/powershell:6.1.0-debian-8 as builder

WORKDIR /tmp
COPY ./requirements.psd1 .
RUN pwsh -c "Install-Module -Name PSDepend -Scope CurrentUser -Force" \
    && pwsh -c "Set-Location . ; Invoke-PSDepend -Force"

FROM mcr.microsoft.com/azure-functions/powershell:2.0

WORKDIR $AzureWebJobsScriptRoot
COPY --from=builder /tmp/Modules/ /azure-functions-host/workers/powershell/Modules/
COPY . .

from azure-functions-powershell-worker.

TylerLeonhardt avatar TylerLeonhardt commented on September 4, 2024

So this would be to have the container do the installing of the Modules and allow the user to specify them in the requirements.psd1 rather than having to bundle their modules themselves?

from azure-functions-powershell-worker.

JustinGrote avatar JustinGrote commented on September 4, 2024

from azure-functions-powershell-worker.

eduardomourar avatar eduardomourar commented on September 4, 2024

As you guys can see in the python and Nodejs docker image, at least one package management is available (pip and npm, respectively). They are not doing the dependencies installation as far as I know, but makes everything easy to start if you have them available.
If none of this makes sense, do put a dockerfile in the example folder so that even people without powershell installed in their local machine can try it out.
About not being opinionated, the moment you chose to have the worker and the example using PSDepend that went out the window, don’t you think? Not that I mind because I think PSDepend is quite useful and simple to use.
Also, keep in mind that some of us like me and my company would be using the Azure Functions with container directly so it would be no pack before deploy.

from azure-functions-powershell-worker.

JustinGrote avatar JustinGrote commented on September 4, 2024

from azure-functions-powershell-worker.

Related Issues (20)

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.