gpt4 book ai didi

azure - ABP 框架 6.0.0 在 Azure 上部署时失败

转载 作者:行者123 更新时间:2023-12-03 00:54:14 27 4
gpt4 key购买 nike

在本地成功构建并运行后,尝试在Azure上部署ABP框架6.0.0 AuthServer。

收到“HTTP 错误 500.30 - ASP.NET Core 应用程序无法启动”

Azure with no certificate but with https

当尝试获取一些日志时,使用位于 myproject.scm.azurewebsites.net/DebugConsole 的 Azure 调试控制台,我得到以下信息:

C:\home\site\wwwroot>dotnet MyProject.AuthServer.dll
[19:52:57 INF] Starting MyProject.AuthServer.
[19:53:00 FTL] MyProject.AuthServer terminated unexpectedly!
Volo.Abp.AbpInitializationException: An error occurred during ConfigureServicesAsync phase of the module Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule, Volo.Abp.OpenIddict.AspNetCore, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details.
---> Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: Access is denied.
at Internal.Cryptography.Pal.StorePal.FromSystemStore(String storeName, StoreLocation storeLocation, OpenFlags openFlags)
at System.Security.Cryptography.X509Certificates.X509Store.Open(OpenFlags flags)
at Microsoft.Extensions.DependencyInjection.OpenIddictServerBuilder.AddDevelopmentEncryptionCertificate(X500DistinguishedName subject)
at Microsoft.Extensions.DependencyInjection.OpenIddictServerBuilder.AddDevelopmentEncryptionCertificate()
at Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule.<>c__DisplayClass1_0.<AddOpenIddictServer>b__0(OpenIddictServerBuilder builder)
at Microsoft.Extensions.DependencyInjection.OpenIddictServerExtensions.AddServer(OpenIddictBuilder builder, Action`1 configuration)
at Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule.AddOpenIddictServer(IServiceCollection services)
at Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule.ConfigureServices(ServiceConfigurationContext context)
at Volo.Abp.Modularity.AbpModule.ConfigureServicesAsync(ServiceConfigurationContext context)
at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync()
--- End of inner exception stack trace ---
at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync()
at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action`1 optionsAction)
at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action`1 optionsAction)
at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action`1 optionsAction)
at MyProject.Program.Main(String[] args) in D:\a\1\s\aspnet-core\src\MyProject.AuthServer\Program.cs:line 35

这对我来说没什么意义,当谷歌搜索时,我在 abp.io 网站上找到了这个:https://support.abp.io/QA/Questions/3537/OpenIddict-WindowsCryptographicException-Access-is-denied

但我不知道该在哪里进行更改。感觉 ABP.io 文档中应该注明这一点?

您知道什么会导致这种情况,或者知道可能出现什么问题吗?

最佳答案

我遇到了同样的问题,除了部署到 azure 之外,与您具有相同的设置,但它应该是相同的解决方案。

请检查这个问题: WindowsCryptographicException: Access is denied when publishing app in Azure

OpenIddict 的问题(或者更确切地说,我们不习惯的优点)是它是简单的骨架,你必须自己实现一切。

OpenIddict 必须拥有证书才能在您要部署到的服务器上运行,并在您采取的任何措施之上获得更好的安全性。

基本上,您要做的就是创建一个新的自签名证书,将其上传到证书存储区,将指纹添加到代码中,并将其添加到所述服务器上的一个 WEBSITE_LOAD_CERTIFICATES 环境变量中。

您可以将此环境变量添加到代码中,而不是对指纹进行硬编码。

以下是 abp.io 文档中关于当前问题的信息不丰富的部分: Abp.io doc

这是我在代码中所做的:

OpenIddict Certificate Implementation in Abp.io

我希望这会有所帮助。

关于azure - ABP 框架 6.0.0 在 Azure 上部署时失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74061154/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com