Azure-Samples / azure-functions-flex-consumption-samples

Samples for Azure Functions Flex Consumption
MIT License
21 stars 16 forks source link

SB-VNET bicep infra fails to create function-app #29

Closed duvet86 closed 2 days ago

duvet86 commented 3 weeks ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Run E2E, SB-VNET infra pipeline

Any log messages given by the failure

{"code":"DeploymentFailed","target":"/subscriptions/-/resourceGroups/-/providers/Microsoft.Resources/deployments/function-app","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InternalServerError","message":"There was an unexpected InternalServerError. Please try again later. x-ms-correlation-request-id: -"}]}

Expected/desired behavior

function-app should be successfully created.

OS and Version?

Run bicep in VSCode.

Versions

Latest VSCode, latest repo version

Mention any other details that might be useful


Thanks! We'll be in touch soon.

nzthiago commented 3 weeks ago

@duvet86 thank you for reporting and for trying that sample. I just tried the sample in East US and worked end to end including the app deployment. I'd like to investigate why your attempt failed to get to the root cause and fix any gap that is causing that InternalServerError exception. Can you share the name of the function app that the sample created for you and the region you used?

duvet86 commented 2 weeks ago

Hi, apologies for the late reply. Unfortunately I have deleted the resource group but these are the names and the location of the services I had created:

var location = 'australiaeast'

var processorServiceName = ''
var processorUserAssignedIdentityName = ''
var applicationInsightsName = 'lucainsights'
var appServicePlanName = 'lucaplan'
var logAnalyticsName = 'lucaanalitycs'
var resourceGroupName = 'luca-test-vnet'
var storageAccountName = 'lucastorageagain'
var serviceBusQueueName = 'lucaqueue'
var serviceBusNamespaceName = 'lucasb'
var vNetName = 'lcavnet'
plamber commented 2 weeks ago

Hi @nzthiago, I am experiencing a similar problem when deploying to North Europe.

Azure Function Name: func-k3cyfgfez3y22-functions SubscriptionId: d90c19c6-f6f2-4084-a1ff-fdcfd99d37d2

At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details. (Code: DeploymentFailed, Target: /subscriptions/d90c19c6-f6f2-4084-a1ff-fdcfd99d37d2/resourceGroups/rg-north/providers/Microsoft.Resources/deployments/api-functions-dotnet-isolated-module), There was an unexpected InternalServerError.  Please try again later.  x-ms-correlation-request-id: 573d697a-e776-4ff2-b270-c395bdbdfb9f (Code: InternalServerError)

I tried to deploy to the same subscription using eastus, but received a similar exception. Azure Function Name: func-ycy5tjfzuxzam-functions

There was an unexpected InternalServerError.  Please try again later.  x-ms-correlation-request-id: d778e770-e9b7-4fa7-8d21-494faa4d09b4 (Code: InternalServerError)

The subscription is an MSDN developer subscription.

Cheers, Patrick

nzthiago commented 2 weeks ago

@plamber - thank you for the information. I was able to check the logs and the issue is related to the Microsoft.App provider needing to be registered on the subscription. We have it in the list of considerations of the Flex Consumption documentation but we also have a work item that, once it rolls out, would show a better error message instead of InternalServerError. I will update our samples readme to include a note about this too just in case.

Can you please check and register 'Microsoft.App' as a resource provider in your subscription and then retry this sample? You can follow these instructions on how to register providers using the Azure Portal, PowerShell or the Azure CLI.

@duvet86 - I wasn't able to find your app logs but please also double check this Microsoft.App provider registration on your subscription and let me know.

plamber commented 2 weeks ago

Hi @nzthiago, thank you. This was my problem. I haven't noticed this since I was able to provision the Azure Function without associated network.

Thank you for your help

nzthiago commented 2 weeks ago

@duvet86 following up on the above to check if registering the Microsoft.App resource provider for your subscription fixes your issue.

nzthiago commented 2 days ago

Closing this for now.