- Hands-On Kubernetes on Windows
- Piotr Tylenda
- 305字
- 2021-06-24 16:54:02
Creating Azure Files SMB share
Assuming that you are following along with these examples on a fresh Azure subscription, let's create an Azure Resource Group and Azure Storage Account first:
- In a PowerShell window, execute the following code:
az group create `
--name docker-storage-resource-group `
--location westeurope
You can choose a location that is the most suitable for you (in order to show a list of available locations, run az account list-locations). In this example, we are using the westeurope Azure location.
- After the successful creation of an Azure Resource Group, continue by creating an Azure Storage Account:
az storage account create `
--name dockerstorageaccount `
--resource-group docker-storage-resource-group `
--location westeurope `
--sku Standard_RAGRS `
--kind StorageV2
The preceding command will create a general-purpose v2 storage account with read-access geo-redundant storage called dockerstorageaccount in docker-storage-resource-group. This operation can take up to a few minutes to complete.
- Next, you have to create the actual Azure Files SMB share. First, create a connection string for your Azure Storage Account and store it as a variable in PowerShell:
$azureStorageAccountConnString = az storage account show-connection-string `
--name dockerstorageaccount `
--resource-group docker-storage-resource-group `
--query "connectionString" `
--output tsv
if (!$azureStorageAccountConnString) {
Write-Error "Couldn't retrieve the connection string."
}
Remember to keep the connection string safe as it can be used to manage your storage account!
- Using the connection string stored in the $azureStorageAccountConnString variable, create the share:
az storage share create `
--name docker-bind-mount-share `
--quota 2 `
--connection-string $azureStorageAccountConnString
This will create a share called docker-bind-mount-share with a quota limit of 2 GB, which we will now use in our Docker container.
- ASP.NET Web API:Build RESTful web applications and services on the .NET framework
- Spring 5.0 Microservices(Second Edition)
- Node.js 10實戰(zhàn)
- Learning Selenium Testing Tools with Python
- Python網(wǎng)絡(luò)爬蟲從入門到實踐(第2版)
- INSTANT CakePHP Starter
- 假如C語言是我發(fā)明的:講給孩子聽的大師編程課
- Mastering KnockoutJS
- ASP.NET程序設(shè)計教程
- Working with Odoo
- 前端HTML+CSS修煉之道(視頻同步+直播)
- 區(qū)塊鏈技術(shù)與應用
- OpenMP核心技術(shù)指南
- 網(wǎng)絡(luò)數(shù)據(jù)采集技術(shù):Java網(wǎng)絡(luò)爬蟲實戰(zhàn)
- ASP.NET 4.0 Web程序設(shè)計