无法在 Azure App 服务上部署 IdentityServer 4 代码

Not able to deploy IdentityServer 4 code on Azure App service

我使用 dotnetcore 3.0 在空 Asp.net Web 应用程序托管中开发了 IdentityServer。 我创建的应用服务是 dotnetcore 3.0,Windows 平台。

在我的 dotnet 核心解决方案中,我使用 'dotnet publish'

创建了发布输出

它在本地主机 url 上运行良好,因为我在客户端应用程序中使用了 url。我只有 TokenPoint 并且从 UI 应用程序我传递了用户名/密码

应用服务日志如下:

2020-04-02 17:41:09 NEWIDPSERVER GET / X-ARR-LOG-ID=e83b7b1e-6f40-4f67-9f0d-0f4f474e2309 443 - 112.196.168.73 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/80.0.3987.149+Safari/537.36 ARRAffinity= c450828deae8ef5774d6b51f85ad7bb411cc76cec811344524a352e00ebf3ca1 - newidpserver.azurewebsites.net 500 30 574 2913 1374 6437 2020-04-02 17:41:19 ~1NEWIDPSERVER GET /detectors type=tools&name=eventviewer&X-ARR-LOG-ID=ec15da12-ce7e-44ae-83fe-7f8f4c9c62cc 443 - 112.196.168.73 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/80.0.3987.149+Safari/537.36 ARRAffinity=c450828deae8ef5774d6b51f85ad7bb411cc76cec811344524a352e00ebf3ca1 https://newidpserver.azurewebsites.net/ newidpserver.scm.azurewebsites.net 302 0 0 1047 1590 1062 IIS 详细错误 - 500.30 - 内部服务器错误

HTTP 错误 500.30 - 内部服务器错误

页面无法显示,因为内部服务器错误有 occurred.Most 可能的原因:您可以尝试的方法:

详细错误 Information:Module AspNetCoreModuleV2Notification ExecuteRequestHandlerHandler aspNetCoreError 代码 0x8007023e 请求 URL https://newidpserver:80/.well-known/openid-configurationPhysical 路径 D:\home\site\wwwroot\.well-known\openid-configurationLogon 方法 匿名登录用户 匿名

更多 Information:This 错误表示处理请求时出现问题。 Web服务器接收到请求,但在处理过程中出现致命错误,导致500错误。

View more information »

Microsoft知识库文章:

