doc_noob
doc_noob

Reputation: 625

Get Mount script from Azure file share - Terraform

For every new fileshare that we create in Azure Storage account we get a connect option enter image description here,

if we click connect we get the below options,

enter image description here

is it possible to get that piece of code to mount this fileshare through terraform? I could not find it anywhere. Any help on this would be appreciated

Upvotes: 1

Views: 1979

Answers (1)

Charles Xu
Charles Xu

Reputation: 31424

Of course, it's possible. You just need to copy the code into a script and then use the VM extension to execute inside the VM. It's not complex at all. Here is an example.

But there is one thing you need to pay attention to, the VM extension only supports the non-interactive script. For example, the connect code for the Linux, the command sudo is an interactive command, so it's not recommended to use in the VM extension. You can get more details about the VM extension here.

Upvotes: 2

Related Questions