microsoft / azure-container-apps

Roadmap and issues for Azure Container Apps
MIT License
372 stars 29 forks source link

Internal server error while deploying using bicep #1318

Closed kamalsivalingam closed 3 weeks ago

kamalsivalingam commented 1 month ago

Please provide us with the following information:

This issue is a: (mark with an x)

Issue description

I have been trying to deploy azure container apps using bicep, randomly mostly the first try keeps throwing internal server error { "code": "InternalServerError", "message": "There was an unexpected InternalServerError. Please try again later. x-ms-correlation-request-id: f9384c70-2c26-4eca-afb2-f0a9255be2a0" }

Steps to reproduce

  1. ..
  2. ..

Expected behavior [What you expected to happen.]

Actual behavior [What actually happened.]

Screenshots
Image

Additional context

Ex. Did this issue occur in the CLI or the Portal?

anthonychu commented 1 month ago

There's not enough information here to help troubleshoot. Can you please share the bicep files you're deploying? Alternatively, you can open a support ticket.

kamalsivalingam commented 1 month ago

@anthonychu How do i open support ticket?

anthonychu commented 1 month ago

Please see https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

kamalsivalingam commented 1 month ago

Thank you @anthonychu

kamalsivalingam commented 4 weeks ago

@anthonychu @v-vish Looks like with my plan i am not able to create support ticket. Let me know what details do you need to troubleshoot. Like i mentioned if i try to deploy the bicep file again it works, just the first time the deployment throws internal server error

v-vish commented 4 weeks ago

@kamalsivalingam Could you please share the details of the Bicep files you're using for the deployment? We’ll review them and get back to you with an update.

kamalsivalingam commented 4 weeks ago

resource feedGenerator 'Microsoft.Web/sites@2022-09-01' = { name: '${appNamePrefix}-afg' location: location kind: 'functionapp,linux,container,azurecontainerapps' identity: { type: 'UserAssigned' userAssignedIdentities: { '${userManagedIdentity}': {} } }
properties: { httpsOnly: true
managedEnvironmentId: environmentId siteConfig: { linuxFxVersion: 'DOCKER|${registryServer}/feed-generator:${feedGeneratorImageTag}' functionAppScaleLimit: 1 minimumElasticInstanceCount: 1
appSettings: [ { name: 'DOCKER_REGISTRY_SERVER_URL' value: registryServer },{ name: 'DOCKER_REGISTRY_SERVER_USERNAME' value: registryUsername },{ name: 'DOCKER_REGISTRY_SERVER_PASSWORD' value: registryPassword },{ name: 'FUNCTIONS_WORKER_RUNTIME' value: 'dotnet' },{ name: 'APPINSIGHTS_INSTRUMENTATIONKEY' value: appInsightsInstrumentationKey },{ name: 'DatabaseHost' value: '${appNamePrefix}-db' },{ name: 'DatabaseRequireSsl' value: 'false' },{ name: 'EventStreamConnectionString' value: eventStreamConnectionString },{ name: 'EventStreamName' value: environmentName },{ name: 'EventStreamConsumerGroup' value: 'feed-generator' },{ name: 'ConfigStoreAppConfigUrl' value: appConfigUrl },{ name: 'ConfigStoreKeyVaultUrl' value: keyVaultUrl },{ name: 'BlobStoreConnectionString' value: blobStoreConnectionString },{ name: 'TableStore__ConnectionString' value: tableStoreConnectionString },{ name: 'AzureWebJobsStorage' value: blobStoreConnectionString },{ name: 'AZURE_CLIENT_ID' value: azureClientId },{ name: 'FUNCTIONS_EXTENSION_VERSION' value: '~4' },{ name: 'WEBSITE_CLOUD_ROLENAME' value: '${appNamePrefix}-afg' },{ name: 'AZURE_FUNCTIONS_ENVIRONMENT' value: 'Development' },{ name: 'ASPNETCORE_ENVIRONMENT' value: 'Development' },{ name: 'AzureWebJobsScriptRoot' value: '/home/site/wwwroot' } ] } } }

kamalsivalingam commented 4 weeks ago

@v-vish Should i and where can i email the all the bicep files?

v-vish commented 3 weeks ago

@kamalsivalingam You can send the details to Azure Container Apps Support acasupport@microsoft.com.

kamalsivalingam commented 3 weeks ago

@v-vish I emailed the bicep files. Thanks!

kamalsivalingam commented 3 weeks ago

Thanks for the help @v-vish. With Vaclav's help, was able to find out the root cause. Turned out the container app running azure function was trying to connect to EventHub that didnt exist during container app deployment but was being created as a post deployment step. After moving the step to create the EventHub as a predeployment step, deployment has been consistently working!

v-vish commented 3 weeks ago

@kamalsivalingam Thanks for the update! I'll go ahead and mark this as resolved since the issue has been fixed.