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. 

答えて

0

は、あなたがまだAzureのデータベースを作成したことがありますか?接続文字列がありますか?

オープンパッケージ・マネージャと実行「の更新・データベース」

+0

はい、私は、データベースを作成し、すでにappsetting.json' 'への接続文字列を追加しています。 – Matt

+0

コマンド 'dotnet ef database update'を使っても、まだ動作しませんか? – Matt

+0

それは何と言いますか?あなたは冗長を追加することができます –

関連する問題