Azure 和 LinuxAzure and Linux

Microsoft Azure 集結了各種整合式公用雲端服務且數量不斷增加,包括分析、虛擬機器、資料庫、行動、網路、儲存體和 Web—因此很適合用來裝載您的解決方案。Microsoft Azure is a growing collection of integrated public cloud services including analytics, virtual machines, databases, mobile, networking, storage, and web—ideal for hosting your solutions. Microsoft Azure 提供可調整的運算平台,可讓您在需要時用多少就付多少,而不需投資內部部署的硬體。Microsoft Azure provides a scalable computing platform that allows you to only pay for what you use, when you want it - without having to invest in on-premises hardware. Azure 可供您將您的方案相應增加和放大至任何您需要的規模,以滿足您所服務之客戶的需求。Azure is ready when you are to scale your solutions up and out to whatever scale you require to service the needs of your clients.

如果您熟悉 Amazon AWS 的各項功能,您可以查看 Azure 與 AWS 的對照 定義對應文件If you are familiar with the various features of Amazon's AWS, you can examine the Azure vs AWS definition mapping document.

區域Regions

Microsoft Azure 資源分散在世界各地的多個地理區域。Microsoft Azure resources are distributed across multiple geographical regions around the world. 「區域」代表單一地理區域中的多個資料中心。A "region" represents multiple data centers in a single geographical area. Azure 目前 (截至 2018 年 8 月為止) 已在全球 42 個區域正式推出,並即將在另外 12 個區域推出 - 全球適用的區域比任何其他雲端提供者都還要多。Azure currently (as of August 2018) has 42 regions generally available around the world with an additional 12 regions announced - more global regions than any other cloud provider. 在下列頁面可以找到最新的現有和全新推出的區域清單:An updated list of existing and newly announced regions can be found in the following page:

可用性Availability

Azure 已宣布推出業界領先的單一執行個體虛擬機器 99.9% 服務等級協定 (前提是您部署的所有磁碟都是進階儲存體的 VM)。Azure announced an industry leading single instance virtual machine Service Level Agreement of 99.9% provided you deploy the VM with premium storage for all disks. 為了讓您的部署符合標準的 99.95% VM 服務等級協定資格,您還必須在可用性設定組內部署兩個或更多執行工作負載的 VM。In order for your deployment to qualify for the standard 99.95% VM Service Level Agreement, you still need to deploy two or more VMs running your workload inside of an availability set. 可用性設定組可確保您的 VM 會分散在 Azure 資料中心內的多個容錯網域,以及部署至具有不同維護期間的主機。An availability set ensures that your VMs are distributed across multiple fault domains in the Azure data centers as well as deployed onto hosts with different maintenance windows. 完整 Azure SLA 說明保證的 Azure 整體可用性。The full Azure SLA explains the guaranteed availability of Azure as a whole.

受控磁碟Managed Disks

受控磁碟可在背景中為您處理 Azure 儲存體帳戶的建立和管理作業,確保您不需要擔心儲存體帳戶的延展性限制。Managed Disks handles Azure Storage account creation and management in the background for you, and ensures that you do not have to worry about the scalability limits of the storage account. 您可指定磁碟大小和效能層級 (標準或進階),而 Azure 會建立和管理磁碟。You specify the disk size and the performance tier (Standard or Premium), and Azure creates and manages the disk. 當您新增磁碟或相應增加和減少 VM 時,都不必擔心所使用的儲存體。As you add disks or scale the VM up and down, you don't have to worry about the storage being used. 如果您要建立新的 VM,請使用 Azure CLI 或 Azure 入口網站來建立具有受控 OS 和資料磁碟的 VM。If you're creating new VMs, use the Azure CLI or the Azure portal to create VMs with Managed OS and data disks. 如果您有具備非受控磁碟的 VM,您可以將 VM 轉換成由受控磁碟提供支援If you have VMs with unmanaged disks, you can convert your VMs to be backed with Managed Disks.

您也可以在每個 Azure 區域中使用單一儲存體帳戶管理自訂映像,並使用映像在相同訂用帳戶中建立數百個 VM。You can also manage your custom images in one storage account per Azure region, and use them to create hundreds of VMs in the same subscription. 如需受控磁碟的詳細資訊,請參閱 Azure 受控磁碟概觀For more information about Managed Disks, see the Managed Disks Overview.

Azure 虛擬機器和執行個體Azure Virtual Machines & Instances

