2016-12-13 17 views
0

私のasp .netコアWebアプリケーションをAzureに公開しようとしましたが、動作しません。私はそれがかもしれないと思った問題が何であるかを把握するために、ログに表示しようとしましたが、このメッセージAsp .net core 1.1 Webアプリケーションazureにリソースを公開できません

<Error> 
    <Code>ResourceNotFound</Code> 
    <Message> 
     The specified resource does not exist. RequestId:64038d84-0001-0068-1019-55d321000000 Time:2016-12-13T08:19:53.3494003Z 
    </Message> 
</Error> 

を見つけた私は、このメッセージ

Picture when I try to browse to my published website

を得る閲覧打つとき私は接続文字列を見つけることを試みるプロジェクトの 'startup.cs'で。プロジェクトへ

Githubのリンク:https://github.com/AlexJCarstensen/ITTWEB-ASPNetCore

私は、この接続文字列のリンクを取得しよう:

services.AddDbContext<EmbeddedStockContext>(options => 
    options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));  

アイブ氏はアプリケーション設定の両方アプリの設定でのアプリのためのにこの設定を追加し、 接続文字列しかし、まだそれを見つけることができません。

ですから、どうすればAzureから接続文字列を得ることができますか?アプリケーション設定

Info:私はLinux上で開発しているので、Visual Studioにアクセスできません。

あなたは、私が詳細なエラーメッセージがしたログを発見したドミトリーコメントのフォローアップ後

よろしくアレックス

+0

Azureでは、サイトの前にIISを使用しています。あなたは 'web.config'にIISの指示を書いています。 ( 'stdoutLogEnabled =" true "') - これはKestrelのすべてのstdoutをファイルにダンプします(パスはweb.configにもあります)。次に、このログで正確なエラーを確認します。両方の作業にazure-preinstalled [kudo](https://github.com/projectkudu/kudu/wiki/Accessing-the-kudu-service)を使用することができます。 – Dmitry

+0

ありがとう! Azureが "builder.AddUserSecrets"をサポートしていないか、少なくともatleastがエラーメッセージであることが判明しました。だからそれが動作することを知っている..今私はデータベース上で移行を実行する方法を把握する必要があります。 – AlexJCarstensen

答えて

0

を助けることができると思います。だから、明らかにアズールはUserSecretsの機能をサポートしていません

Application startup exception: System.InvalidOperationException: Could  not find 'UserSecretsIdAttribute' on assembly 'ITTWEB-ASPNetCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. 
at Microsoft.Extensions.Configuration.ConfigurationExtensions.AddUserSecrets(IConfigurationBuilder configuration) 
at ITTWEB_ASPNetCore.Startup..ctor(IHostingEnvironment env) in D:\home\site\repository\ITTWEB-ASPNetCore\Startup.cs:line 38 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider) 
at Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters) 
at Microsoft.Extensions.Internal.ActivatorUtilities.GetServiceOrCreateInstance(IServiceProvider provider, Type type) 
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetServiceOrCreateInstance(IServiceProvider provider, Type type) 
at Microsoft.AspNetCore.Hosting.Internal.StartupLoader.LoadMethods(IServiceProvider hostingServiceProvider, Type startupType, String environmentName) 
at Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.<>c__DisplayClass1_0.<UseStartup>b__1(IServiceProvider sp) 
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactoryService(FactoryService factoryService, ServiceProvider provider) 
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument) 
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider) 
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider) 
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument) 
at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass16_0.<RealizeService>b__0(ServiceProvider provider) 
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType) 
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) 
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) 
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureStartup() 
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices() 
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() 
Hosting environment: Production 
Content root path: D:\home\site\wwwroot 
Now listening on: http://localhost:28800 
Application started. Press Ctrl+C to shut down. 

エラーメッセージは、このでした。 UserSecretsの詳細を知りたい場合。 Microsoftはここにいくつかの情報を持っている:私たちのプロジェクトで

https://docs.microsoft.com/en-gb/aspnet/core/security/app-secrets#security-app-secrets

を我々はuserSecretで異なるたconnectionStringを維持するために、WindowsおよびLinuxマシン上で開発するためにそれを使用しました。これはAzureには当てはまりませんでした。

他人に役立つことを願っています。

アレックス。

+0

AzureはUserSecretsをサポートしますが、ローカルまたはAzureでの実行に違いがあります。ローカルサイトは、 'project.json'に' userSecretId'があるので動作します。Azureでは、パブリッシュには出力されません([issue 62](https://github.com/aspnet/UserSecrets/issues/62#issuecomment-232896355))。そして、バグが修正されました([announce 209](https://github.com/aspnet/Announcements/issues/209)参照) – Dmitry

関連する問題