我尝试使用二头肌部署功能应用程序Linux consumption plan
,但当我使用以下代码时,当我使用SDK部署到Azure门户时,我收到一个坏请求错误。
param functionAppName string = 'func-${uniqueString(resourceGroup().id)}'
@allowed([
'Standard_LRS'
])
param storageAccountType string = 'Standard_LRS'
param location string = resourceGroup().location
param appInsightsLocation string = resourceGroup().location
@description('The language worker runtime to load in the function app.')
@allowed([
'node'
])
param functionWorkerRuntime string = 'node'
param linuxFxVersion string
param packageUri string
var hostingPlanName = functionAppName
var applicationInsightsName = functionAppName
var storageAccountName = '${uniqueString(resourceGroup().id)}azfunctions'
resource storageAccount 'Microsoft.Storage/storageAccounts@2022-05-01' = {
name: storageAccountName
location: location
sku: {
name: storageAccountType
}
kind: 'Storage'
}
resource hostingPlan 'Microsoft.Web/serverfarms@2022-03-01' = {
name: hostingPlanName
location: location
sku: {
name: 'Y1'
}
properties: {
reserved: true
}
}
resource applicationInsight 'Microsoft.Insights/components@2020-02-02' = {
name: applicationInsightsName
location: appInsightsLocation
tags: {
'hidden-link:${resourceId('Microsoft.Web/sites', functionAppName)}': 'Resource'
}
properties: {
Application_Type: 'web'
}
kind: 'web'
}
resource functionApp 'Microsoft.Web/sites@2022-03-01' = {
name: functionAppName
location: location
kind: 'functionapp,linux'
properties: {
reserved: true
siteConfig: {
linuxFxVersion: linuxFxVersion
}
我已经修改了几次,但仍然得到同样的错误。任何建议的形式,任何一个,谢谢提前。
1条答案
按热度按时间4uqofj5v1#
我已使用以下二头肌模板部署了功能应用程序
Linux consumption plan
。感谢@mumian提供二头肌模板。
属性:{
保留:真
服务器农场ID:hostingPlan.id
如上所示,添加
serverFarmid:hostingPalan.id
值:引用(资源ID("Microsoft. Insights/组件",函数应用程序名称),"2022年3月1日")。仪器键
添加
2020-02-02
代替2022-03-01
,因为Api版本在Azure门户中仍然不可用,如下所示。成功部署到Azure后,门户转到资源组,如下所示。