<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>The Ops Community ⚙️: Uday Yadav</title>
    <description>The latest articles on The Ops Community ⚙️ by Uday Yadav (@dev117uday).</description>
    <link>https://community.ops.io/dev117uday</link>
    <image>
      <url>https://community.ops.io/images/VQ0AR6NiZk9IW4XrBUBg12L0RaBT9FrjO3oR-6sKucI/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL3Vz/ZXIvcHJvZmlsZV9p/bWFnZS84OC9mMjI0/YzRmZC04NzAwLTRj/ZWUtYjc3NS03ODZm/MGFiM2M3YjIuanBl/Zw</url>
      <title>The Ops Community ⚙️: Uday Yadav</title>
      <link>https://community.ops.io/dev117uday</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://community.ops.io/feed/dev117uday"/>
    <language>en</language>
    <item>
      <title>Auto Mount Azure Storage in Windows VM Automatically</title>
      <dc:creator>Uday Yadav</dc:creator>
      <pubDate>Thu, 26 May 2022 14:30:28 +0000</pubDate>
      <link>https://community.ops.io/dev117uday/auto-mount-azure-storage-in-windows-vm-automatically-3lig</link>
      <guid>https://community.ops.io/dev117uday/auto-mount-azure-storage-in-windows-vm-automatically-3lig</guid>
      <description>&lt;p&gt;Using a external hard drive, where it it super easy to plug it in start working from where you left off isn't the kind of storage strategy one would think off when creating a VM on cloud.&lt;/p&gt;

&lt;p&gt;But using it with VM and data you often need can be super useful and time-saver. Here are the steps to get started : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a FileShare&lt;/li&gt;
&lt;li&gt;Create FileShare connection script be auto-run at the start of the virtual machine instance and the FileShare be mounted using the same drive letter in VMs. 

&lt;ul&gt;
&lt;li&gt;Create the file named &lt;code&gt;script.ps1&lt;/code&gt; in the following folder location
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;C:\Users\&lt;/span&gt;&lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;USER&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;\AppData\Roaming\Microsoft\Windows\Start&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Menu\Programs\Startup&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With its content as the connection script provided by azure for mounting FileShare, go to the Azure file storage account &lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/EaIjie9AWIU1LpfgZHhSB1ouGC4BBa2ddmCUqkO0lV4/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzB6cHht/OXphNm1pYzhkcGRk/NGllLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/EaIjie9AWIU1LpfgZHhSB1ouGC4BBa2ddmCUqkO0lV4/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzB6cHht/OXphNm1pYzhkcGRk/NGllLnBuZw" alt="FileShare Connect Image" width="880" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Also select the Drive Symbol&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/in8eIIO97uMPaMYtpN-BL9E2KIJX68ZZ-4J87yFGa0I/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL2tnbnlq/Y3A0ajNvNGFjajlw/eGk1LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/in8eIIO97uMPaMYtpN-BL9E2KIJX68ZZ-4J87yFGa0I/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL2tnbnlq/Y3A0ajNvNGFjajlw/eGk1LnBuZw" alt="Script" width="880" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Copy the script provided by azure into the &lt;code&gt;script.ps1&lt;/code&gt; file and save it !&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the Same folder create a file startup.bat with the following code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="n"&gt;ECHO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;OFF&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;Powershell.exe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-executionpolicy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;bypass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-File&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;\script.ps1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And Done ! On every VM or Windows Machine Restart your Storage Account will be Mounted as &lt;code&gt;Z:&lt;/code&gt; drive in your OS  as the Shell Script will be Auto Executed in Windows&lt;/p&gt;

</description>
      <category>tutorials</category>
      <category>azure</category>
      <category>cloudops</category>
    </item>
  </channel>
</rss>
