Now let’s go and create a fileshare in Azure.
Let’s begin by grabbing the Storage key and setting the context.
#get the Storage key and set the context with the key
$storageaccountkeyvalue = (Get-AzStorageAccountKey
-ResourceGroupName $resourceGroup
-Name $skapastorageAccountName).Value[0]
$storageaccountctx = New-AzStorageContext
-StorageAccountName $storageAccountName
-StorageAccountKey $storageaccountkeyvalue
Next set a variable for the fileshare
#create the variable for the fileshare
$fileShareName = 'labfileshare'
Thanks to our Storage account key and our storage context we can now create a fileshare in Azure!
#create new fileshare
New-AzStorageShare
-Name $fileShareName
-Context $storageaccountctx
Done and Done! Next we will create a SAS to connect to the share..