gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 01:17:42 26 4
gpt4 key购买 nike

我正在致力于在 Azure 应用服务上部署隔离的 Azure Function App 容器。

我已创建应用服务计划:

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

使用应用服务:

"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 门户的资源级别上,我还可以看到我设置了 windowsFxVersion 而不是 linuxFxVersion。

值得一提的是,当您使用默认的 Function App 单击 Azure 门户上的向导时,它被设置为 linuxFxVersion。

最佳答案

这不是一个有效值:
-linuxFxVersion DOCKER|myacr01.azurecr.io/myregistryname:tag01"

请通过 executing 查找可用值:

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'
网络框架版本:'v6.0'
种类:'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: [
'*'
]
}
}
}
}

关于azure - 将 Azure FunctionApp 容器作为 linuxFxVersion 部署到应用服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73932091/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com