Microsoft Azure 支援執行由多家合作夥伴提供和維護的眾多熱門 Linux 散發套件。Microsoft Azure supports running a number of popular Linux distributions provided and maintained by a number of partners. 您可以在 Azure Marketplace 中找到 Red Hat Enterprise、CentOS、SUSE Linux Enterprise、Debian、Ubuntu、CoreOS、RancherOS 及 FreeBSD 等散發套件。You can find distributions such as Red Hat Enterprise, CentOS, SUSE Linux Enterprise, Debian, Ubuntu, CoreOS, RancherOS, FreeBSD, and more in the Azure Marketplace. Microsoft 與各個 Linux 社群積極合作,以便為經 Azure 背書的 Linux 散發套件清單新增更多版本選項。Microsoft actively works with various Linux communities to add even more flavors to the Azure endorsed Linux Distros list.

如果您慣用的 Linux 散發套件選項目前未出現在映像庫中,您可以建立 Linux VHD 並上傳到 Azure來「自備 Linux」VM。If your preferred Linux distro of choice is not currently present in the gallery, you can "Bring your own Linux" VM by creating and uploading a Linux VHD in Azure.

Azure 虛擬機器可供您靈活部署各種運算方案。Azure virtual machines allow you to deploy a wide range of computing solutions in an agile way. 您可以在大部分的作業系統 (Windows、Linux,或來自持續增加合作夥伴的自訂建立作業系統),部署幾乎任何工作負載和任何語言。You can deploy virtually any workload and any language on nearly any operating system - Windows, Linux, or a custom created one from any one of the growing list of partners. 還是沒找到您在尋找的映像嗎?Still don't see what you are looking for? 別擔心,您也可以使用您在內部部署中擁有的映像。Don't worry - you can also bring your own images from on-premises.

VM 大小VM Sizes

您使用的 VM 大小是由所您要執行的工作負載所決定。The size of the VM that you use is determined by the workload that you want to run. 您所選的大小會決定例如處理電源、記憶體和儲存體容量等因素。The size that you choose then determines factors such as processing power, memory, and storage capacity. Azure 提供了各種不同的大小,以支援許多類型的用法。Azure offers a wide variety of sizes to support many types of uses.

Azure 可依據 VM 的大小和作業系統,以每小時價格方式收費。Azure charges an hourly price based on the VM’s size and operating system. 針對不足一小時的部分,Azure 只會收取已使用分鐘數的費用。For partial hours, Azure charges only for the minutes used. 儲存體是個別定價與收費。Storage is priced and charged separately.

自動化Automation

為了實現適當的 DevOps 文化特性,所有基礎結構都必須是程式碼。To achieve a proper DevOps culture, all infrastructure must be code. 當所有基礎結構都留存在程式碼中時,便可以輕鬆地重新建立基礎結構 (Phoenix 伺服器)。When all the infrastructure lives in code it can easily be recreated (Phoenix Servers). Azure 可以與所有主要的自動化工具 (例如 Ansible、Chef、SaltStack 及 Puppet) 搭配運作。Azure works with all the major automation tooling like Ansible, Chef, SaltStack, and Puppet. Azure 也有自己的自動化工具:Azure also has its own tooling for automation:

Azure 將針對支援 cloud-init 的大多數 Linux 散發套件推出 cloud-init 支援。Azure is rolling out support for cloud-init across most Linux Distros that support it. 目前 Canonical 的 Ubuntu VM 部署預設即已啟用 cloud-init。Currently Canonical's Ubuntu VMs are deployed with cloud-init enabled by default. Red Hats RHEL、CentOS 及 Fedora 支援 cloud-init,不過由 Red Hat 維護的 Azure 映像目前並未安裝 cloud-init。Red Hat's RHEL, CentOS, and Fedora support cloud-init, however the Azure images maintained by Red Hat do not currently have cloud-init installed. 若要在 Red Hat 系列 OS 上使用 cloud-init,您必須建立已安裝 cloud-init 的自訂映像。To use cloud-init on a Red Hat family OS, you must create a custom image with cloud-init installed.

配額Quotas

每個 Azure 訂用帳戶都有適當的預設配額限制,而此限制會在您要為專案部署大量 VM 時產生影響。Each Azure Subscription has default quota limits in place that could impact the deployment of a large number of VMs for your project. 每一訂用帳戶目前的限制是每一區域 20 個 VM。The current limit on a per subscription basis is 20 VMs per region. 只要提出支援票證來要求增加限制,即可快速且輕鬆地提高配額限制。Quota limits can be raised quickly and easily by filing a support ticket requesting a limit increase. 如需有關配額限制的詳細資料:For more details on quota limits:

合作夥伴Partners

