无法使用azure bicep部署灵活消费功能应用程序

问题描述 投票:0回答:1
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' = {
  name: 'vvkstaccforflexfuncapp'  
  location: 'uksouth'
  kind: 'StorageV2'
  sku: {
    name: 'Standard_LRS'
  }
  properties: {
    accessTier: 'Hot'
    minimumTlsVersion: 'TLS1_2'
  }
}


resource appInsights 'Microsoft.Insights/components@2020-02-02' = {
  name: 'name'
  location: 'uksouth'
  kind: 'web'
  properties: {
    Application_Type: 'web'
  }
}

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2019-11-01' = {
  name: 'vnetforflexfuncapp'
  location: 'uksouth'
  properties: {
    addressSpace: {
      addressPrefixes: [
        '10.0.0.0/16'
      ]
    }
    subnets: [
      {
        name: 'InboundSubnet'
        properties: {
          addressPrefix: '10.0.0.0/24'
        }
      }
      {
        name: 'OutboundSubnet'
        properties: {
          addressPrefix: '10.0.1.0/24'
        }
      }
    ]
  }
}


resource flexappserviceplan 'Microsoft.Web/serverfarms@2024-04-01' = {
  name: 'vscodeflexappserviceplan'
  location:  'uksouth'
  sku: {
    name: 'FC1'
    tier: 'FlexConsumption'
    family: 'FC'
    capacity: 0
  }
  kind: 'functionapp'
}

resource flexfunapp 'Microsoft.Web/sites@2024-04-01' = {
  name: 'vscodeflexfunapp'
  location: 'uksouth'
  kind: 'functionapp,linux'
  properties: {
    serverFarmId: flexappserviceplan.id
    siteConfig: {
      appSettings: [
        {
          name: 'AzureWebJobsStorage__accountName'
          value: storageAccount.name
        }
        {
          name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
          value: appInsights.properties.ConnectionString
        }
      ]
      numberOfWorkers: 1
    }
    functionAppConfig: {
      deployment: {
        storage: {
          type: 'blobcontainer'
          value: '${storageAccount.properties.primaryEndpoints.blob}container'
          authentication: {
            type: 'SystemAssignedIdentity'
          }
          
        }
      }
      scaleAndConcurrency: {
        maximumInstanceCount: 100
        instanceMemoryMB: 4096
      }
      runtime: {
        name: 'python'
        version: '3.11'
      }
    }
    httpsOnly: true
    publicNetworkAccess: 'Disabled'
    virtualNetworkSubnetId: '/subscriptions/subscriptionid/resourceGroups/vivekchak-rg/providers/Microsoft.Network/virtualNetworks/vnetforflexfuncapp/subnets/OutboundSubnet'    
  }
}

resource privateEndpoint1 'Microsoft.Network/privateEndpoints@2024-05-01' = {
  name: flexfunapp.name
  location: 'uksouth'
  properties: {
    subnet: {
      id: '/subscriptions/<subscriptionid>/resourceGroups/vivekchak-rg/providers/Microsoft.Network/virtualNetworks/vnetforflexfuncapp/subnets/InboundSubnet'
    }
    privateLinkServiceConnections: [
      {
        name: 'flexfunapp'
        properties: {
          privateLinkServiceId: flexfunapp.id
          groupIds: [
            'blob'
          ]
        }
      }
    ]
  }
}

我已遵循本MS Doc中给出的所有给定限制和说明,但我无法部署灵活消费计划功能应用程序。

Requested features are not supported in region. Please try another region. (Code:)

我正在做的是:

  1. 我正在尝试使用 BICEP 模板在应用程序服务计划的灵活消费模型中使用 Python 3.11 创建 Azure Function App 作为运行时堆栈
  2. 可以使用入站子网创建没有公共网络访问权限并与出站子网集成及其专用端点的功能应用程序。
azure azure-functions azure-bicep azure-app-service-plans
1个回答
0
投票

您的问题似乎出在服务计划属性中。如果我添加这些属性,它就会起作用(我不确定为什么它们必须在那里)。

resource flexappserviceplan 'Microsoft.Web/serverfarms@2024-04-01' = {
  name: 'nottakensp213'
  location: 'uksouth'
  sku: {
    name: 'FC1'
    tier: 'FlexConsumption'
    size: 'FC1'
    family: 'FC'
    capacity: 0
  }
  kind: 'functionapp'
  properties: {
    perSiteScaling: false
    elasticScaleEnabled: false
    maximumElasticWorkerCount: 1
    isSpot: false
    reserved: true
    isXenon: false
    hyperV: false
    targetWorkerCount: 0
    targetWorkerSizeId: 0
    zoneRedundant: false
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.