2020-04-02 17:42:35 NEWIDPSERVER GET /.well-known/openid-configuration X-ARR-LOG-ID=3273401b-d59d-4e79-ba95-207ca2a8273f 443 - 112.196.168.73 - - - newidpserver.azurewebsites.net 500 30 574 2923 892 0 2020-04-02T17:44:45 过去 1 分钟内没有新的踪迹。 2020-04-02T17:45:45 过去 2 分钟内没有新的踪迹。 2020-04-02T17:46:45 过去 3 分钟内没有新的踪迹。 2020-04-02T17:47:36 欢迎,您现在已连接到 log-streaming 服务。默认超时为 2 小时。使用应用程序设置 SCM_LOGSTREAM_TIMEOUT 更改超时(以秒为单位)。 2020-04-02T17:48:36 过去 1 分钟内没有新的踪迹。 2020-04-02T17:49:07 System.ApplicationException: 跟踪侦听器 AzureBlobTraceListener 已禁用。 ---> System.InvalidOperationException: 未指定云存储帐户的 SAS URL。使用环境变量'DIAGNOSTICS_AZUREBLOBCONTAINERSASURL'定义it.at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.RefreshConfig()---内部异常堆栈跟踪结束--- 2020-04-02T17:49:07 PID[6956] 信息从 D:\Program Files (x86)\MiddlewareModules.2.4\Microsoft.Azure.AppService.Middleware.Modules.dll 加载模块 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'WEBSITE_AUTH_LOGOUT_PATH' = '/.auth/logout' 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'WEBSITE_AUTH_ENABLED' = 'False' 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'EASY_AUTH_CONFIG_CONTENTS' = '{"preserveUrlFragmentsForLogins":false,"endpointPath":{"apiPrefix":"/.auth ","logoutPath":"/.auth/logout","LogoutCompletionPath":"/.auth/logout/complete","mobileCompatibilityEnabled":false},"allowedExternalRedirectUri" :{"allowedExternalRedirectUrls":null,"AllowedExternalRedirectUriCollection":[]},"nonce":{"validateNonce":true,"nonceExpirationInterval":"00:05:00"}, "token":{"stateDirectory":"D:\home\data\.auth","TokenStorePath":"D:\home\data\.auth\tokens","tokenStoreEnabled":false,"tokenStoreContainerSasUrlSettingName":null,"tokenRefreshExtensionHours":72.0},"isAuthEnabled":false,"requireHttps":true,"defaultProvider":null,"unauthenticatedClientAction":0,"authConfigDirectory":null,"hideDeprecatedSecurityIds":false,"AppTracingLevel":31,"useLegacyClaims":true,"warmupPath":null,"forwardingHeader":null,"functionsExtensionVersion":null,"cookieExpirationTime": "08:00:00","azureActiveDirectory":{"openIdIssuer":null,"clientId":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"allowedAudiences":null,"loginParameters":null,"aadBypassSingleTenancyCheck":false,"activeDirectoryAcl":null,"disableWwwAuthenticateResponse":false,"OpenIdIssuerValue":null,"OpenIdConfigurationUrl" :无效的}"facebook":{"facebookAppId":null,"facebookAppSecretSettingName":null,"facebookScope":null,"facebookGraphApiVersion":"v3.3"},"gitHub": {"gitHubAppId":null,"gitHubAppSecretSettingName":null,"gitHubScope":null},"twitter":{"twitterConsumerKey":null,"twitterConsumerSecretSettingName":null}, "google":{"googleClientId":null,"googleClientSecretSettingName":null,"googleScope":null,"allowedAudiences":null},"openIdConnectProviders":null}' 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'WEBSITE_CORS_ALLOWED_ORIGINS' = '' 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'WEBSITE_CORS_SUPPORT_CREDENTIALS' = 'False' 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'WEBSITE_AUTH_LOGOUT_PATH' = '/.auth/logout' 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'WEBSITE_AUTH_ENABLED' = 'False' 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'EASY_AUTH_CONFIG_CONTENTS' = '{"preserveUrlFragmentsForLogins":false,"endpointPath":{"apiPrefix":"/.auth ","logoutPath":"/.auth/logout","LogoutCompletionPath":"/.auth/logout/complete","mobileCompatibilityEnabled":false},"allowedExternalRedirectUri" :{"allowedExternalRedirectUrls":null,"AllowedExternalRedirectUriCollection":[]},"nonce":{"validateNonce":true,"nonceExpirationInterval":"00:05:00"}, "token":{"stateDirectory":"D:\home\data\.auth","TokenStorePath":"D:\home\data\.auth\tokens","tokenStoreEnabled":false,"tokenStoreContainerSasUrlSettingName":null,"tokenRefreshExtensionHours":72.0},"isAuthEnabled":false,"requireHttps":true,"defaultProvider":null,"unauthenticatedClientAction":0,"authConfigDirectory":null,"hideDeprecatedSecurityIds":false,"AppTracingLevel":31,"useLegacyClaims":true,"warmupPath":null,"forwardingHeader":null,"functionsExtensionVersion":null,"cookieExpirationTime": "08:00:00","azureActiveDirectory":{"openIdIssuer":null,"clientId":null,"clientSecretSettingName":null,"clientSecretCertificateThumbprint":null,"allowedAudiences":null,"loginParameters":null,"aadBypassSingleTenancyCheck":false,"activeDirectoryAcl":null,"disableWwwAuthenticateResponse":false,"OpenIdIssuerValue":null,"OpenIdConfigurationUrl" :null},"facebook":{"facebookAppId":null,"facebookAppSecretSettingName":null,"facebookScope":null,"facebookGraphApiVersion":"v3.3"},"gitHub":{"gitHubAppId":null,"gitHubAppSecretSettingName":null,"gitHubScope":null},"twitter":{"twitterConsumerKey":null,"twitterConsumerSecretSettingName" :null},"google":{"googleClientId":null,"googleClientSecretSettingName":null,"googleScope":null,"allowedAudiences":null},"openIdConnectProviders":无效的}' 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'WEBSITE_CORS_ALLOWED_ORIGINS' = '' 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'WEBSITE_CORS_SUPPORT_CREDENTIALS' = 'False' 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'WEBSITE_AUTH_SIGNING_KEY' = '0F****' 2020-04-02T17:49:08 PID[6956] 详细检测到的应用程序设置 'WEBSITE_AUTH_ENCRYPTION_KEY' = 'CE****' IIS 详细错误 - 500.0 - 内部服务器错误

HTTP 错误 500.0 - 内部服务器错误

页面无法显示,因为内部服务器错误有 occurred.Most 可能的原因:您可以尝试的方法:

详细错误 Information:Module AspNetCoreModuleV2Notification ExecuteRequestHandlerHandler aspNetCoreError 代码 0x00000000 请求 URL https://newidpserver:80/.well-known/openid-configurationPhysical 路径 D:\home\site\wwwroot\.well-known\openid-configurationLogon 方法 匿名登录用户 匿名

更多 Information:This 错误表示处理请求时出现问题。 Web服务器接收到请求,但在处理过程中出现致命错误,导致500错误。

View more information »

Microsoft知识库文章:


2:

https://i.stack.imgur.com/zeALq.png

我本地的令牌:

ack.imgur.com/X6Ch3.png

您可以通过 vscode 发布您的网络应用程序,如果您的 visual studio 有问题。

添加关于 azure 的扩展,并打开由 visual studio 创建的项目。 运行 在本地确保您可以打开网站。

然后您可以按照 document about publish app by vscode 部署您的应用程序。我建议您按照 visual studio 部署应用程序。我认为使用 Visual Studio.

发布很容易