【管理 Life Saver 】之 活用Azure cml 在Ubuntu on Windows 10 或是 Po...
基本上從命令列執行Azure SQL Database的建立,防火牆設定與移除,都可以從Windows 10 的 PowerShell 或是 Ubuntu on Windows 10 的命令列執行,這樣一來可以寫成Windows AT排程,或是寫成Ubuntu on Windows 10 的 crontab 的作業。方便系統管理員,直接上Azure的Portal網站點選。另外值得一提,無論使用Windows 10 的 PowerShell 或是 Ubuntu on Windows 10 的命令列執行 Azure CML(Command Line Interface),都會啟動二次認證,所以安全無慮。以下是安裝Azure Command Line Interface 於Ubuntu的【SOP】# 安裝Node.js的包管理器 npmapt-get install npm# 安裝 Azure 命令列介面(CLI)
npm install azure-cli -g# 建立 soft link 否則會出錯
ln -s /usr/bin/nodejs /usr/bin/node#執行Azure Login 從 Ubuntu of Windows 10 Anniversary
$ azure login
info: Executing command login
|info: To sign in, use a web browser to open the pagehttps://aka.ms/devicelogin. Enter the code GM59NC8FS to authenticate.
-$ azure login
info: Executing command login
|info: To sign in, use a web browser to open the pagehttps://aka.ms/devicelogin. Enter the code GM59NC8FS to authenticate.
|info: Added subscription Windows Azure MSDN - Visual Studio Ultimate
info: Added subscription Visual Studio Enterprise
+
info: login command OK <--成功登入
$#切換Azure模式成為asm模式,不然會無法執行Azure sql 指令
$ azure config mode asm
info: Executing command config mode
info: New mode is asm
info: config mode command OK#嘗試建立Azure SQL Server
$ azure sql server create
info: Executing command sql server create
New Administrator login: super_sql_server
New administrator password: **********
Confirm password: **********
help: Location:
1) East US
2) West US
3) South Central US
4) Central US
5) North Central US
6) East US 2
7) North Europe
8) West Europe
9) Southeast Asia
10) East Asia
11) Japan West
12) Japan East
13) Brazil South
14) Canada East
15) Canada Central
16) West US 2
+ Creating SQL Server
data: Server Name lcmc0pql54
info: sql server create command OK
$
# 顯示所有的SQL database in Azure
$ azure sql server list
info: Executing command sql server list
+ Getting SQL server
data: Name Location
data: ---------- ---------
data: lcmc0pql54 East Asia
data: v5q9t8q6dn East Asia
info: sql server list command OK
$#刪除SQL database in Azure
$ azure sql server delete
info: Executing command sql server delete
Server name: v5q9t8q6dn
Delete server v5q9t8q6dn? y
+ Removing SQL Server
info: sql server delete command OK
$
页:
[1]