Jump to content

Azure Data Studio - Connections to Azure Government


Recommended Posts

Guest JoshuaLent
Posted

 

Connections to Azure Government aren't automatically enabled in Azure Data Studio. This article will guide you through the process of enabling connections to Azure Government from Azure Data Studio. 

 

 

 

 

Begin by connecting to your subscription in the Azure Government Portal. Then, navigate to Azure Active Directory > Groups

 

Identify or create a group that will contain the users you wish to provision access for. In this article, we’ll use “MI_Admins”.

 

 

 

largevv2px999.jpg.c82923fb3f46acf71c830a90382ce3f0.jpg

 

 

 

In Azure Portal, navigate to the Azure SQL Managed Instance or the server for the Azure SQL DB you wish to grant access to. On the networking page for the SQL Server, add appropriate firewall rules to allow your connection to the database:

 

 

 

largevv2px999.jpg.d29134c52618c976bd7b1ec3627b6eac.jpg

 

 

 

Using SQL Server Management Studio or Query Editor from the portal, connect to the database you want to access from Azure Data Studio. Then, create a contained user and add it to an appropriate database role. For example:

 

 

 

largevv2px999.jpg.00dcc55f6e0ef583482c111e15e132b0.jpg

 

 

 

In Azure Data Studio navigate to File > Preferences > Settings. Then, navigate to Extensions > Azure (core). Then, check the box for enabling Us Gov Cloud.

 

 

 

largevv2px999.jpg.2adfa06aae41018753ead9eff5bc8f62.jpg

 

 

 

Expand the Azure connections blade and click the ‘+’ sign to add your Azure Government Account.

 

 

 

largevv2px999.jpg.876c835d0ef4d93dc83a5c64ed76881d.jpg

 

 

 

Under Azure (US GOVERNMENT), select the ‘+’ sign, and then select the Azure (US GOVERNMENT) option.

 

 

 

largevv2px999.jpg.b834b5f442f686ea300f19c9c92a6afc.jpg

 

 

 

Enter your Azure government subscription address and authenticate to Azure.

 

Click the close button and navigate back to the Connections > Azure blade in Azure Data Studio.

 

Expand the appropriate subscription and find the SQL MI or DB you’re wanting to connect to.

 

 

 

largevv2px999.jpg.7dfb55bcb0888071b1fdb7378c07be4b.jpg

 

 

 

Click the connect icon:

 

 

 

largevv2px999.jpg.db9e47be178fc52054763fb65511482f.jpg

 

 

 

Verify your connection information and then click connect:

 

 

 

largevv2px999.jpg.a0e670d47aba3aca33c360fc26e6d5f7.jpg

 

 

 

You should now also be able to persist the server connection on the Connections > Server Blade:

 

 

 

largevv2px999.jpg.290dda2f7e6623d9fd485acc158e2be5.jpg

 

 

 

Under some circumstances, like when working within a secure enclave, it may be necessary to enable the ADAL authentication library and/or Device Code Method authentication. ADAL is a predecessor to MSAL. Device Code Method, provides an alternative token-based authentication where other types of interactive authentication are not possible.

 

 

 

largevv2px999.jpg.f9ef95a2fd592f7309cf0ca48b5de213.jpg

 

 

 

This authentication method will result in the process of navigating to a Microsoft website and providing a user code when creating your connection:

 

largevv2px999.jpg.38a5211ee2bbdaac62d4ecbe386dc4b0.jpg

 

 

 

 

 

Thanks for reading!

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...