In this video learn how to create an Azure file share using the portal and PowerShell.
- [Instructor] When Exam 70-533 was first released, Azure file shares did not exist. For the upgrade exam, you will need to know how to create an Azure file share. And that is exactly what we're going to do in this lesson. We're gonna create a file share via the portal, and then once again, using PowerShell. I have already created an upgrade account called azureupgrade. To create the file share, simply select Files, and then add File share. You'll need to provide a name for your file share and set the quota.
And as of this recording, in the summer of 2018, the maximum quota is five terabytes. I'm gonna set my quota to one gigabyte. Click OK. It'll only take a moment for your share to be created, and at this point, once your share is created, you can go ahead, you can connect to that share. And when we select connect, we will have options here on how to connect from Windows. We can mount this share on our local systems if we wish, or you can connect using PowerShell commands.
If you scroll down a little bit, you'll notice that we do have the instructions to connect from Linux as well. We can go ahead and upload files directly to the share by selecting Upload. You can go ahead and select the file. And then Upload. We can add additional directories to the share.
We now have an hr directory. And within this directory, we can go ahead and upload to that or add another directory if we wish. We'll go back to our main share. We can delete the share, view the properties, edit the quota, and take a snapshot of the share. And that's all there is to creating an Azure file share within the portal. Now let's do the same thing using PowerShell. But before we jump into the integrated scripting environment, we will need the access key for the storage account.
You will find Access keys under Settings of the storage account. You can go ahead and copy key1. You'll also need to note the name of your storage account. You'll need that for your script as well. I've already logged into Azure through our environment. The first thing we need to do to create a file share is to create a variable called StorageContext. This variable will hold the new storage context which is basically just a container that has a storage account name as well as the access key, and that's why we needed the access key.
I'm gonna go ahead and paste in the access key. And I need to enter in the storage account. I'm gonna go ahead and run this line. The next line is actually to create the share itself, and we do so using New-AzureStorageShare. Provide the name for your share.
I'm gonna call it data2. And now we need to provide the context which again is the combination of the storage account name and the access key. And we're doing that through that variable StorageContext. I'm gonna go ahead and run that line. We can see that the share was created. If we wanna view all the shares in this storage account, we use the command Get-AzureStorageShare, again providing the context.
And you can see we have the data share that we created via the portal. And we have data2 which we created using PowerShell. And that's it for creating file shares in Azure.
- Managing Azure subscriptions and resources
- Implementing and managing storage
- Configuring and managing virtual networks
- Managing identities
- Evaluating and performing server migration to Azure
- Implementing and managing application services
- Implementing advanced virtual networking
- Securing identities