Azure File Storage
Connecting to an Azure File Storage from your DevBox.
Architecture Diagram
Azure File Storage is a fully managed file share in the cloud that is accessible via the industry-standard Server Message Block (SMB) protocol, Network File System (NFS) protocol, and Azure Files REST API. Azure file shares can be mounted concurrently by cloud or on-premises deployments. SMB Azure file shares are accessible from Windows, Linux, and macOS clients.
This connection between the Azure File Share and your DevBox would occur by setting up a bastion host that advertises the private routes to your DevZero network so you can access the private service through network tunneling. You must also set up a DNS Private Resolver to access the File Storage's Private Endpoint from your DevBox.
Prerequisites
- Before you begin, follow the Connecting to Azure guide to set up the Bastion Host to access your private Azure services.
- Following the above criteria, follow the Setting up DNS Private Resolver guide to access the DNS Private Zones.
- After successfully setting up the DNS Private Resolver, follow the Configuring Storage Account guide to access the storage account endpoint.
Existing Azure File Storage
To connect to a Storage Account, ensure it is within the same Resource Group containing the Bastion Host.
Step 1: Creating a Recipe
First, we need to create a recipe for the workspace:
- Go to the DevZero Dashboard > Recipes and click on New recipe.
- Enter the recipe name and click on Create a recipe.
- Now use the below-provided snippet to create a recipe for your workspace:
- Click on Save and Build and when the build is successful, click on Publish.
Step 2: Creating a Workspace
- Go to the Devzero Dashboard > Workspaces and click on New workspace.
- Enter the workspace name and click on Select from recipe library.
- Select the recipe you just created and click on Select.
- Click on Launch, and your workspace will be ready shortly.
Step 3: Accessing the File Storage
Now follow the below steps to access the File Storage on your DevBox:
- Connect to DevBox and login into your Azure account using the
login
command:
- After you have completed your authentication, go to Home > Storage Accounts and select your storage account.
- Then go to the Security + Networking > Access Keys section and note down either of the two access keys presented to you.
- After you have acquired the access key, you may use the following command to Upload, Download, or list the files in the file share:
To Upload a file to the file share, use the following command:
Here, the --source
tag refers to the File you want to upload, and the --path
tag specifies where you want to upload the File, specifying a directory and output file name.
New File Storage
If you need to make a new File Storage and access it through DevBox, then follow the below steps:
Step 1: Creating a File Storage
Firstly, you must follow the Configuring Storage Account guide to create and configure a new storage account. After the setup, you must also set up the DNS Private Resolver by following the Setting up DNS Private Resolver guide.
After the steps mentioned earlier are completed, you may go ahead and create a file share for File Storage by following these steps:
- Go to Home > Storage Accounts and click on your storage account.
- Go to the Data Storage tab and click on File Shares.
- Create a new File Share by entering the file share name and clicking on Create.
- After creating the file share, go to the Security + Networking > Access Keys section and note down either access key.
Step 2: Creating a Recipe
First, we need to create a recipe for the workspace:
- Go to the DevZero Dashboard > Recipes and click on New recipe.
- Enter the recipe name and click on Create a recipe.
- Now use the below-provided snippet to create a recipe for your workspace:
- Click on Save and Build and when the build is successful, click on Publish.
Step 3: Creating a Workspace
- Go to the Devzero Dashboard > Workspaces and click on New workspace.
- Enter the workspace name and click on Select from recipe library.
- Select the recipe you just created and click on Select.
- Click on Launch, and your workspace will be ready shortly.
Step 4: Accessing the File Storage
After creating the File Share, you must install and authenticate your Azure CLI to easily access File Storage. To do so, you may follow the below steps:
- Connect to your DevBox and login into your Azure account using the
login
command:
- Use the following command to create a directory in the File Share:
- You may use the following command to Upload, Download, or list the File in the File Share:
To Upload a file to the file share, use the following command:
Here, the --source
tag refers to the file you want to upload, and the --path
tag refers to where you want to upload the file by specifying a Filectory and output file name.