azure cli,azure 入門_Azure Data Studio(ADS)入門; 初始安裝和配置

 2023-10-18 阅读 17 评论 0

摘要:azure 入門 Microsoft Azure Data Studio is a new GUI-based (vs CLI) lightweight tool for developing and managing your modern SQL databases. The tool resembles Microsoft’s lightweight code editor, the open source IDE Visual Studio Code in terms of function

azure 入門

Microsoft Azure Data Studio is a new GUI-based (vs CLI) lightweight tool for developing and managing your modern SQL databases. The tool resembles Microsoft’s lightweight code editor, the open source IDE Visual Studio Code in terms of functionalities and the UI in general. If you’ve used Visual Studio Code (or VS?Code), you’d feel at home with Azure Data Studio. Azure Data Studio also integrates really well other products like Azure SQL Database and Data Warehouse has been made very simple. Azure Data Studio is a cross-platform tool available for Linux, Windows, and Mac to manage the SQL Server databases. You can go ahead and download Microsoft Azure Data Studio to try it out!

Microsoft Azure Data Studio是一個新的基于GUI(vs CLI)的輕量級工具,用于開發和管理現代SQL數據庫。 該工具在功能和總體上類似于Microsoft的輕量級代碼編輯器,開源的IDE Visual Studio Code和UI。 如果您使用過Visual Studio Code(或VS Code),那么Azure Data Studio會讓您感到賓至如歸。 Azure Data Studio還可以很好地集成其他產品,例如Azure SQL數據庫,并且Data Warehouse變得非常簡單。 Azure Data Studio是可用于Linux,Windows和Mac的跨平臺工具,用于管理SQL Server數據庫。 您可以繼續下載Microsoft Azure Data Studio進行試用!

In this article, we’re going to touch a few points on Microsoft’s new tool, called, Azure Data Studio:

azure cli、 在本文中,我們將談談Microsoft的新工具Azure Data Studio的幾點:

  • Installation of Azure Data Studio on Windows and Linux distributions (CentOS, for example)

    在Windows和Linux發行版上安裝Azure Data Studio(例如,CentOS)
  • Discussion on the Integrated terminals—Windows and Linux

    關于集成終端的討論-Windows和Linux
  • A short tour of the CMD and PowerShell terminals on Windows

    Windows上的CMD和PowerShell終端簡短瀏覽
  • Installation and configuration of PowerShell on the integrated terminal on Linux

    在Linux上的集成終端上安裝和配置PowerShell
  • And more…

    和更多…

適用于Windows的Azure Data Studio(ADS) (Azure Data Studio (ADS) for Windows)

Installing Azure Data Studio is straightforward in Windows. You just have to download the installer and run it. Follow the on-screen instructions and you’re good to go. To launch it, you can either launch it from the Start Menu, or search for sqlops, or simply run the command sqlops on the cmd window.

在Windows中安裝Azure Data Studio很簡單。 您只需要下載安裝程序并運行它。 按照屏幕上的說明進行操作,一切順利。 要啟動它,您可以從“開始”菜單中啟動它,或者搜索sqlops,或者直接在cmd窗口中運行sqlops命令。

azure 虛擬機,

Here is what you will see of Microsoft Azure Data Studio at first

這是您首先會看到的Microsoft Azure Data Studio

azure云服務器、

適用于Linux的Azure Data Studio(ADS) (Azure Data Studio (ADS) for Linux)

To install Azure Data Studio follow the steps below.

