Azure 功能 - 有机会通过 apt-get 安装包吗?

Azure functions - there is chance to install packages via apt-get?

我的 azure 函数需要一些 linux 包才能工作,但我无法通过 apt-get 安装它们,因为我收到错误 "sudo command not found" 或“(无法打开锁定文件 /var/lib/dpkg/lock - 打开(13:权限被拒绝)。

所以我的问题是:是否有机会在没有 sudo 的情况下安装这些包? 我在 Azure App Service(kudu)

中使用 Bash

您可以构建并 运行 您的 Azure Functions from a custom container。这样你也可以安装其他包。

This 示例项目几乎完全符合这一点。

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

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

COPY . /home/site/wwwroot

# Install FFMPEG
RUN apt-get update && \
    apt-get install -y ffmpeg

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

Source