0
MacでVisual Studio Codeを使用してasp.net MVC Core Webアプリケーションを構築しました。アプリケーションは、localhostのデータベース(EF)を使って作業しています。MacでVisual Studio Codeを使用してAzureにデータベースを公開するには?
Web App + SQLデータベースを使用してAzureアカウントを作成しました。次に、appsetting.json
の接続文字列をAzure SQL Databaseの接続文字列に変更しました。
ウェブサイトは、git push azure master
コマンドを使用してAzure Web Appに配備されています。しかし、Azureにデータベースを公開するには?
appsetting.json
で
:
"ConnectionStrings": {
"AzureConnection": "Server=tcp:myapp-test.database.windows.net,1433;Initial Catalog=myapp-test;Persist Security Info=False;User ID=***;Password=***;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
}
出力私はdotnet ef database update
を実行した後:
bash-3.2$ dotnet ef database update
Project MyApp (.NETCoreApp,Version=v1.0) will be compiled because project is not safe for incremental compilation. Use --build-profile flag for more information.
Compiling BlueJacket for .NETCoreApp,Version=v1.0
Bundling with configuration from /Users/matt/Documents/MyApp/bundleconfig.json
Processing wwwroot/css/site.min.css
Processing wwwroot/js/site.min.js
Compilation succeeded.
0 Warning(s)
0 Error(s)
Time elapsed 00:00:05.1136780
(The compilation time can be improved. Run "dotnet build --build-profile" for more information)
Done.
はい、私は、データベースを作成し、すでにappsetting.json' 'への接続文字列を追加しています。 – Matt
コマンド 'dotnet ef database update'を使っても、まだ動作しませんか? – Matt
それは何と言いますか?あなたは冗長を追加することができます –