DEV Community

Supraja Tangella
Supraja Tangella

Posted on

๐—ฆ๐—ฒ๐—ฎ๐—บ๐—น๐—ฒ๐˜€๐˜€ ๐—œ๐—ป๐˜๐—ฒ๐—ด๐—ฟ๐—ฎ๐˜๐—ถ๐—ผ๐—ป: ๐—–๐—ผ๐—ป๐—ป๐—ฒ๐—ฐ๐˜ ๐—”๐˜‡๐˜‚๐—ฟ๐—ฒ ๐—ฆ๐—ค๐—Ÿ ๐˜„๐—ถ๐˜๐—ต ๐—ฉ๐—ถ๐˜€๐˜‚๐—ฎ๐—น ๐—ฆ๐˜๐˜‚๐—ฑ๐—ถ๐—ผ ๐—ถ๐—ป ๐— ๐—ถ๐—ป๐˜‚๐˜๐—ฒ๐˜€

Connecting ๐—”๐˜‡๐˜‚๐—ฟ๐—ฒ ๐—ฆ๐—ค๐—Ÿ ๐——๐—ฎ๐˜๐—ฎ๐—ฏ๐—ฎ๐˜€๐—ฒ to ๐—ฉ๐—ถ๐˜€๐˜‚๐—ฎ๐—น ๐—ฆ๐˜๐˜‚๐—ฑ๐—ถ๐—ผ is a powerful way to streamline cloud-based development. Below are the steps I followed to establish a smooth connection:

๐—ฆ๐˜๐—ฒ๐—ฝ๐˜€ ๐˜๐—ผ ๐—–๐—ผ๐—ป๐—ป๐—ฒ๐—ฐ๐˜ ๐—”๐˜‡๐˜‚๐—ฟ๐—ฒ ๐—ฆ๐—ค๐—Ÿ ๐˜๐—ผ ๐—ฉ๐—ถ๐˜€๐˜‚๐—ฎ๐—น ๐—ฆ๐˜๐˜‚๐—ฑ๐—ถ๐—ผ:

  • ๐Ÿญ. ๐—–๐—ฟ๐—ฒ๐—ฎ๐˜๐—ฒ ๐—ฎ๐—ป ๐—”๐˜‡๐˜‚๐—ฟ๐—ฒ ๐—ฆ๐—ค๐—Ÿ ๐——๐—ฎ๐˜๐—ฎ๐—ฏ๐—ฎ๐˜€๐—ฒ

    • Log in to the Azure portal and create a new SQL server and SQL database.
  • ๐Ÿฎ. ๐—–๐—ผ๐—ป๐—ณ๐—ถ๐—ด๐˜‚๐—ฟ๐—ฒ ๐—™๐—ถ๐—ฟ๐—ฒ๐˜„๐—ฎ๐—น๐—น ๐—ฆ๐—ฒ๐˜๐˜๐—ถ๐—ป๐—ด๐˜€

    • Go to "Set Server Firewall" in Azure and add your client IP address to allow access.
  • ๐Ÿฏ. ๐—ฅ๐—ฒ๐˜๐—ฟ๐—ถ๐—ฒ๐˜ƒ๐—ฒ ๐˜๐—ต๐—ฒ ๐—–๐—ผ๐—ป๐—ป๐—ฒ๐—ฐ๐˜๐—ถ๐—ผ๐—ป ๐—ฆ๐˜๐—ฟ๐—ถ๐—ป๐—ด

    • Navigate to your Azure SQL database, open the โ€œConnection stringsโ€ tab, and copy the ADO.NET string.
  • ๐Ÿฐ. ๐—ข๐—ฝ๐—ฒ๐—ป ๐—ฆ๐—ค๐—Ÿ ๐—ฆ๐—ฒ๐—ฟ๐˜ƒ๐—ฒ๐—ฟ ๐—ข๐—ฏ๐—ท๐—ฒ๐—ฐ๐˜ ๐—˜๐˜…๐—ฝ๐—น๐—ผ๐—ฟ๐—ฒ๐—ฟ ๐—ถ๐—ป ๐—ฉ๐—ถ๐˜€๐˜‚๐—ฎ๐—น ๐—ฆ๐˜๐˜‚๐—ฑ๐—ถ๐—ผ

    • In Visual Studio, go to View > SQL Server Object Explorer and select Add SQL Server.
  • ๐Ÿฑ. ๐—˜๐—ป๐˜๐—ฒ๐—ฟ ๐—”๐˜‡๐˜‚๐—ฟ๐—ฒ ๐—ฆ๐—ค๐—Ÿ ๐—ฆ๐—ฒ๐—ฟ๐˜ƒ๐—ฒ๐—ฟ ๐—–๐—ฟ๐—ฒ๐—ฑ๐—ฒ๐—ป๐˜๐—ถ๐—ฎ๐—น๐˜€

    • Paste the server name from Azure, choose "SQL Server Authentication," and enter your login credentials.
  • ๐Ÿฒ. ๐—–๐—ผ๐—ป๐—ป๐—ฒ๐—ฐ๐˜ ๐—ฎ๐—ป๐—ฑ ๐— ๐—ฎ๐—ป๐—ฎ๐—ด๐—ฒ ๐—ฌ๐—ผ๐˜‚๐—ฟ ๐——๐—ฎ๐˜๐—ฎ๐—ฏ๐—ฎ๐˜€๐—ฒ

    • After connecting, you can create queries, manage tables, and perform CRUD operations right from Visual Studio.

This setup allows you to manage and interact with cloud-hosted SQL data directly within your development environmentโ€”helping you work faster and more efficiently.

๐—›๐—ผ๐˜„ ๐—ฎ๐—ฟ๐—ฒ ๐˜†๐—ผ๐˜‚ ๐—ฐ๐˜‚๐—ฟ๐—ฟ๐—ฒ๐—ป๐˜๐—น๐˜† ๐—บ๐—ฎ๐—ป๐—ฎ๐—ด๐—ถ๐—ป๐—ด ๐˜†๐—ผ๐˜‚๐—ฟ ๐—”๐˜‡๐˜‚๐—ฟ๐—ฒ ๐—ฆ๐—ค๐—Ÿ ๐—ฐ๐—ผ๐—ป๐—ป๐—ฒ๐—ฐ๐˜๐—ถ๐—ผ๐—ป๐˜€? ๐—”๐—ฟ๐—ฒ ๐˜†๐—ผ๐˜‚ ๐˜‚๐˜€๐—ถ๐—ป๐—ด ๐—ฉ๐—ถ๐˜€๐˜‚๐—ฎ๐—น ๐—ฆ๐˜๐˜‚๐—ฑ๐—ถ๐—ผ, ๐—”๐˜‡๐˜‚๐—ฟ๐—ฒ ๐——๐—ฎ๐˜๐—ฎ ๐—ฆ๐˜๐˜‚๐—ฑ๐—ถ๐—ผ, ๐—ผ๐—ฟ ๐—ฆ๐—ฆ๐— ๐—ฆ?

Top comments (0)