Software
- Visual Studio Code with the SQL Extension
Services
- Azure OpenAI instance with a text-embedding-ada-002 deployment and a gpt-4 deployment.
- An Azure SQL Database
Key Information Needed
- Azure SQL Database Server Name
- Azure SQL Database Name
- Azure OpenAI Endpoint Name
- Azute OpenAI Endpoint Key
Visual Studio Code will be used for working with the database.
-
When Visual Studio Code opens, click the SQL Extension on the left side.
-
Next, click Add Connection in the SQL Extension. (The Add Connection option might take a few seconds to load.)
-
A SQL Connection Dialog tab will appear in the VS Code editor.
-
For the Profile Name field, enter SampleDB.
-
Next, for Input type, select the Connection String radio button.
-
In the Connection String text box, copy and paste the following connect string
Be sure to replace the following placeholders in the connection string:YOUR_AZURE_SQL_SERVER_NAME, YOUR_DATABASE_NAME, YOUR_SQLADMIN_PASSWORD
Server=tcp:azuresql@YOUR_AZURE_SQL_SERVER_NAME.database.windows.net,1433;Initial Catalog=YOUR_DATABASE_NAME;Persist Security Info=False;User ID=sqladmin;Password=YOUR_SQLADMIN_PASSWORD;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
then press the blue Connect button.
-
Once connected to the database, right click on the database in the connection navigator on the left side and choose New Query.
-
You are now connected to the Azure SQL Database!