Microsoft 與合作夥伴密切合作,以確保更新可用的映像並針對 Azure 執行階段進行最佳化。Microsoft works closely with partners to ensure the images available are updated and optimized for an Azure runtime. 如需 Azure 合作夥伴的詳細資訊,請參閱下列連結:For more information on Azure partners, see the following links:

在 Azure 上開始使用 LinuxGetting started with Linux on Azure

若要開始使用 Azure,您需要一個 Azure 帳戶、安裝 Azure CLI,以及一組 SSH 公開和私密金鑰。To begin using Azure, you need an Azure account, the Azure CLI installed, and a pair of SSH public and private keys.

註冊帳戶Sign up for an account

使用「Azure 雲端」的第一個步驟就是註冊 Azure 帳戶。The first step in using the Azure Cloud is to sign up for an Azure account. 請前往 Azure 帳戶註冊 頁面來開始註冊。Go to the Azure Account Signup page to get started.

安裝 CLIInstall the CLI

有了您的新 Azure 帳戶之後,您便可以立即開始使用 Azure 入口網站,這是一個 Web 型系統管理面板。With your new Azure account, you can get started immediately using the Azure portal, which is a web-based admin panel. 若要透過命令列管理 Azure 雲端,您需安裝 azure-cliTo manage the Azure Cloud via the command line, you install the azure-cli. 請在您的 Mac 或 Linux 工作站上安裝 Azure CLI Install the Azure CLI on your Mac or Linux workstation.

建立 SSH 金鑰組Create an SSH key pair

現在您已擁有 Azure 帳戶、Azure Web 入口網站及 Azure CLI。Now you have an Azure account, the Azure web portal, and the Azure CLI. 下一個步驟是建立 SSH 金鑰組,使用此金鑰組即可透過 SSH 連線到 Linux,而不需使用密碼。The next step is to create an SSH key pair that is used to SSH into Linux without using a password. 在 Linux 和 Mac 上建立 SSH 金鑰,以便啟用無密碼登入功能並提升安全性。Create SSH keys on Linux and Mac to enable password-less logins and better security.

使用 CLI 來建立 VMCreate a VM using the CLI

使用 CLI 來建立 Linux VM 是一個讓您不需離開正在工作的終端機即可快速部署 VM 的方法。Creating a Linux VM using the CLI is a quick way to deploy a VM without leaving the terminal you are working in. 所有您可以在 Web 入口網站上指定的項目,透過命令列旗標或參數也都可以指定。Everything you can specify on the web portal is available via a command-line flag or switch.

在入口網站中建立 VMCreate a VM in the portal

在 Azure Web 入口網站中建立 Linux VM 可讓您輕鬆點選各種選項來進行部署。Creating a Linux VM in the Azure web portal is a way to easily point and click through the various options to get to a deployment. 您將不使用命令列旗標或參數,而是會看到含有各種選項和設定的美觀 Web 版面配置。Instead of using command-line flags or switches, you are able to view a nice web layout of various options and settings. 所有您可以透過命令列介面使用的項目,在入口網站中也都可以使用。Everything available via the command-line interface is also available in the portal.

使用 SSH 登入而不提供密碼Log in using SSH without a password

VM 現在已在 Azure 上執行,而您已經可以登入。The VM is now running on Azure and you are ready to log in. 使用密碼透過 SSH 登入既不安全又費時。Using passwords to log in via SSH is insecure and time consuming. 使用 SSH 金鑰是最安全的登入方式,也是最省時的登入方式。Using SSH keys is the most secure way and also the quickest way to log in. 當您透過入口網站或 CLI 建立 Linux VM 時,有兩種驗證選擇。When you create you Linux VM via the portal or the CLI, you have two authentication choices. 如果您為 SSH 選擇了密碼,Azure 就會將 VM 設定成允許透過密碼登入。If you choose a password for SSH, Azure configures the VM to allow logins via passwords. 如果您選擇使用 SSH 公開金鑰,Azure 就會將 VM 設定成只允許透過 SSH 金鑰登入,並停用密碼登入。If you chose to use an SSH public key, Azure configures the VM to only allow logins via SSH keys and disables password logins. 若要藉由只允許使用 SSH 金鑰登入的方式來保護 Linux VM,請在透過入口網站或 CLI 建立 VM 時,使用 SSH 公用金鑰選項。To secure your Linux VM by only allowing SSH key logins, use the SSH public key option during the VM creation in the portal or CLI.

儲存體Storage

網路功能Networking

容器Containers

後續步驟Next steps

您現在已概略了解 Azure 上的 Linux。You now have an overview of Linux on Azure. 下一個步驟是深入了解並建立一些 VM!The next step is to dive in and create a few VMs!