Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"az functionapp create" failing to create App Service Plan in select regions #28944

Open
brettnagy opened this issue May 12, 2024 · 7 comments · May be fixed by #30612
Open

"az functionapp create" failing to create App Service Plan in select regions #28944

brettnagy opened this issue May 12, 2024 · 7 comments · May be fixed by #30612
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.

Comments

@brettnagy
Copy link

Describe the bug

Using the Azure CLI to create a new consumption plan function in South Central US fails to create the associated app service plan, but the function is created successfully. Using the Azure Portal to create the function in SCUS (point and click, not cloud shell) works as expected and creates the Y1 plan.

Using the Azure CLI and South Central US location, after creating the consumption plan function, an app service plan name is shown:

image

Clicking on the app service plan name produces the following 404 error:

image

Using "az functionapp show" against the newly created function throws an error:

image

Using the Azure CLI and East US location, the function and its app service plan are created successfully and the app service plan can be viewed in the portal.

image

Related command

Repro Steps

$someRandom = "PUT SOMETHING SHORT & RANDOM IN HERE"
$location = "southcentralus"
$resourceGroupName = "FunctionResourceGroup"
$storageName = "funcstorage$someRandom"
$functionAppName = "funcapp$someRandom"

az group create --name $resourceGroupName --location $location
az storage account create --name $storageName --location $location --resource-group $resourceGroupName --sku Standard_LRS
az functionapp create --name $functionAppName --storage-account $storageName --consumption-plan-location $location --resource-group $resourceGroupName --functions-version 4

-- this following line will fail in SCUS
az functionapp show --name $functionAppName --resource-group $resourceGroupName

image

Errors

Clicking on the app service plan name produces the following 404 error:

image

Using "az functionapp show" against the newly created function throws an error:

image

Issue script & Debug output

Can provide on request. It's big and did not show any errors.

Expected behavior

"az functionapp create", when using the --consumption-plan-location argument, should create a Y1 app service plan that can be viewed in the portal. The "az functionapp show" command should be able to retrieve details of the function.

Environment Summary

image

Same incorrect behavior seen when using the Azure Portal Cloud Shell & PowerShell.

Additional context

No response

@brettnagy brettnagy added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label May 12, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented May 12, 2024

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage az storage labels May 12, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group labels May 12, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Functions az functionapp Service Attention This issue is responsible by Azure service team. labels May 12, 2024
@yonzhan yonzhan removed bug This issue requires a change to an existing behavior in the product in order to be resolved. ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Azure CLI Team The command of the issue is owned by Azure CLI team Storage az storage labels May 12, 2024
@pavlo-stoyanovskyy
Copy link

Hi there,

I am experiencing a very similar issue. For some reason, the az functionapp commands in Azure DevOps release pipelines have stopped working for all my existing Azure Function Apps and are now throwing the error "ERROR: (ResourceNotFound) The Resource 'Microsoft.Web/serverFarms/SouthCentralUSPlan'".

If I go to Azure Function App -> Automation -> Export template, I don't see any parameters being referenced to "/providers/Microsoft.Web/serverfarms/SouthCentralUSPlan" as shown in the picture below -

image

Does anyone know how to solve that issue?

Thank you for any advice that would help fix the issue!

@brettnagy
Copy link
Author

@yonzhan - any way to get someone to take a quick look at this? It's definitely a bug. Thank you.

@jarrodlilkendey
Copy link

I'm facing this same issue today. I tried eastus, westus and westus2 and no luck.

@ulluoink
Copy link

ulluoink commented Nov 6, 2024

same here for us region west europe

why have you removed bug and so on? do you think it is fixed?

why do you not answer?

@yonzhan @microsoft-github-policy-service

@jsim-mc
Copy link

jsim-mc commented Nov 6, 2024

We have been experiencing this error continuously for the past 3 weeks in the WestEurope region.

We use the az functionapp create command with the --consumption-plan-location parameter to create a new function app. The command executes successfully.

Afterwards, we try to update the settings using the command az functionapp config appsettings set, but we receive the error message:
"The Resource 'Microsoft.Web/serverFarms/WestEuropePlan' under resource group 'rg-name'" was not found.

When we check the resource group, the function app is listed there. However, the consumption function app plan is not initially visible. It only becomes available after approximately 10 minutes. Once the plan is displayed, the commands can be executed again without any issues.

When I check the activity log of the consumption plan, three operations are displayed. The second update operation has the status "Failed." In the summary for this operation, I see the error message: "The parameter SKU has an invalid value."

Image
Image

@yonzhan @evelyn-ys @calvinhzy @zhoxing-ms @amamounelsayed @kaibocai @shreyas-gopalakrishna @kamperiadis

@jsim-mc
Copy link

jsim-mc commented Nov 7, 2024

This issue has been open for six months, and so far, no team member has reviewed it. In the meantime, we have found a workaround to bypass the problem. For anyone else encountering this error, here’s a potential temporary solution that might help:

  1. First, create a consumption function app plan for the desired region by calling the Azure REST API through the Azure CLI. The command az functionapp plan create cannot be used here because Y1 is not allowed as an SKU.
$SkuName = "Y1"
$Location = "<your desired location>" # e.g. westeurope or southcentralus
$SubscriptionId = "<your subcription id>"
$ResourceGroup = "<your resource group name>" 
$ConsumptionPlanName = "<your consumption plan name>" # e.g. WestEuropePlan
 
$content = [PSCustomObject]@{
    type = "Microsoft.Web/serverfarms"
    kind = "functionapp"
    location = $Location
    sku = [PSCustomObject]@{
        name = $SkuName 
    }
}

ConvertTo-Json $content -depth 10 | Out-File ".\manifest.json"

$uri = "https://management.azure.com/subscriptions/$($SubscriptionId)/resourceGroups/$($ResourceGroup)/providers/Microsoft.Web/serverfarms/$($ConsumptionPlanName)?api-version=2024-04-01"

az rest `
--method put `
    --headers "Content-Type=application/json" `
    --uri $uri `
    --body "@manifest.json"

Remove-Item "./manifest.json"
  1. Next, create the function app as usual with the command az functionapp create, using the --consumption-plan-location parameter. Since we already created the consumption plan for the desired region in the previous step, no new consumption plan will be generated; instead, the existing plan will be used. There is also a --plan parameter; however, a consumption plan cannot be specified with it, as doing so will return the error: "There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it."
az functionapp create `
    --name $Name `
    --storage-account $StorageAccount `
    --consumption-plan-location $Location `
    --runtime dotnet-isolated `
    --resource-group $ResourceGroup `
    --functions-version $AppVersion `
    --runtime-version $RuntimeVersion 

We hope this helps others until the issue is addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet