将Azure FunctionApp容器作为linuxFxVersion部署到应用服务

pjngdqdw  于 2023-08-07  发布在  Linux
关注(0)|答案(2)|浏览(103)

我正在Azure应用服务上部署隔离的Azure函数应用容器。
我已经创建了应用服务计划:

"sku": {
    "name": "P1v2",
    "tier": "PremiumV2",
    "size": "P1v2",
    "family": "Pv2",
    "capacity": 1
},
"kind": "linux",

字符串
App Service:

"kind": "functionapp,linux,container"


我正在使用AzureWebAppContainer@1任务:

- task: AzureWebAppContainer@1
  displayName: Deploy to app service
  inputs:
    azureSubscription: ${{ parameters.azureSubscription }}
    appName: my-web-app0name
    imageName:  myacr01.azurecr.io/myregistryname:tag01
    configurationSettings: -linuxFxVersion DOCKER|myacr01.azurecr.io/myregistryname:tag01"
    appSettings: ${{ parameters.appSettings }}
    resourceGroupName: my-resource-group


当任务由Azure DevOps yaml管道执行时,日志中有以下信息:

Trying to update App Service Configuration settings. Data: {"appCommandLine":null,"windowsFxVersion":"DOCKER|myacr01.azurecr.io/myregistryname:tag01"}


我不明白为什么用windowsFxVersion代替linuxFxVersion。在Azure Portal中的资源级别上,我还可以看到我设置了windowsFxVersion而不是linuxFxVersion。
值得一提的是,当您在Azure Portal上单击向导时,默认Function App设置为linuxFxVersion。

qzlgjiam

qzlgjiam1#

此值无效:
第一个月
请通过执行以下命令查找可用值:

az webapp list-runtimes --os linux

字符串
测试结果:

[
  "DOTNETCORE:7.0",
  "DOTNETCORE:6.0",
  "DOTNETCORE:3.1",
  "NODE:16-lts",
  "NODE:14-lts",
  "PYTHON:3.9",
  "PYTHON:3.8",
  "PYTHON:3.7",
  "PHP:8.0",
  "PHP:7.4",
  "RUBY:2.7",
  "JAVA:17-java17",
  "JAVA:11-java11",
  "JAVA:8-jre8",
  "JBOSSEAP:7-java11",
  "JBOSSEAP:7-java8",
  "TOMCAT:10.0-java17",
  "TOMCAT:10.0-java11",
  "TOMCAT:10.0-jre8",
  "TOMCAT:9.0-java17",
  "TOMCAT:9.0-java11",
  "TOMCAT:9.0-jre8",
  "TOMCAT:8.5-java11",
  "TOMCAT:8.5-jre8"
]


我在当前项目中使用:
linuxFx版本:'DOTNET| 6.0'
netFrameworkVersion:“v6.0”
kind:'functionapp,linux'
用于创建应用程序的二头肌:

resource hostingPlan 'Microsoft.Web/serverfarms@2020-10-01' = {
  name: hostingPlanName
  location: location
  kind: 'linux'
  sku: {
    name: hostingPlanNameSkuName
  }
  properties: {
    reserved: true
  }
}

resource myApp 'Microsoft.Web/sites@2020-06-01' = {
  name: myAppName
  location: location
  kind: 'functionapp,linux'
  identity: {
    type: 'SystemAssigned'
  }
  properties: {
    httpsOnly: true
    serverFarmId: hostingPlan.id
    clientAffinityEnabled: true
    siteConfig: {
      alwaysOn: true
      netFrameworkVersion: 'v6.0'
      linuxFxVersion: 'DOTNET|6.0'
      ftpsState: 'Disabled'
      cors: {
        allowedOrigins: [
          '*'
        ]
      }
    }
  }
}

23c0lvtd

23c0lvtd2#

你是否配置了'kind'参数'functionapp,linux,container'的函数app,以便部署容器化的函数app。

相关问题