<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>template Archives - Apostolidis Cloud Corner</title>
	<atom:link href="https://www.cloudcorner.gr/tag/template/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.cloudcorner.gr/tag/template/</link>
	<description>Remarks from a Cloud Architect encounters</description>
	<lastBuildDate>Tue, 24 Oct 2023 08:44:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://www.cloudcorner.gr/wp-content/uploads/2021/04/cropped-cloudcorner2-32x32.png</url>
	<title>template Archives - Apostolidis Cloud Corner</title>
	<link>https://www.cloudcorner.gr/tag/template/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Infrastructure as Code &#124; Deploy a VNET &#038; NSG &#038; UDR</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Wed, 11 Mar 2020 22:45:35 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[IaC]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure template]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[iac]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[network security group]]></category>
		<category><![CDATA[nsg]]></category>
		<category><![CDATA[route table]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[udr]]></category>
		<category><![CDATA[virtual network]]></category>
		<category><![CDATA[vnet]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=3297</guid>

					<description><![CDATA[<p>Infrastructure as Code &#124; Deploy a VNET with NSG and UDRs Infrastructure as Code, or just IaC, provides three three</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/">Infrastructure as Code | Deploy a VNET &#038; NSG &#038; UDR</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Infrastructure as Code | Deploy a VNET with NSG and UDRs</h2>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-3312" src="https://www.e-apostolidis.gr/wp-content/uploads/2020/03/IaC.png" alt="IaC" width="1095" height="838" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC.png 1095w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC-300x230.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC-1024x784.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC-768x588.png 768w" sizes="(max-width: 1095px) 100vw, 1095px" /></p>
<p>Infrastructure as Code, or just IaC, provides three three main advantages: cost reduction, faster execution and risk reduction, the attributes of the DevOps culture.</p>
<p style="text-align: justify;">Microsoft Azure Resource Manager allows the managing and provisioning of Azure Resources, that can be Virtual Machines, Virtual Networks, Storage Accounts, Apps, SQL Databases and everything that a computer data center includes, through machine-readable definition files, known as JSON templates, without the need of physical hardware configuration or interactive configuration tools.</p>
<p style="text-align: justify;">I am starting a series of posts about building infrastructure with JSON templates.</p>
<p style="text-align: justify;">The tool I use to build my Azure Json templates is the Visual Studio Code. You can download it from <a href="https://code.visualstudio.com/">https://code.visualstudio.com/</a> for every platform.</p>
<p style="text-align: justify;">To work with Azure Resource Manager you need the Azure Resource Manager Tools extension. Open the VS Code, go to the Extensions Section, search and install the Azure Resource Manager Tools extension.</p>
<p id="SEhVTIV"><img decoding="async" class="alignnone wp-image-3306 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2020/03/img_5e695dd565ae7.png" alt="infrastructure as code" width="488" height="353" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/03/img_5e695dd565ae7.png 488w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/img_5e695dd565ae7-300x217.png 300w" sizes="(max-width: 488px) 100vw, 488px" /></p>
<p>The extension is very helpful since it highlights the code, it provides references and intellisense.</p>
<p>At this post I am sharing &amp; explaining my Azure json template for deploying a Virtual Network, a Network Security Group and a Route Table.</p>
<p>You can find and download my working template at <a href="https://github.com/proximagr" target="_blank" rel="noopener noreferrer">my Git account</a> :</p>
<p><a href="https://github.com/proximagr/ARMTemplates/tree/master/VNET-2sub-NSG-UDR" target="_blank" rel="noopener noreferrer">https://github.com/proximagr/ARMTemplates/tree/master/VNET-2sub-NSG-UDR</a></p>
<h3>Json Template Guide</h3>
<p>Below you can find my template with comments, for better understanding.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="json" data-enlighter-theme="droide">{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
//** Define the Virtual Network Name */
    "vnetName": {
      "type": "string",
      "defaultValue": "Cloud-Corner-VNET",
      "metadata": {
        "description": "Cloud Corner VNET"
      }
//** Define the Address Space of the Virtual Network */
    },
      "vnetAddressPrefix": {
        "type": "string",
        "defaultValue": "10.0.0.0/24",
        "metadata": {
          "description": "Address prefix"
        }
//** Define the Address Space of the the First Subnet */
      },
      "subnet1Prefix": {
        "type": "string",
        "defaultValue": "10.0.0.0/27",
        "metadata": {
          "description": "Subnet 1 Prefix"
        }
//** Define the Name of the the First Subnet */
      },
      "subnet1Name": {
        "type": "string",
        "defaultValue": "Subnet1",
        "metadata": {
          "description": "Subnet 1 Name"
        }
//** Define the Address Space of the the Second Subnet */
      },
      "subnet2Prefix": {
        "type": "string",
        "defaultValue": "10.0.0.32/27",
        "metadata": {
          "description": "Subnet 2 Prefix"
        }
//** Define the Name of the the First Subnet */
      },
      "subnet2Name": {
        "type": "string",
        "defaultValue": "Subnet2",
        "metadata": {
          "description": "Subnet 2 Name"
        }
      },
//** Define the Name of the the Network Security Group */
      "networkSecurityGroup01Name": {
        "type": "string",
        "defaultValue": "Cloud-Corner-NSG-01",
        "metadata": {
          "description": "This is the name of the network security group"
        }
      },
//** Define the Name of the the First Route Table */
      "RouteTable01Name": {
        "type": "string",
        "defaultValue": "Cloud-Corner-UDR-01",
        "metadata": {
        "description": "Route Table 01 Name."
        }
      },
//** Define the Name of the the First Route of the First Route Table */
      "Route01Name": {
        "type": "string",
        "defaultValue": "To-internet",
        "metadata": {
          "description": "Route 01 Name."
        }
      },
//** Define the Next Hop Type of the the First Route of the First Route Table */
      "Route01NextHopType": {
        "type": "string",
        "allowedValues": [
        "VirtualNetworkGateway",
        "VnetLocal",
        "Internet",
        "VirtualAppliance",
        "None"
      ],
      "defaultValue": "VirtualAppliance",
        "metadata": {
          "description": "Route 01 Next Hop Type."
        }
      },
//** Define the Address Prefix of the First Route of the First Route Table */
      "Route01AddressPrefix": {
        "type": "string",
        "defaultValue": "0.0.0.0/0",
        "metadata": {
          "description": "Route 01 Address Prefix."
        }
      },
//** If you set "Virtyal Appliance for Next Hop Type, then you need to define the Next Hop IP Address, */
//** meaning the appliance's IP address. Here you define it for the First Route of the First Route Table */
        "RT01Route01NextHopIPAddress": {
        "type": "string",
        "defaultValue": "10.0.0.40",
        "metadata": {
          "description": "Next Hop IP Addess."
        }
      },
//** Define the Name of the Second Route Table */
      "RouteTable02Name": {
        "type": "string",
        "defaultValue": "Cloud-Corner-UDR-02",
        "metadata": {
          "description": "Route Table 02 Name."
        }
      },
//** Define the Name of the the First Route of the Second Route Table */
      "RT02Route01Name": {
        "type": "string",
        "defaultValue": "Local-Subnet",
        "metadata": {
        "description": "Route Table 02 Route 01 Name."
        }
      },
//** Define the Next Hop Type of the the First Route of the Second Route Table */
      "RT02Route01NextHopType": {
        "type": "string",
        "allowedValues": [
        "VirtualNetworkGateway",
        "VnetLocal",
        "Internet",
        "VirtualAppliance",
        "None"
      ],
      "defaultValue": "VnetLocal",
        "metadata": {
          "description": "Route 02 Next Hop Type."
        }
      },
//** Define the Address Prefix of the the First Route of the Second Route Table */
      "RT02Route01AddressPrefix": {
        "type": "string",
        "defaultValue": "10.0.0.0/27",
        "metadata": {
          "description": "Route Table 02 Route 01 Address Prefix."
        }
      },
//** Define the Name of the the Second Route of the Second Route Table */
        "RT02Route02Name": {
          "type": "string",
          "defaultValue": "To-subnet-1",
          "metadata": {
            "description": "Route Table 02 Route 01 Name."
          }
        },
//** Define the Next Hop Type of the the Second Route of the Second Route Table */
        "RT02Route02NextHopType": {
          "type": "string",
          "allowedValues": [
          "VirtualNetworkGateway",
          "VnetLocal",
          "Internet",
          "VirtualAppliance",
          "None"
        ],
        "defaultValue": "VirtualAppliance",
          "metadata": {
            "description": "Route 02 Next Hop Type."
          }
        },
//** Define the address prefix of the the Second Route of the Second Route Table */
        "RT02Route02AddressPrefix": {
          "type": "string",
          "defaultValue": "10.0.0.32/27",
          "metadata": {
            "description": "Route Table 02 Route 01 Address Prefix."
          }
      },
//** Define the next hop IP address (the virtual appliance's address) of the the Second Route of the Second Route Table */
        "RT02Route02NextHopIPAddress": {
          "type": "string",
          "defaultValue": "10.0.0.40",
          "metadata": {
            "description": "Next Hop IP Addess."
          }
        }
    },
//** I dont use any variables, you can exclude this section*/
  "variables": {},
  "resources": [
//* create the First Route Table &amp; Route*/
    {
    "apiVersion": "2017-10-01",
    "type": "Microsoft.Network/routeTables",
    "name": "[parameters('RouteTable01Name')]",
    "location": "[resourceGroup().location]",
    "properties": {
    "disableBgpRoutePropagation": true,
    "routes": [
      {
        "name": "[parameters('Route01Name')]",
        "properties": {
          "addressPrefix": "[parameters('Route01AddressPrefix')]",
          "nextHopType": "[parameters('Route01NextHopType')]",
          "nextHopIpAddress": "[parameters('RT01Route01NextHopIPAddress')]"
          }
        }
      ]
    }
  },
//* create the Second Route Table &amp; Routes*/
    {
    "apiVersion": "2017-10-01",
    "type": "Microsoft.Network/routeTables",
    "name": "[parameters('RouteTable02Name')]",
    "location": "[resourceGroup().location]",
    "properties": {
    "disableBgpRoutePropagation": true,
    "routes": [
      {
        "name": "[parameters('RT02Route01Name')]",
        "properties": {
          "addressPrefix": "[parameters('RT02Route01AddressPrefix')]",
          "nextHopType": "[parameters('RT02Route01NextHopType')]"
        }
      },
          {
        "name": "[parameters('RT02Route02Name')]",
        "properties": {
          "addressPrefix": "[parameters('RT02Route02AddressPrefix')]",
          "nextHopType": "[parameters('RT02Route02NextHopType')]",
          "nextHopIpAddress": "[parameters('RT02Route02NextHopIPAddress')]"
          }
        }
      ]
    }
  },
//* create teh Network Security Group */
    {
    "apiVersion": "2019-02-01",
    "type": "Microsoft.Network/networkSecurityGroups",
    "name": "[parameters('networkSecurityGroup01Name')]",
    "location": "[resourceGroup().location]",
    "properties": {
      "securityRules": [
        {
          "name": "HTTPS",
          "properties": {
            "description": "Open HTTPS to Public",
            "protocol": "Tcp",
            "sourcePortRange": "443",
            "destinationPortRange": "443",
            "sourceAddressPrefix": "*",
            "destinationAddressPrefix": "*",
            "access": "Allow",
            "priority": 101,
            "direction": "Inbound"
            }
          }
        ]
      }
    },
//* create the Virtual Network */
    {
      "apiVersion": "2018-10-01",
      "type": "Microsoft.Network/virtualNetworks",
      "name": "[parameters('vnetName')]",
      "location": "[resourceGroup().location]",
//*add a dependency in order to ensure that the NSG is created before the VNET, in order to be able to attach it*/
      "dependsOn": [
        "[parameters('networkSecurityGroup01Name')]"
      ],
      "properties": {
        "AddressSpace": {
          "AddressPrefixes": [
            "[parameters('vnetAddressPrefix')]"
          ]
        }
      },
      "resources": [
//* create the first subnet */
        {
        "apiVersion": "2018-10-01",
        "type": "subnets",
        "location": "[resourceGroup().location]",
        "name": "[parameters('subnet1Name')]",
//* add dependencies to create the resources with an order, because you need to ensure that the VNET is ready before creating the Subnet and also the Route Table*/
        "dependsOn": [
          "[parameters('vnetName')]",
          "[resourceId('Microsoft.Network/routeTables', parameters('RouteTable01Name'))]"
        ],
        "properties": {
        "AddressPrefix": "[parameters('subnet1Prefix')]",
//*attach the Newtork Securoty Group to the Subnet*/
        "networkSecurityGroup": {
        "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroup01Name'))]"},
//*attacht the First route table to the Subnet*/
        "routeTable": {
        "id": "[resourceId('Microsoft.Network/routeTables', parameters('RouteTable01Name'))]"
          }
         }
        },
//*create the second subnet*/
        {
        "apiVersion": "2018-10-01",
        "type": "subnets",
        "location": "[resourceGroup().location]",
        "name": "[parameters('subnet2Name')]",
        "dependsOn": [
          "[parameters('vnetName')]",
          "[parameters('subnet1Name')]",
          "[parameters('RouteTable02Name')]"
        ],
        "properties": {
          "AddressPrefix": "[parameters('subnet2Prefix')]",
//*attach the Newtork Securoty Group to the Subnet*/
          "networkSecurityGroup": {
          "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroup01Name'))]"},
//*attacht the second route table to the Subnet*/
          "routeTable": {
          "id": "[resourceId('Microsoft.Network/routeTables', parameters('RouteTable02Name'))]"
            }
          }
        }
      ]
    }
  ]
}</pre>
<p>&nbsp;</p>
<h3>Deploy the template</h3>
<p><strong>Deploy the template directly from here:</strong></p>
<p><a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fproximagr%2FARMTemplates%2Fmaster%2FVNET-2sub-NSG-UDR%2Fazuredeploy.json" target="_blank" rel="noopener noreferrer"> <img decoding="async" src="https://aka.ms/deploytoazurebutton" /> </a></p>
<p>&nbsp;</p>
<p>More Azure Resource Manager Templates: <a href="https://www.e-apostolidis.gr/microsoft/create-azure-file-shares-using-arm-template-powershell/">https://www.e-apostolidis.gr/microsoft/azure/create-azure-file-shares-using-arm-template-powershell/</a></p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author"><div class="saboxplugin-tab"><div class="saboxplugin-gravatar"><img decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div><div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div><div class="saboxplugin-desc"><div itemprop="description"><p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div></div><div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div><div class="clearfix"></div><div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:pr&#111;&#120;&#105;m&#097;&#103;r&#064;&#104;&#111;t&#109;&#097;il.&#099;o&#109;" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div></div></div><p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Finfrastructure-as-code-deploy-a-vnet-nsg-udr%2F&amp;linkname=Infrastructure%20as%20Code%20%7C%20Deploy%20a%20VNET%20%26%20NSG%20%26%20UDR" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Finfrastructure-as-code-deploy-a-vnet-nsg-udr%2F&amp;linkname=Infrastructure%20as%20Code%20%7C%20Deploy%20a%20VNET%20%26%20NSG%20%26%20UDR" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Finfrastructure-as-code-deploy-a-vnet-nsg-udr%2F&#038;title=Infrastructure%20as%20Code%20%7C%20Deploy%20a%20VNET%20%26%20NSG%20%26%20UDR" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/" data-a2a-title="Infrastructure as Code | Deploy a VNET &amp; NSG &amp; UDR"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/">Infrastructure as Code | Deploy a VNET &#038; NSG &#038; UDR</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Create Azure File Shares at your ARM template using PowerShell</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/create-azure-file-shares-using-arm-template-powershell/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/create-azure-file-shares-using-arm-template-powershell/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Thu, 28 Sep 2017 13:51:43 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[IaC]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure file storage]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[template]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=1499</guid>

					<description><![CDATA[<p>Create Azure File Shares at your ARM template using PowerShell Using Azure Resource Manage template deployment, you can create a</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/create-azure-file-shares-using-arm-template-powershell/">Create Azure File Shares at your ARM template using PowerShell</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Create Azure File Shares at your ARM template using PowerShell</h2>
<p style="text-align: justify;">Using Azure Resource Manage template deployment, you can create a Storage account but you cannot create File Shares. Azure File Shares can be created using the Azure Portal, the Azure PowerShell or the Azure Cli.</p>
<p style="text-align: justify;">Mainly, the idea is to run a PowerShell script that will create the File Shares. This script will be invoked inside the ARM Template. In order to use a PowerShell script from a template, the script must be called from a URL. A good way to provide this is using the Git repository.  One major thing to consider is the Storage Account key must be provided to the PowerShell script securely, since the PowerShell script is at a public URL.</p>
<p style="text-align: justify;">The PowerShell script will run inside a Virtual Machine and we will use a CustomScriptExtension Extension to provide it. To use this, at the Virtual Machine Resource of the JSON file add a resources section.</p>
<p style="text-align: justify;">The Custom Script Exception is located at the Virtual Machine resource. Lets assume that the last part of the Virtual Machine resource is the &#8220;diagnosticsProfile&#8221; so after the closure of the &#8220;diagnosticsProfile&#8221; we can add the &#8220;resources&#8221;. Inside the &#8220;resources&#8221; add the &#8220;extensions&#8221; resource that will add the &#8220;CustomScriptExtension&#8221;, like below.</p>
<h3>The Template Part</h3>
<p>This will be the addition at the Virtual Machine resource:</p>
<pre class="theme:vs2012 lang:asp decode:true"> "diagnosticsProfile": {
          "bootDiagnostics": {
            "enabled": true,
            "storageUri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('diagnosticStorageAccountName')), '2016-01-01').primaryEndpoints.blob)]"
          }
        }
        },
        "resources": [
          {
            "name": "AzureFileShares",
            "type": "extensions",
            "location": "[variables('location')]",
            "apiVersion": "2016-03-30",
            "dependsOn": [
              "[resourceId('Microsoft.Compute/virtualMachines', parameters('VMName'))]",
              "[variables('AzureFilesStorageId')]"
            ],
            "tags": {
              "displayName": "AzureFileShares"
            },
            "properties": {
              "publisher": "Microsoft.Compute",
              "type": "CustomScriptExtension",
              "typeHandlerVersion": "1.4",
              "autoUpgradeMinorVersion": true,
              "settings": {
                "fileUris": [
                  "https://raw.githubusercontent.com/######/#####/master/azurefiles.ps1"
                ]
              },
              "protectedSettings": {
               "commandToExecute": "[concat('powershell -ExecutionPolicy Unrestricted -File ','azurefiles.ps1 -SAName ',parameters('AzureFilesStorageName'),'  -SAKey ', listKeys(resourceId(variables('AzureFilesStorageAccountResourceGroup'),'Microsoft.Storage/storageAccounts', parameters('AzureFilesStorageName')), '2015-06-15').key1)]" 
             }
            }
          }
        ]
    },</pre>
<p style="text-align: justify;">The extension must be depended from the Virtual Machine that will run the script and the Storage Account that will bu used for the file shares.</p>
<p style="text-align: justify;">At the custom script properties add the public RAW url of the PowerShell script.</p>
<p style="text-align: justify;">Next lets see the Storage Account key and execution part. At the connandToExecute section, we will provide a variable that will pass the Storage Account key &amp; Name inside the script for execution. The variable will get the Storage Account key from the Storage Account using the permissions of the Account  running the Template Deployment.</p>
<p style="text-align: justify;">Of course to make the template more flexible I have added a variable for the Resource Group and a parameter for the AzureFilesStorageName, so the template will ask for the Storage Account name at the parameters.</p>
<h3>The PowerShell</h3>
<p>The PowerShell script is tested at Windows Server 2016 VM. You can find it below:</p>
<pre class="lang:ps decode:true ">Param (
  [Parameter()]
  [String]$SAKey,
  [String]$SAName
)
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module Azure -Confirm:$False
Import-Module Azure
$storageContext = New-AzureStorageContext -StorageAccountName $SAName -StorageAccountKey $SourceSAKey
$storageContext |  New-AzureStorageShare -Name #####</pre>
<p>&nbsp;</p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author"><div class="saboxplugin-tab"><div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div><div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div><div class="saboxplugin-desc"><div itemprop="description"><p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div></div><div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div><div class="clearfix"></div><div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:&#112;&#114;&#111;xi&#109;agr&#064;ho&#116;ma&#105;l.&#099;&#111;m" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div></div></div><p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fcreate-azure-file-shares-using-arm-template-powershell%2F&amp;linkname=Create%20Azure%20File%20Shares%20at%20your%20ARM%20template%20using%20PowerShell" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fcreate-azure-file-shares-using-arm-template-powershell%2F&amp;linkname=Create%20Azure%20File%20Shares%20at%20your%20ARM%20template%20using%20PowerShell" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fcreate-azure-file-shares-using-arm-template-powershell%2F&#038;title=Create%20Azure%20File%20Shares%20at%20your%20ARM%20template%20using%20PowerShell" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/create-azure-file-shares-using-arm-template-powershell/" data-a2a-title="Create Azure File Shares at your ARM template using PowerShell"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/create-azure-file-shares-using-arm-template-powershell/">Create Azure File Shares at your ARM template using PowerShell</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/create-azure-file-shares-using-arm-template-powershell/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure VM Image</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Tue, 04 Jul 2017 20:14:35 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure vm]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[template]]></category>
		<guid isPermaLink="false">http://www.e-apostolidis.gr/?p=1351</guid>

					<description><![CDATA[<p>Azure VM Image Following one of my earlier posts, about Azure Managed Disks, lets see how easy it is to</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/">Azure VM Image</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Azure VM Image</h1>
<p>Following one of my earlier posts, about <a href="http://www.e-apostolidis.gr/microsoft/azure-managed-disks-easy-scale-high-available-secure/">Azure Managed Disks</a>, lets see how easy it is to create an Azure VM Image from an Azure VM that uses Managed Disks.</p>
<p>The first step it to Sysprep/Generalize the source VM. Otherwise the VM that will be created will not start. Select Generalize and &#8220;Shutdown&#8221;.</p>
<p id="NGgbPeD"><img loading="lazy" decoding="async" width="493" height="342" class="alignnone size-full wp-image-1353 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf1eca1f3d.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf1eca1f3d.png 493w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf1eca1f3d-300x208.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf1eca1f3d-200x140.png 200w" sizes="auto, (max-width: 493px) 100vw, 493px" /></p>
<p>After that wait the VM to shut down and go to the Azure Porta, at the VM&#8217;s blade and click &#8220;Capture&#8221;.</p>
<p id="zNVgTmu"><img loading="lazy" decoding="async" width="660" height="163" class="alignnone size-full wp-image-1354 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf26118089.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf26118089.png 660w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf26118089-300x74.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf26118089-600x148.png 600w" sizes="auto, (max-width: 660px) 100vw, 660px" /></p>
<p>Now, the &#8220;Create Image&#8221; blade will open. Enter a name, select a Resource Group and choose if the source VM will be deleted or not. Then press create.</p>
<p id="gdDzIgl"><img loading="lazy" decoding="async" width="587" height="390" class="alignnone size-full wp-image-1355 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf2b81f6a3.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf2b81f6a3.png 587w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf2b81f6a3-300x199.png 300w" sizes="auto, (max-width: 587px) 100vw, 587px" /></p>
<p>As soon as the Image is created you can find it at the &#8220;Images&#8221; service.</p>
<p id="dVIPYfu"><img loading="lazy" decoding="async" width="565" height="267" class="alignnone size-full wp-image-1357 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf39e42068.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf39e42068.png 565w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf39e42068-300x142.png 300w" sizes="auto, (max-width: 565px) 100vw, 565px" /></p>
<p>Now lets create a VM from our Image</p>
<p>Click the image name from the Images Blade to open the desired image Blade and just press &#8220;Create VM&#8221;.</p>
<p>Of course at the image&#8217;s blade we can see if the image is Windows or Linux, if it has any Data Disks and the Location.</p>
<p id="eMjrDKP"><img loading="lazy" decoding="async" width="745" height="475" class="alignnone size-full wp-image-1359 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf410aa138.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf410aa138.png 745w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf410aa138-300x191.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf410aa138-600x383.png 600w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf410aa138-660x421.png 660w" sizes="auto, (max-width: 745px) 100vw, 745px" /></p>
<p>After clicking the &#8220;Create VM&#8221; the classic &#8220;Create virtual machine&#8221; wizard will start, just like any other Virtual Machine creation. You will notice the difference at the final step that shows the name of your image instead of the VM&#8217;s OS.</p>
<p id="pTbcWIm"><img loading="lazy" decoding="async" width="613" height="529" class="alignnone size-full wp-image-1360 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf48419e65.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf48419e65.png 613w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf48419e65-300x259.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf48419e65-600x518.png 600w" sizes="auto, (max-width: 613px) 100vw, 613px" /></p>
<p>If you want to automate the process of creating an Azure VM from your images you can use Azure Template. You can find a quick start template at Azure&#8217;s GitHub repository.</p>
<p>Create a Virtual Machine from a User Image: <a href="https://github.com/Azure/azure-quickstart-templates/tree/master/101-vm-from-user-image">https://github.com/Azure/azure-quickstart-templates/tree/master/101-vm-from-user-image</a></p>
<p>&nbsp;</p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author"><div class="saboxplugin-tab"><div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div><div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div><div class="saboxplugin-desc"><div itemprop="description"><p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div></div><div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div><div class="clearfix"></div><div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:p&#114;ox&#105;m&#097;&#103;&#114;&#064;&#104;&#111;t&#109;&#097;i&#108;.c&#111;m" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div></div></div><p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-image%2F&amp;linkname=Azure%20VM%20Image" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-image%2F&amp;linkname=Azure%20VM%20Image" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-image%2F&#038;title=Azure%20VM%20Image" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/" data-a2a-title="Azure VM Image"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/">Azure VM Image</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
