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:)
我正在做的是:
您的问题似乎出在服务计划属性中。如果我添加这些属性,它就会起作用(我不确定为什么它们必须在那里)。
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
}
}