Hi support team,
I need to integrate my app with Zapier. For that, I need Oauth v2 authentication... therefore, I activate IdentityServer on appsettings file. I can test it with console application "ConsoleApiClient" : it works.
I wanted to test on my azure appservice but application doesn't start at all : I'm getting an Internal Server Error

Can you please help me ?
12 Answer(s)
-
0
You can follow the documentation to confirm the cause of the problem.
https://docs.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-2.2
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
This doesn't help. I just enabled IdentityServer on appsettings file :
"IdentityServer": { "IsEnabled": "true", "Authority": "https://------app-service-stagging.azurewebsites.net/", "ApiName": "default-api", "ApiSecret": "secret", "Clients": [ { "ClientId": "client", "AllowedGrantTypes": [ "password" ], "ClientSecrets": [ { "Value": "def2edf7-5d42-4edc-a84a" } ], "AllowedScopes": [ "default-api" ] } ] },The only difference between a running project on azure and the error described previously is just changing "IsEnabled" property to "true".
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
We have to see the application's log to determine the problem. Can't judge from the screenshot.
You can try the solution in the article below to see the application's error log.
https://scottsauber.com/2017/04/10/how-to-troubleshoot-an-error-occurred-while-starting-the-application-in-asp-net-core-on-iis/
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Tks @maliming
Here is the error log :
Application startup exception: System.InvalidOperationException: Grant types list contains duplicate values at IdentityServer4.Models.Client.ValidateGrantTypes(IEnumerable`1 grantTypes) at Web.IdentityServer.IdentityServerConfig.GetClients(IConfigurationRoot configuration) in \IdentityServer\IdentityServerConfig.cs:line 39 at Web.IdentityServer.IdentityServerRegistrar.Register(IServiceCollection services, IConfigurationRoot configuration) in Core\IdentityServer\IdentityServerRegistrar.cs:line 13 at Web.Startup.Startup.ConfigureServices(IServiceCollection services) in Web.Host\Startup\Startup.cs:line 106 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services) at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices() at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
It is strange has I just defined "password" as grant type. I tried to change it by
"AllowedGrantTypes": [ "hybrid", "client_credentials" ],
But same error.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Sorry : )
Do you also define the Identity Server configuration in other appsettings files? Such as:
appsettings.Production.jsonIf not, is it convenient to share your project code to: [email protected]?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Yes,
I'm running my tests on Staging slot so the file used is appsettings.staging.json. As far as I deactivate IdentityServer property, the app runs again. It is not an issue with this file.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
hi @ricavir
Is it convenient to share your project code to: [email protected]?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Unfortunately, it is not allowed by our company rules.
Has I said, IdentityServer activation works on my dev machine but not on Azure server...
Have you tried to enable identityserver over your cloud servers ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
-
0
You are right ! I removed appsettings.json and appsettings.production.json and it is working now.
Do you know why I had this behavior ? It's like a mix is being done between appsettings files !?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
I also find it strange, but this is the behavior of Net Core.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thank you
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)