若要安裝Azure Data Studio,請按照以下步驟操作。

  1. Check whether the dependency package, libXScrnSaver is installed or not

    檢查是否安裝了依賴包libXScrnSaver

    #yum info libXScrnSaver
    

    微軟azure?

  2. In case of absence of this package, install it using the following command:

    如果沒有此軟件包,請使用以下命令進行安裝:

    #yum install libXScrnSaver
    
  3. Download?Azure Data Studio (ADS) for Linux.

    azure data studio設置中文、 下載適用于Linux的Azure Data Studio(ADS) 。

  4. Extract the files from the archive using the tar -xvf command

    使用tar -xvf命令從存檔中提取文件

    #cd ~
    #cp /home/thanVitha/Downloads/sqlops-linux-0.24.1.tar.gz ~
    tar -xvf ~/sqlops-linux0.24.1.tar.gz
    

    azure技術支持。

  5. Launch Azure Data Studio. Set the environment variables using the .bashrc script file. Use the source command to load the configuration information into the current shell.

    啟動Azure Data Studio。 使用.bashrc腳本文件設置環境變量。 使用source命令將配置信息加載到當前shell中。

    #echo 'export PATH="$PATH:~/sqlops-linux-x64"' >> ~/.bashrc
    #source ~/.bashrc
    #sqlops
    

    Microsoft azure,

  6. Now, run the sqlops command to invoke Azure Data Studio

    現在,運行sqlops命令以調用Azure Data Studio

綜合終端 (Integrated terminal)

As administrators, it is quite common for us to use the terminal, be it PowerShell or CMD on Windows, or Terminal on Linux. However, it’s inconvenient for us to have to switch windows while working on something on sqlops to go to the terminal. Worry not, sqlops has the terminal built right in. It’s also flexible enough to let you configure your own terminals into sqlops. In other words, if you’re used to PowerShell, you can configure the terminal to be the PowerShell one by default. You can even create your own terminal configurations and map them into sqlops to have a completely customized experience.

作為管理員,使用終端非常普遍,無論是Windows上的PowerShell或CMD,還是Linux上的Terminal。 但是,對我們來說,在使用slops進行終端操作時必須切換窗口是很不方便的。 不用擔心,sqlops內置有終端。它也足夠靈活,可以讓您將自己的終端配置為sqlops。 換句話說,如果您習慣使用PowerShell,則可以將終端默認配置為PowerShell之一。 您甚至可以創建自己的終端配置并將其映射到sqlop中,以獲得完全自定義的體驗。

To open the integrated terminal, go to View?on the menu bar and select Integrated Terminal. If you’re into keyboard shortcuts, use the Ctrl+` combination (that’s a backtick).

要打開集成終端,請轉到菜單欄上的查看 ,然后選擇集成終端 。 如果您喜歡鍵盤快捷鍵,請使用Ctrl +`組合鍵(即反引號)。

As we can see that cmd.exe is loaded by default in case of Windows. Let’s open a PowerShell console and run few SQL Server cmdlets.

我們可以看到,在Windows中,默認情況下會加載cmd.exe。 讓我們打開一個PowerShell控制臺并運行幾個SQL Server cmdlet。

Tap on 1: cmd and select powershell.

點擊1:cmd并選擇powershell

To test the cross-platform functionality, connect to Linux SQL instance. By default, the SQL Server modules are loaded.

要測試跨平臺功能,請連接到Linux SQL實例。 默認情況下,將加載SQL Server模塊。

PS C:\Users\ccov648> Invoke-Sqlcmd -ServerInstance 10.2.6.51 -query "select @@servername" -Username sa -Password thanVitha@2015
PS C:\Users\ccov648> Invoke-Sqlcmd -ServerInstance 10.2.6.51 -query "select name from sys.databases" -Username sa -Password thanVitha@2015

That was all Windows. Let’s go for a test run of the tool on Linux.

就是所有的Windows。 讓我們在Linux上對該工具進行測試運行。

To open a Powershell console on Azure Data Studio in Linux, you need to download the PowerShell package from the Microsoft repository and use the yum command to install or update the PowerShell package.

要在Linux上的Azure Data Studio上打開Powershell控制臺,需要從Microsoft資源庫下載PowerShell軟件包,并使用yum命令安裝或更新PowerShell軟件包。

We download the PowerShell repository using wget

我們使用wget下載PowerShell存儲庫

