0

Is this possible? So far I have not had much luck but I have limited Linux skills. I want to be able to map a persistent share so I can store Terraform state files that can be accessed by every person on my team. Using the PowerShell Shell, I can easily create a new psdrive to the share but you can't run Terraform from the PowerShell Shell.

phydeauxman
  • 1,432
  • 3
  • 26
  • 48

2 Answers2

1

Today, only Bash in Cloud Shell offers Terraform. When using Bash it persists the entire contents of your $Home directory using the file share you map when first using Cloud Shell.

There is a list of each shell's tooling here:

Bash

PowerShell

As for mapping a file share, you are actually required to do this when you first access cloud shell. Check out this documentation about it.

For trying out Terraform within Bash, check out this specific tutorial for using Terraform within Bash Cloud Shell.

jluk
  • 1,000
  • 7
  • 12
  • I am wanting to map that is accessible to each of my team members. Some place where we can store state files. – phydeauxman Jan 23 '18 at 01:19
  • You can set IAM permissions on the Azure storage account so your teammates can download the state files. You may consider version control like git (preinstalled in cloud shell) as well to handle multiple users updating a state file. – jluk Feb 02 '18 at 00:13
  • It is recommended to not store state files in git. As for IAM permissions...every team member needs to have read/write because if they run a template to change a deployment they will need to be able to write the updated state files. – phydeauxman Feb 03 '18 at 22:02
0

Maybe you can use this to share files to every person in my team.

First you should make sure every one cloud shell use the same storage account, every one will create a disk image of their $Home directory to persist all contents within the directory, like this:enter image description here

Then upload files to that file share, like this: enter image description here

Check files in cloud shell:
From user1:
enter image description here

From user2:
enter image description here

In this way, you can share files to all users in the same storage account.

Note:
About upload files to Azure file share via Azure portal, please refer to this article.

Upload files to this path:

enter image description here

Hope this helps.

Jason Ye
  • 13,710
  • 2
  • 16
  • 25
  • Just checking in to see if the information provided was helpful. Please let me know if you would like further assistance. – Jason Ye Jan 25 '18 at 01:51
  • Sorry for the delayed reply. So far...seems like a winner of a solution. I am going to do some additional testing and will let you know if something does not work. – phydeauxman Feb 03 '18 at 22:00
  • @jason-ye-msft having issues making this work. For the second team member (have not gone beyond the second member), on the first time into Cloud Shell, I selected the existing share create by the first user. It always fails to mount the file share and it creates a 0 byte .img file in the .cloudconsole folder for the user. This happens when there is no one else connected to the share and I have tried deleting the mount (and 0 byte file) and redoing the setup again. Behaves the same way each time. – phydeauxman Feb 04 '18 at 13:04
  • @phydeauxman Do you mean you can't mount an existing file share to Azure cloud shell? what's the error message? after you select the existing file share, it will create a .img fill, you can follow my steps to upload your files to azure file share. – Jason Ye Feb 04 '18 at 13:55
  • @jason-ye-msft, resolved the issue I was having...File Share was not created large enough to hold multiple profiles. – phydeauxman Feb 04 '18 at 17:43