Author : MD TAREQ HASSAN
Prepare Database
- Restore a sample database using SSMS
- Restoring a sample database for Azure SQL using blob storage and SSMS from a VM
Connect Database to SQL Server Object Explorer
SQL Server Developer Edition
- SQL Server Developer Edition is running locally
- AdventureWorks sample Database is imported using SSMS (previous step: Prepare database)
- Get the connection string from SSMS
- Visual Studio > SQL Server Object Explorer > connect Database using that connection string
Azure SQL
If private endpoint is created for Azure sql server i.e. 10.22.333.55 foo-test.database.windows.net
- Open Notepad as Admin
- Notepad menu > FIle > Open >
C:\Windows\System32\drivers\etc
> hosts file - Add that :
10.22.333.55 foo-test.database.windows.net
- Save
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
10.22.333.55 foo-test.database.windows.net
Now get the Azure SQL connection string and:
- Visual Studio > SQL Server Object Explorer
- connect Database using that connection string
- See: connect sql server to visual studio
Ensure EF Core Power Tools
- We are gonna use .Net core 3.1+
- In roder to use .Net core 3.1+, we have to use Visual Studio 2019+
Step-1
Step-2
Step-3