#wget --directory-prefix=/etc/yum.repos.d/powershell.repo
https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.18/powershell-6.0.0_alpha.18-1.el7.centos.x86_64.rpm

Use yum command to install the PowerShell package.

使用yum命令安裝PowerShell軟件包。

#yum install powershell

Start PowerShell using the pwsh command.

使用pwsh命令啟動PowerShell。

#pwsh

Let’s now try to query the SQL instance using the PowerShell integrated terminal on SQL Server Operations Studio on Linux.

現在,讓我們嘗試使用Linux上SQL Server Operations Studio上的PowerShell集成終端查詢SQL實例。

Download and register the SQL Server PowerShell DLLs. The tar file is here. You can read more about installation procedures in this article: An overview of Python vs PowerShell for SQL Server Database Administration.

下載并注冊SQL Server PowerShell DLL。 tar文件在這里 。 您可以在本文中閱讀有關安裝過程的更多信息: 適用于SQL Server數據庫管理的Python與PowerShell概述 。

In this case the DLLs are extracted to /home/thanvitha/SQLTools/.

在這種情況下,DLL被提取到/ home / thanvitha / SQLTools /。

PS /root> cd /home/thanvitha/SQLTools/
PS /home/thanvitha/SQLTools>

Add the SQL Server assemblies to the shell so as to be able to invoke the respective objects.

將SQL Server程序集添加到外殼程序,以便能夠調用相應的對象。

PS /home/thanvitha/SQLTools> Add-Type??-AssemblyName “Microsoft.SqlServer.Smo”
PS /home/thanvitha/SQLTools> Add-Type??-AssemblyName “Microsoft.SqlServer.ConnectionInfo”

Test the SQL Server module by building a connection string and printing the database information of the SQL Server instance named node2.

通過構建連接字符串并打印名為node2SQL Server實例的數據庫信息來測試SQL Server模塊。

結語 (Wrapping up)

In this article we provided a high-level overview of DevOps, and listed various tools that help manage SQL Server databases on different platforms. We looked at Azure Data Studio in particular, and laid out the installation steps on Windows and Linux. Also, we configured PowerShell on CentOS and loaded the SQL Server DLLs in the Azure Data Studio integrated terminal on CentOS.

在本文中,我們提供了DevOps的高級概述,并列出了有助于在不同平臺上管理SQL Server數據庫的各種工具。 我們特別研究了Azure Data Studio,并列出了Windows和Linux上的安裝步驟。 此外,我們在CentOS上配置了PowerShell,并在CentOS上的Azure Data Studio集成終端中加載了SQL Server DLL。

That’s not all of what Azure Data Studio can do, though; the tool has several other great features that hopefully I’ll get a chance to review in the future. But this is all for now. Stay tuned for updates on this promising tool!

不過,這還不是Azure Data Studio所能做的全部; 該工具還有其他一些很棒的功能,希望以后我能有機會回顧一下。 但這只是現在。 請繼續關注此有前途的工具的更新!

目錄 (Table of contents)

Getting started building applications using SQL Server DevOps Tools
Overview of SQLCMD utility in SQL Server
The BCP (Bulk Copy Program) command in action
Continuous Deployment using SQL Server Tools SqlPackage.exe
All about MSSQL-Scripter, the SQL Server cross-platform scripting Tool
Getting started with Azure Data Studio (ADS); initial installation and configuration
開始使用SQL Server DevOps工具構建應用程序
SQL Server中SQLCMD實用工具概述
運行中的BCP(大容量復制程序)命令
使用SQL Server工具SqlPackage.exe進行連續部署
有關MSSQL-Scripter(SQL Server跨平臺腳本工具)的全部信息
Azure Data Studio(ADS)入門; 初始安裝和配置

翻譯自: https://www.sqlshack.com/getting-started-azure-data-studio-ads-initial-installation-and-configuration/

azure 入門

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/5/144813.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息