0

I have an issue with Function app 1 after step "Start ConfigureServices" it must be run step "defaultazurecredential.gettoken" like Function App 2

enter image description here enter image description here

  1. Infrastructure:

+Both of them are located in the same ASP 1.

  • Function App 1 located in App Service Plan 1 in App Service Environment 1
  • Function App 2 located in App Service Plan 2 in App Service Environment 1

+Both ASP using the same Vnet.

  1. Configuration: +Both of them use framework 4.8 + Runtime ~4 enter image description here

+Both of them use Managed Identity connected to SQL.

  1. Code Both of them use the same artifact to deploy. enter image description here

The first time I checked Function App 1 ran Framework 6.0 and Function App 2 ran Framework 4.8. I ran the downgrade version Framework "Set-AzWebApp -NetFrameworkVersion v4.8 -Name $App -ResourceGroupName $ResoureGroup" and restart the web app and the issue was still there.

When the issue happened I think Funtion app can't connect to SQL but after investigating and trying many methods it looks like from Funtion App 1 did not run to get token that why it can't authen SQL, not from code, connection string or network.

Does anyone have any idea about this case?

ATY
  • 41
  • 5
  • Do they both have the same config in the portal--and specifically, the same managed identity ID? Are you using a user-assigned managed identity? If so, do both apps have a configuration for AZURE_CLIENT_ID? – Donny Kwitty Mar 17 '23 at 18:08
  • Yeah, both of them have the same config in portal, just have different connection string storage. I have compared between appsetting.json in Kudu but did not see any abnormal, same managed identity, SQL server, Port, Connection string SQL Database. – ATY Mar 18 '23 at 03:11

1 Answers1

0

After took many times compared in Kudu I saw the abnormal folder Runtimes in D:\home\site\wwwroot\bin. I deleted the folder and restarted Function App and tried again, it has worked as well. enter image description here

ATY
  • 41
  • 5