【问题标题】:Deploy Azure function app with nodejs code from a public github with Bicep使用 Bicep 从公共 github 部署带有 nodejs 代码的 Azure 函数应用
【发布时间】:2022-06-13 20:24:34
【问题描述】:

我可以用二头肌制作一个 Windows functionApp,并像这样附加一个源代码控制:

resource srcControls 'Microsoft.Web/sites/sourcecontrols@2021-01-01' = {
  name: '${functionApp.name}/web'
  properties: {
    repoUrl: 'https://github.com/Bygdrift/Warehouse.Modules.Example'
    branch: 'master'
    isManualIntegration: true
  }
}

通过这种方法,我将一个 dotnet 项目从一个公共 github 存储库直接加载到一个 functionapp 中,这太棒了。

我必须对在 Linux 上运行的节点项目执行相同的操作,但失败了。 我应该在 github 存储库中压缩我的代码吗?

它不应是 Kubernetes 的容器,也不应通过 github 操作部署。必须让每个人都可以使用 ARM 模板轻松将 node 项目部署到 azure。

这是我失败的设置:

resource linuxHostingPlan 'Microsoft.Web/serverfarms@2020-10-01' = {
  name: 'Linux-${uniqueString(resourceGroup().id)}'
  location: location
  kind: 'Linux'
  sku: {
    name: 'Y1'
    tier: 'Dynamic'
  }
  properties: {
    reserved: true
  }
}

resource functionApp 'Microsoft.Web/sites@2021-02-01' = {  //Inspiration: https://docs.microsoft.com/en-us/azure/azure-functions/functions-infrastructure-as-code
  kind: 'functionapp,linux'
  name: functionAppName
  location: location
  properties: {
    serverFarmId: linuxHostingPlan.id
    siteConfig: {
      appSettings: [
        {
          name: 'AzureWebJobsStorage'
          value: appStorageConnectionString
        }
        {
          name: 'FUNCTIONS_EXTENSION_VERSION'
          value: '~4'
        }
        {
          name: 'FUNCTIONS_WORKER_RUNTIME'
          value: 'node'
        }
        {
          name: 'WEBSITE_NODE_DEFAULT_VERSION'
          value: '~14'
        }
      ]
      linuxFxVersion: 'Node|14'
    }
    reserved: true
  }
}

resource srcControls 'Microsoft.Web/sites/sourcecontrols@2021-01-01' = {
  name: '${functionApp.name}/web'
  properties: {
    repoUrl: 'https://github.com/Bygdrift/nodejsClean'
    branch: 'master'
    isManualIntegration: true
  }
}

【问题讨论】:

    标签: azure-functions azure-resource-manager azure-bicep


    【解决方案1】:

    你找到解决方法了吗?非常感谢分享...

    BR 安德烈

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-15
      • 1970-01-01
      • 2017-10-14
      • 2011-07-16
      • 2018-03-18
      • 2021-04-13
      相关资源
      最近更新 更多