<?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>powershell Archives - Apostolidis Cloud Corner</title>
	<atom:link href="https://www.cloudcorner.gr/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.cloudcorner.gr/tag/powershell/</link>
	<description>Remarks from a Cloud Architect encounters</description>
	<lastBuildDate>Wed, 31 Jul 2024 10:23:03 +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>powershell Archives - Apostolidis Cloud Corner</title>
	<link>https://www.cloudcorner.gr/tag/powershell/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Monitor &#038; Dependencies agents at once!</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/monitor-dependencies-agents-at-once/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/monitor-dependencies-agents-at-once/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Fri, 26 Apr 2024 07:30:11 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[dependency agent]]></category>
		<category><![CDATA[dependency analysis]]></category>
		<category><![CDATA[log analytics]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[service map]]></category>
		<guid isPermaLink="false">https://www.cloudcorner.gr/?p=4192</guid>

					<description><![CDATA[<p>Download the two agents from the links below: The Monitor agent needs extravtion. To extract use the command: MMASetup-&#60;platform>.exe /c</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/monitor-dependencies-agents-at-once/">Monitor &amp; Dependencies agents at once!</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Download the two agents from the links below:</p>



<ul class="wp-block-list">
<li><a href="https://go.microsoft.com/fwlink/?LinkId=828603">https://go.microsoft.com/fwlink/?LinkId=828603</a></li>



<li><a href="https://aka.ms/dependencyagentwindows">https://aka.ms/dependencyagentwindows</a></li>
</ul>



<p>The Monitor agent needs extravtion. To extract use the command: MMASetup-&lt;platform>.exe /c /t:&lt;Full Path></p>



<p>e.g.: MMASetup-AMD64.exe /c /t:C:\Temp</p>



<p>Add all files to a network share like: <a href="file://server/share/">\\server\share\</a></p>



<p>φτιάξε ένα bat or cmd file, π.χ. setupagents.bat με το παρακάτω περιεχόμενο αλλά βάλε τα δικά σου shares, workspace ID &amp; Key:</p>



<p>create a bat or cmd file, e.g. setupagents.bat and add the below content. Change the share link, the Workspace ID and Key:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bat" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">net use y: \\server\share\

y:\Setup.exe /qn NOAPM=1 ADD_OPINSIGHTS_WORKSPACE=1 OPINSIGHTS_WORKSPACE_AZURE_CLOUD_TYPE=0 OPINSIGHTS_WORKSPACE_ID="&lt;your workspace ID>" OPINSIGHTS_WORKSPACE_KEY="&lt;your workspace key>" AcceptEndUserLicenseAgreement=1

y:\InstallDependencyAgent-Windows.exe /S /RebootMode=manual

net use y: /delete</pre>



<p>For example, I created the setupagents.bat, and added the files to the network share  <a href="file://dcvm/Temp">\\dcvm\Temp</a> . The content of my setupagents.bat is:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">net use y: \\dcvm\Temp

y:\Setup.exe /qn NOAPM=1 ADD_OPINSIGHTS_WORKSPACE=1 OPINSIGHTS_WORKSPACE_AZURE_CLOUD_TYPE=0 OPINSIGHTS_WORKSPACE_ID="b987ae35-b7e3-44ba-bd27-000000000000" OPINSIGHTS_WORKSPACE_KEY="OZz8YN5A12biINsMbja9PHkZLDdYNNZEw+QDIsAmi0ys/2+000000000000==" AcceptEndUserLicenseAgreement=1

y:\Temp\InstallDependencyAgent-Windows.exe /S /RebootMode=manual

net use y: /delete</pre>



<p>After running the setupagents.bat, both agents are installed. You can check at the programs and features:</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-46.png"><img fetchpriority="high" decoding="async" width="813" height="246" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-46.png" alt="" class="wp-image-4194" style="width:446px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-46.png 813w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-46-300x91.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-46-768x232.png 768w" sizes="(max-width: 813px) 100vw, 813px" /></a></figure>



<p>At the control panel the Microsoft Monitoring Agent will appear and open it to check that it is connected to y our Log Analytics Workspace.</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-47.png"><img decoding="async" width="351" height="119" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-47.png" alt="" class="wp-image-4195" style="width:224px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-47.png 351w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-47-300x102.png 300w" sizes="(max-width: 351px) 100vw, 351px" /></a></figure>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-48.png"><img decoding="async" width="786" height="301" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-48.png" alt="" class="wp-image-4196" style="width:520px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-48.png 786w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-48-300x115.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-48-768x294.png 768w" sizes="(max-width: 786px) 100vw, 786px" /></a></figure>



<p>Here is a list of sample Log Search commands for the dependency analysis:</p>



<ul class="wp-block-list">
<li><a href="https://learn.microsoft.com/en-us/previous-versions/azure/azure-monitor/vm/service-map#sample-log-searches">https://learn.microsoft.com/en-us/previous-versions/azure/azure-monitor/vm/service-map#sample-log-searches</a></li>



<li><a href="https://learn.microsoft.com/en-us/azure/migrate/how-to-create-group-machine-dependencies#sample-review-inbound-connections">https://learn.microsoft.com/en-us/azure/migrate/how-to-create-group-machine-dependencies#sample-review-inbound-connections</a></li>
</ul>
<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:pro&#120;&#105;&#109;&#097;&#103;r&#064;h&#111;&#116;&#109;a&#105;&#108;&#046;&#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%2Fmonitor-dependencies-agents-at-once%2F&amp;linkname=Monitor%20%26%20Dependencies%20agents%20at%20once%21" 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%2Fmonitor-dependencies-agents-at-once%2F&amp;linkname=Monitor%20%26%20Dependencies%20agents%20at%20once%21" 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%2Fmonitor-dependencies-agents-at-once%2F&#038;title=Monitor%20%26%20Dependencies%20agents%20at%20once%21" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/monitor-dependencies-agents-at-once/" data-a2a-title="Monitor &amp; Dependencies agents at once!"><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/monitor-dependencies-agents-at-once/">Monitor &amp; Dependencies agents at once!</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/monitor-dependencies-agents-at-once/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure Virtual Desktop (AVD) LAB</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/azure-virtual-desktop-avd-lab/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/azure-virtual-desktop-avd-lab/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Fri, 19 Apr 2024 11:57:35 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[IaC]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[avd]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure cli]]></category>
		<category><![CDATA[azure virtual desktop]]></category>
		<category><![CDATA[azure vm]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[powershell]]></category>
		<guid isPermaLink="false">https://www.cloudcorner.gr/?p=4091</guid>

					<description><![CDATA[<p>Think of Azure Virtual Desktop, or AVD for short, as your own personal workspace in the cloud. It’s like having</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-virtual-desktop-avd-lab/">Azure Virtual Desktop (AVD) LAB</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Think of Azure Virtual Desktop, or AVD for short, as your own personal workspace in the cloud. It’s like having your Windows 11 or Windows 10 desktop, but you can access it from anywhere. You can even choose to use just specific apps with something called RemoteApp. The cool part? You don’t need any gateway servers. It’s flexible enough to handle all sorts of workloads, and you can use your own image or pick one from the Azure Gallery. Just keep in mind, it’s more for businesses rather than individual users. With AVD, you’re setting up an environment that can grow and change with your needs.</p>



<p>If you’re curious and want to dive deeper into how all this works, I highly recommend checking out the&nbsp;<a is="cib-link" href="https://learn.microsoft.com/en-us/azure/architecture/guide/virtual-desktop/start-here" target="_blank" rel="noreferrer noopener">Azure Virtual Desktop architecture page</a>&nbsp;on the Microsoft Architecture Center. It’s a treasure trove of information!&nbsp;Here you can find the <a href="https://learn.microsoft.com/en-us/azure/architecture/example-scenario/azure-virtual-desktop/azure-virtual-desktop">Azure Virtual Desktop for enterprise</a> page including a Visio diagram that you can download and edit.</p>



<h2 class="wp-block-heading">Table of Contents</h2>



<ol>
<li><a rel="noopener" href="#avdlabsetup">AVD Lab Setup</a></li>
<li><a rel="noopener" href="#diagram">High level diagram of the Lab Setup</a></li>
<li><a rel="noopener" href="#labguidedsteps">LAB Guided Steps</a></li>
<li><a rel="noopener" href="#dc">Domain Controller</a></li>
<li><a rel="noopener" href="#upd">User Profile Disks</a></li>
<li><a rel="noopener" href="#dirsync">Create the DirSync server</a></li>
<li><a rel="noopener" href="#adjoinstorage">Join the Storage Account to the Active Directory Domain Services</a></li>
<li><a rel="noopener" href="#updfileshare">Create the File Share for the User Profile Disks</a></li>
<li><a rel="noopener" href="#fslogixgpo">Configure the FSLogix through Group Policy</a></li>
<li><a rel="noopener" href="#createimage">Create the Image</a></li>
<li><a rel="noopener" href="#hostpool">Create the Host Pool</a></li>
<li><a rel="noopener" href="#assignusers">Assign user to the host pool application group</a></li>
<li><a rel="noopener" href="#useraccess">User access</a></li>
<li><a rel="noopener" href="#updateimage">Update Image</a></li>
<li><a rel="noopener" href="#autoscale">Auto scale &#038; Start VM on connect</a></li>
<li><a rel="noopener" href="#scalingplan">Scaling plan</a></li>
<li><a rel="noopener" href="#automation">Session Limits &#038; Stop the VMs automation</a></li>
<li><a rel="noopener" href="#mfa">Authentication &amp; Security</a></li>
<li><a rel="noopener" href="#ux">User experience &amp; Security</a></li>
<li><a rel="noopener" href="#monitor">Monitoring</a></li>
</ol>



<h2 class="wp-block-heading" id="avdlabsetup">AVD Lab Setup</h2>



<p>We will create an Azure Virtual Desktop environment for 50 remote users that will work in a Pooled session host architecture. What that means? Pooled session hosts means that we will deploy a pool of 7 session hosts (Virtual Machines) where users will be load balanced to any session host in the <a href="https://learn.microsoft.com/en-us/azure/virtual-desktop/terminology#host-pools">host pool</a>.</p>



<p>The operating system will be <a href="https://learn.microsoft.com/en-us/mem/intune/fundamentals/azure-virtual-desktop-multi-session">Windows 11 multi-session </a>with Office 365 preinstalled. We will select an Azure marketplace image; we will edit it to do any customizations we need and then we will create a custom image and use it for our AVD deployment. </p>



<p>To store the user profiles we need a persistent storage outside the hosts (virtual machines). We will store the images to an Azure File Share of a Storage Account and we will use the <a href="https://learn.microsoft.com/en-us/azure/virtual-desktop/create-profile-container-azure-ad">FXLogix tool to manage the profile containers</a>.</p>



<h3 class="wp-block-heading" id="diagram">High level diagram of the Lab Setup</h3>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-1.png"><img loading="lazy" decoding="async" width="664" height="742" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-1.png" alt="" class="wp-image-4093" style="width:880px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-1.png 664w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-1-268x300.png 268w" sizes="auto, (max-width: 664px) 100vw, 664px" /></a></figure>



<h2 class="wp-block-heading" id="labguidedsteps">LAB Guided Steps</h2>



<p>Create three Resource Groups, one for Identity, one for Networking and one for the AVD, that will include the AVD Resource, the hosts and the private endpoints, and create the corresponding Virtual Networks. The AVD-Resources Virtual Network will have two subnets, one for the Hosts and one for the Private Endpoint. Finaly peer the identity &amp; resources networks with the networking virtual network.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#create resource groups
az group create -n AVD-Identity-RG -l germanywestcentral
az group create -n AVD-Networking-RG -l germanywestcentral
az group create -n AVD-Resources-RG -l germanywestcentral

#create virtual networks
az network vnet create -n AVD-Identity-VNET -g AVD-Identity-RG --address-prefix 10.56.0.0/24 --subnet-name domain --subnet-prefixes 10.56.0.0/24
az network vnet create -n AVD-Networking-VNET -g AVD-Networking-RG --address-prefix 10.56.1.0/24 --subnet-name AzureFirewallSubnet --subnet-prefixes 10.56.1.0/26
az network vnet subnet create -g AVD-Networking-RG --vnet-name AVD-Networking-VNET -n AzureFirewallManagementSubnet --address-prefixes 10.56.1.64/26
az network vnet create -n AVD-Resources-VNET -g AVD-Resources-RG --address-prefix 10.56.2.0/24 --subnet-name hosts --subnet-prefixes 10.56.2.0/26
az network vnet subnet create -g AVD-Resources-RG --vnet-name AVD-Resources-VNET -n privatelink --address-prefixes 10.56.2.64/26

#create vnet peerings
# Get the id for vnet-1.
vNet1Id=$(az network vnet show -g AVD-Networking-RG --name AVD-Networking-VNET --query id --out tsv)
# Get the id for vnet-2.
vNet2Id=$(az network vnet show -g AVD-Identity-RG --name AVD-Identity-VNET --query id --out tsv)
# Get the id for vnet-3.
vNet3Id=$(az network vnet show -g AVD-Resources-RG --name AVD-Resources-VNET --query id --out tsv)
# peer vnet-1 to vnet-2
az network vnet peering create --name networking-to-identity -g AVD-Networking-RG --vnet-name AVD-Networking-VNET --remote-vnet $vNet2Id --allow-vnet-access
# peer vnet-1 to vnet-3
az network vnet peering create --name networking-to-resources -g AVD-Networking-RG --vnet-name AVD-Networking-VNET --remote-vnet $vNet3Id --allow-vnet-access
# peer vnet-2 to vnet-1
az network vnet peering create --name identity-to-networking -g AVD-Identity-RG --vnet-name AVD-Identity-VNET --remote-vnet $vNet1Id --allow-vnet-access --allow-forwarded-traffic
# peer vnet-3 to vnet-1
az network vnet peering create --name resources-to-networking -g AVD-Resources-RG --vnet-name AVD-Resources-VNET --remote-vnet $vNet1Id --allow-vnet-access --allow-forwarded-traffic

# Create an Azure Firewall Basic and add an allow network rule for the LAN
az network public-ip create --name "azfwpip" --resource-group "AVD-Networking-RG" --location "germanywestcentral" --sku "Standard"
az network public-ip create --name "azfwmpip" --resource-group "AVD-Networking-RG" --location "germanywestcentral" --sku "Standard"
az network firewall create -g AVD-Networking-RG -n AVDFirewall --sku AZFW_VNet --tier Basic --vnet-name AVD-Networking-VNET --conf-name avdIpConfig --m-conf-name avdmIpConfig --m-public-ip azfwmpip --public-ip azfwpip
az network firewall network-rule create --collection-name Net-Coll01 --destination-addresses 10.0.0.0/8 --destination-ports '*' --firewall-name AVDFirewall --name Allow-LAN --protocols Any --resource-group AVD-Networking-RG --priority 200 --source-addresses 10.0.0.0/8 --action Allow
az network firewall network-rule create --collection-name Net-Coll01 --destination-addresses '*' --destination-ports '*' --firewall-name AVDFirewall --name Allow-Internet --protocols Tcp --resource-group AVD-Networking-RG --source-addresses 10.0.0.0/8
az network firewall nat-rule create --collection-name Nat-Coll01 --priority 300 --dest-addr '4.185.80.0' --source-addresses '*' --destination-ports '3389' --firewall-name AVDFirewall --name rdptodc --protocols Any --resource-group AVD-Networking-RG --translated-address 10.56.0.4 --translated-port '3389' --action Dnat

# Create a Route Table (for the lab I created one route table to route all traffic to the Azure Firewall.) and associate it to the identity and resources subnets.
az network route-table create --name Firewall-rt-table --resource-group AVD-Networking-RG --location germanywestcentral --disable-bgp-route-propagation true
az network route-table route create --resource-group AVD-Networking-RG --name route-to-firewall --route-table-name Firewall-rt-table --address-prefix 0.0.0.0/0 --next-hop-type VirtualAppliance --next-hop-ip-address 10.56.1.4
RTiD=$(az network route-table show -g AVD-Networking-RG -n Firewall-rt-table --query id --out tsv)
az network vnet subnet update -n hosts -g AVD-Resources-RG --vnet-name AVD-Resources-VNET --route-table $RTiD
az network vnet subnet update -n privatelink -g AVD-Resources-RG --vnet-name AVD-Resources-VNET --route-table $RTiD
az network vnet subnet update -n domain -g AVD-Identity-RG --vnet-name AVD-Identity-VNET --route-table $RTiD

# create NSG (for the lab I will create just and allow lan rule)
az network nsg create -g AVD-Networking-RG -n AVD-NSG
az network nsg rule create -g AVD-Networking-RG --nsg-name AVD-NSG -n AllowLan --priority 100 --source-address-prefixes 10.0.0.0/8 --source-port-ranges '*' --destination-address-prefixes 10.0.0.0/8 --destination-port-ranges '*' --access Allow --protocol '*' --description "allowlan"
az network nsg rule create -g AVD-Networking-RG --nsg-name AVD-NSG -n AllowLanOut --priority 101 --source-address-prefixes 10.0.0.0/8 --source-port-ranges '*' --destination-address-prefixes 10.0.0.0/8 --destination-port-ranges '*' --access Allow --protocol '*' --description "allowlan" --direction Outbound
NSGId=$(az network nsg show -g AVD-Networking-RG --name AVD-NSG --query id --out tsv)
az network vnet subnet update -g AVD-Identity-RG -n domain --vnet-name AVD-Identity-VNET --network-security-group $NSGId
az network vnet subnet update -g AVD-Resources-RG -n hosts --vnet-name AVD-Resources-VNET --network-security-group $NSGId
az network vnet subnet update -g AVD-Resources-RG -n privatelink --vnet-name AVD-Resources-VNET --network-security-group $NSGId</pre>



<h2 class="wp-block-heading" id="dc">Domain Controller </h2>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Create a network interface with private ip address due to DNS requirements
az network nic create --resource-group AVD-Identity-RG --name "DCNic" --vnet-name "AVD-Identity-VNET" --subnet "domain" --private-ip-address "10.56.0.4"
# Create a virtual machine
az vm create --resource-group AVD-Identity-RG --name "DCVM" --image "win2022datacenter" --size "Standard_D2s_v3" --admin-username "azureuser" --admin-password "your-password" --nics "DCNic"</pre>



<p>Login to the VM and promote to Domain Controller &amp; DNS server. In case you have an on-premises Active Directory environment that you want to use, then you will need a hybrid connectivity (ExpressRoute or VPN) and instead of creating a new Domain, you will need to add this server as an additional domain controller. There are plenty of guides to create an Active Directory domain, like this <a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/deploy/install-active-directory-domain-services--level-100-">Install Active Directory Domain Services (Level 100) | Microsoft Learn</a> . </p>



<p>After the promotion, and once the DNS role is ready, change the DNS settings of all Virtual Networks to the private IP address of the ADDS/DNS server.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Set DNS servers on VNets
az network vnet update --resource-group AVD-Identity-RG --name AVD-Identity-VNET --dns-servers "10.56.0.4"
az network vnet update --resource-group AVD-Networking-RG --name AVD-Networking-VNET --dns-servers "10.56.0.4"
az network vnet update --resource-group AVD-Resources-RG --name AVD-Resources-VNET --dns-servers "10.56.0.4"</pre>



<h2 class="wp-block-heading" id="upd">User Profile Disks</h2>



<p>Create one Storage Account with a Private Endpoint and a Private DNS Zone that is needed to access the Storage Account endpoint. In case of an Enterprise Scale deployment, the Private DNS Zones will be located in a centralized location. The Storage Account name needs to be globally unique.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Create storage account
az storage account create --name avdupd916 -g AVD-Resources-RG -l germanywestcentral --sku 'Standard_LRS' --allow-blob-public-access false --public-network-access Disabled --https-only true

# Get the Storage Account ID
storageAccountId=$(az storage account show -n avdupd916 -g AVD-Resources-RG --query id --output tsv)

# Get the Subnet ID
subnetId=$(az network vnet subnet show -g AVD-Resources-RG -n privatelink --vnet-name AVD-Resources-VNET --query id --out tsv)

# Create the private endpoint
az network private-endpoint create --name avdupd916files --resource-group AVD-Resources-RG --vnet-name AVD-Resources-VNET --subnet $subnetId --private-connection-resource-id $storageAccountId --group-ids file --connection-name avdupd916filesconnection

# Create the private DNS zone
az network private-dns zone create --name 'privatelink.file.core.windows.net' -g AVD-Resources-RG

# Create the private DNS zone group
az network private-endpoint dns-zone-group create --name avddnszonegroup --endpoint-name avdupd916files --private-dns-zone 'privatelink.file.core.windows.net' -g AVD-Resources-RG --zone-name 'privatelink.file.core.windows.net'

#Create a VNET link to the identity VNET
IDVnetId=$(az network vnet show -g AVD-Identity-RG --name AVD-Identity-VNET --query id --out tsv)
az network private-dns link vnet create -g AVD-Resources-RG -n fileslinktoid -z privatelink.file.core.windows.net -v $IDVnetId -e False</pre>



<h4 class="wp-block-heading" id="dirsync">Create the DirSync server</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Create a network interface
az network nic create --resource-group AVD-Identity-RG --name "DSNic" --vnet-name "AVD-Identity-VNET" --subnet "domain"
# Create a virtual machine
az vm create --resource-group AVD-Identity-RG --name "DSVM" --image "win2022datacenter" --size "Standard_D2s_v3" --admin-username "azureuser" --admin-password "your-password" --nics "DSNic"</pre>



<h5 class="wp-block-heading">Sync the AD DS users using DirSync</h5>



<p>Go to the Microsoft Entra Connect / Connect Sync / and download the Microsoft Entra Connect. Install it to the DirSync server and complete the express installation. After this process the AD DS users will be synced to the Entra ID.</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-5.png"><img loading="lazy" decoding="async" width="781" height="374" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-5.png" alt="" class="wp-image-4105" style="width:543px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-5.png 781w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-5-300x144.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-5-768x368.png 768w" sizes="auto, (max-width: 781px) 100vw, 781px" /></a></figure>



<h4 class="wp-block-heading" id="adjoinstorage">Join the Storage Account to the Active Directory Domain Services</h4>



<p>The Storage Account needs to be joined to the Active Directory Domain Servers in order to support domain user permissions and SSO. The process is described in this article: <a href="https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-ad-ds-enable">Enable AD DS authentication for Azure file shares | Microsoft Learn</a></p>



<ul class="wp-block-list">
<li style="line-height:1.5">Login to the DirSync server</li>



<li style="line-height:1.5"> install the latest .Net Framework <a href="https://dotnet.microsoft.com/en-us/download/dotnet-framework">Download .NET Framework | Free official downloads (microsoft.com)</a> </li>



<li style="line-height:1.5">download the <a href="https://github.com/Azure-Samples/azure-files-samples/releases">AzFilesHybrid </a>module. </li>



<li style="line-height:1.5">Run J<a href="https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-ad-ds-enable#run-join-azstorageaccount">oin-AzStorageAccount script</a>, changing the required parameters.</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="powershell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
# Navigate to where AzFilesHybrid is unzipped and stored and run to copy the files into your path
C:\temp&amp;gt;.\CopyToPSPath.ps1 
# Import AzFilesHybrid module
Import-Module -Name AzFilesHybrid
# Install the Az module and Connect to Azure
Install-Module Az
Connect-AzAccount
# Define parameters
$SubscriptionId = "********-****-****-****-********"
$ResourceGroupName = "AVD-Resources-RG"
$StorageAccountName = "avdupd916"
$SamAccountName = "avdupd916"
$DomainAccountType = "ComputerAccount"
$OuDistinguishedName = "OU=UPD,OU=AVDResources,DC=myavdd,DC=com"
# Select the target subscription for the current session
Select-AzSubscription -SubscriptionId $SubscriptionId 
# Register the target storage account with your active directory environment under the target OU 
Join-AzStorageAccount -ResourceGroupName $ResourceGroupName -StorageAccountName $StorageAccountName -SamAccountName $SamAccountName -DomainAccountType $DomainAccountType -OrganizationalUnitDistinguishedName $OuDistinguishedName</pre>



<p>After this process, a computer object will appear at the specified OU and the Storage Account, at the File Share settings will have the identity-based access as Configured.</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-2.png"><img loading="lazy" decoding="async" width="540" height="83" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-2.png" alt="" class="wp-image-4100" style="width:384px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-2.png 540w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-2-300x46.png 300w" sizes="auto, (max-width: 540px) 100vw, 540px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-3.png"><img loading="lazy" decoding="async" width="236" height="65" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-3.png" alt="" class="wp-image-4102"/></a></figure>



<p>Create two Groups. One for the AVD Admins and one for the AVD Users. In my case is AVDAdmins and AVDUsers. Wait until the users and groups are synced to the Microsoft Entra ID.</p>



<h4 class="wp-block-heading" id="updfileshare">Create the File Share for the User Profile Disks</h4>



<p>Create the File Share and Add the Admins Group to the &#8220;Storage File Data SMB Share Elevated Contributor&#8221; Role of the Storage Account and the Users Group to the &#8220;Storage File Data SMB Share Contributor&#8221; Role.</p>



<ul class="wp-block-list">
<li>&#8220;avdadmins&#8221; the &#8220;Storage File Data SMB Share Elevated Contributor&#8221; role</li>



<li>&#8220;avdusers: the &#8220;Storage File Data SMB Share Contributor&#8221; role</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="powershell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># changing to PowerShell cause the Azure Cli caused me some problems. | Create the File Share
New-AzRmStorageShare -ResourceGroupName AVD-Resources-RG -StorageAccountName avdupd916 -Name updhare</pre>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Back to Azure Cli | Provide access to the synced groups to the file share. To add a group you will need the object id of the group.
# avdadmins = ********************-0d5db5b092f8
az role assignment create --role "Storage File Data SMB Share Elevated Contributor" --assignee-object-id ********************-0d5db5b092f8 --assignee-principal-type Group --scope "/subscriptions/********************/resourceGroups/AVD-Resources-RG/providers/Microsoft.Storage/storageAccounts/avdupd916/fileServices/default/fileshares/updshare"
# avdusers = ********************-5e934d6f5c7d
az role assignment create --role "Storage File Data SMB Share Contributor" --assignee-object-id ********************-5e934d6f5c7d --assignee-principal-type Group --scope "/subscriptions/********************/resourceGroups/AVD-Resources-RG/providers/Microsoft.Storage/storageAccounts/avdupd916/fileServices/default/fileshares/updshare"</pre>



<p>Assign NTFS permissions to the share</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bat" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># mount the share to a member server to take a drive letter
net use Z: \\avdupd916.file.core.windows.net\updshare
icacls Z: /remove "Authenticated Users"
icacls Z: /remove "Builtin\Users"    
icacls Z: /remove "Creator Owner"
icacls Z: /grant "avdusers:(M)"
icacls Z: /grant "Creator Owner:(OI)(CI)(IO)(M)"</pre>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-7.png"><img loading="lazy" decoding="async" width="935" height="217" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-7.png" alt="" class="wp-image-4112" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-7.png 935w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-7-300x70.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-7-768x178.png 768w" sizes="auto, (max-width: 935px) 100vw, 935px" /></a></figure>



<h2 class="wp-block-heading" id="fslogixgpo">Configure the FSLogix through Group Policy</h2>



<p>Download the <a href="https://aka.ms/fslogix_download">FSLogix</a> zip and copy the admx and adml files to the correct location based to your setup. <a href="https://learn.microsoft.com/en-us/fslogix/how-to-use-group-policy-templates#local-group-policy-editor">Here for more info</a>. Open the Group Policy Management. Create a new GPO and link it to the AVD Hosts OU. If the admx/adml files are copied correctly you should see the FSLogix settings under Computer Configuration / Policies / Administrative Templates</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-18.png"><img loading="lazy" decoding="async" width="498" height="249" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-18.png" alt="" class="wp-image-4126" style="width:314px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-18.png 498w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-18-300x150.png 300w" sizes="auto, (max-width: 498px) 100vw, 498px" /></a></figure>



<p>Settings to configure:</p>



<p><strong>FSLogix / Profile Containers:</strong> </p>



<ol class="wp-block-list">
<li style="line-height:1.5">Enabled = Enabled</li>



<li style="line-height:1.5">VHD Locations: \avdupd916.file.core.windows.net\updshare</li>



<li style="line-height:1.5">DeleteLocalProfileWhenVHDShouldApply = Enabled</li>



<li style="line-height:1.5">LockedRetryCount = 3</li>



<li style="line-height:1.5">LockedRetryInterval = 5</li>



<li style="line-height:1.5">ProfileType = Normal</li>
</ol>



<p><strong>FSLogix / Profile Containers</strong> / Container and Directory Naming</p>



<ol class="wp-block-list">
<li style="line-height:1.5">VolumeType = VHDX</li>



<li style="line-height:1.5">SIDDirNameMatch = %username%.%userdomain%</li>



<li style="line-height:1.5">SIDDirNamePattern = %username%.%userdomain%</li>



<li style="line-height:1.5">VHDNameMatch = %username%</li>



<li style="line-height:1.5">VHDNamePattern = %username%</li>
</ol>



<h2 class="wp-block-heading" id="createimage">Create the Image</h2>



<p>Create a VM from the marketplace. I chose a Windows 11 multi-sesison image with MS apps.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Create a network interface
az network nic create --resource-group AVD-Resources-RG --name "ImageNic" --vnet-name "AVD-Resources-VNET" --subnet "hosts"
#find the image name
az vm image list --location germanywestcentral --publisher microsoftwindowsdesktop --offer office-365 --all --output table
# Create a virtual machine
az vm create --resource-group AVD-Resources-RG --name "ImageVM" --image "MicrosoftWindowsDesktop:office-365:win11-23h2-avd-m365:22631.3447.240409" --size "Standard_D2s_v3" --admin-username "vmadmin" --admin-password "*********" --nics "ImageNic"</pre>



<p>This image already has Microsoft 365, Teams, Edge, OneDrive in a multi-session installation and the FSLogix app to control the user profile disks.  Install whatever application is needed and do any configuration, like language etc. I will install 7-zip &amp; VLC Player just for the customization.</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-8.png"><img loading="lazy" decoding="async" width="443" height="149" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-8.png" alt="" class="wp-image-4115" style="width:360px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-8.png 443w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-8-300x101.png 300w" sizes="auto, (max-width: 443px) 100vw, 443px" /></a></figure>



<p>Take a snapshot of the VM disk before performing sysprep. You will need this snapshot when you need to do any updates and customizations to this image. After the sysprep you will no longer be able to spin an Azure VM. It is recommended to stop/deallocate the VM to take the snapshot. Open the Disk resource and press + Create Snapshot</p>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-26.png"><img loading="lazy" decoding="async" width="726" height="126" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-26.png" alt="" class="wp-image-4137" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-26.png 726w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-26-300x52.png 300w" sizes="auto, (max-width: 726px) 100vw, 726px" /></a></figure>



<p>Generalize the image with sysprep</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bat" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">C:\Windows\System32\Sysprep\sysprep.exe /oobe /generalize /shutdown</pre>



<p>Capture the VM to create the Image. This is done by the Azure Portal, at the VM Overview blade, press Capture. Since the sysprep makes the OS unusable, select to delete the VM after creating the image. I like using the Azure compute gallery to store the images and versions, so I will select to add the image to a gallery.</p>



<ul class="wp-block-list">
<li>Share image to Azure compute gallery: Yes</li>



<li>Automatically delete this virtual machine after creating the image: Yes</li>



<li>Azure compute gallery: AVDACG</li>



<li>Operating system state: Generalized</li>



<li>Target VM image definition: win11-23H2</li>



<li>Version number: 0.0.1</li>



<li>Source virtual machine: imagevm</li>
</ul>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-9.png"><img loading="lazy" decoding="async" width="842" height="155" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-9.png" alt="" class="wp-image-4117" style="width:636px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-9.png 842w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-9-300x55.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-9-768x141.png 768w" sizes="auto, (max-width: 842px) 100vw, 842px" /></a></figure>



<h2 class="wp-block-heading" id="hostpool">Create the Host Pool</h2>



<p>At the Azure Portal, go to the Azure Virtual Desktop and Create a host pool</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-10.png"><img loading="lazy" decoding="async" width="848" height="224" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-10.png" alt="" class="wp-image-4118" style="width:666px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-10.png 848w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-10-300x79.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-10-768x203.png 768w" sizes="auto, (max-width: 848px) 100vw, 848px" /></a></figure>



<p>Basics: Select the subscription, the Resource Group, the Host Pool Name, location for the metadata, I will create an environment for Desktops, in a Pooled host pool type, so there will be no dedicated VMs per users. </p>



<p>Virtual Machines: Select to add Virtual Machines. Give a prefix up to 12 characters, since AVD will add -## numbering. Select the image from the shared image gallery and how many VMs will be spined in total. At he networking select the network that is prepared for the hosts. For domain join add the UPN of the user (not domain\user, you need user@domain.com), enter the domain name and the OU distinguished name. Finaly add details for the local admin user. </p>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-11.png"><img loading="lazy" decoding="async" width="730" height="864" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-11.png" alt="" class="wp-image-4119" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-11.png 730w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-11-253x300.png 253w" sizes="auto, (max-width: 730px) 100vw, 730px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-12.png"><img loading="lazy" decoding="async" width="731" height="762" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-12.png" alt="" class="wp-image-4120" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-12.png 731w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-12-288x300.png 288w" sizes="auto, (max-width: 731px) 100vw, 731px" /></a></figure>



<p>Workspace: Register the host pool to a workspace.</p>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-13.png"><img loading="lazy" decoding="async" width="723" height="146" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-13.png" alt="" class="wp-image-4121" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-13.png 723w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-13-300x61.png 300w" sizes="auto, (max-width: 723px) 100vw, 723px" /></a></figure>



<p>Advanced: Enable the diagnostic settings. You will need to have prepared a log analytics workspace.</p>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-14.png"><img loading="lazy" decoding="async" width="716" height="405" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-14.png" alt="" class="wp-image-4122" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-14.png 716w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-14-300x170.png 300w" sizes="auto, (max-width: 716px) 100vw, 716px" /></a></figure>



<p>When the process is complete you will see two computer accounts at you active directory</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-15.png"><img loading="lazy" decoding="async" width="602" height="144" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-15.png" alt="" class="wp-image-4123" style="width:472px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-15.png 602w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-15-300x72.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-15-600x144.png 600w" sizes="auto, (max-width: 602px) 100vw, 602px" /></a></figure>



<p>and at the Azure Portal / Azure virtual Desktop / host pool will see the two hosts ready to connect</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-16.png"><img loading="lazy" decoding="async" width="330" height="147" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-16.png" alt="" class="wp-image-4124" style="width:251px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-16.png 330w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-16-300x134.png 300w" sizes="auto, (max-width: 330px) 100vw, 330px" /></a></figure>



<p>Go to Azure Monitor and enable the monitor for the host virtual machines.</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-24.png"><img loading="lazy" decoding="async" width="790" height="492" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-24.png" alt="" class="wp-image-4134" style="width:435px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-24.png 790w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-24-300x187.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-24-768x478.png 768w" sizes="auto, (max-width: 790px) 100vw, 790px" /></a></figure>



<h2 class="wp-block-heading" id="assignusers">Assign users access to the Azure Virtual Desktop hosts</h2>



<p>For the users to be able to see the session and connect, they need to be assigned access to the application group of the specific host pool. Go to the Azure Virtual Desktop / Host Pools / YourHostPool / Application Groups / YourApplicationPool Assignments and add the AVD Users group.</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-17.png"><img loading="lazy" decoding="async" width="672" height="501" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-17.png" alt="" class="wp-image-4125" style="width:880px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-17.png 672w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-17-300x224.png 300w" sizes="auto, (max-width: 672px) 100vw, 672px" /></a></figure>



<h2 class="wp-block-heading" id="useraccess">User access</h2>



<p>AVD Web Access: <a href="https://aka.ms/avdweb">https://aka.ms/avdweb</a></p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-19.png"><img loading="lazy" decoding="async" width="542" height="372" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-19.png" alt="" class="wp-image-4128" style="width:374px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-19.png 542w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-19-300x206.png 300w" sizes="auto, (max-width: 542px) 100vw, 542px" /></a></figure>



<p>AVS Client for Windows, MacOS, iOS, Android, ChromeOS &amp; Thin Clients: <a href="https://aka.ms/avdclient">https://aka.ms/avdclient</a></p>



<p>after the first login, the folder that stores the User Profile Disk will appear at the Azure File Share</p>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-22.png"><img loading="lazy" decoding="async" width="677" height="210" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-22.png" alt="" class="wp-image-4131" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-22.png 677w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-22-300x93.png 300w" sizes="auto, (max-width: 677px) 100vw, 677px" /></a></figure>



<p>Disk Management run as administrator, see the attached VHDX User Profile Disk.</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-21.png"><img loading="lazy" decoding="async" width="489" height="381" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-21.png" alt="" class="wp-image-4130" style="width:361px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-21.png 489w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-21-300x234.png 300w" sizes="auto, (max-width: 489px) 100vw, 489px" /></a></figure>



<h2 class="wp-block-heading" id="updateimage">Update Image</h2>



<p>There are some options here. If we need to change the OS version, either from Windows 10 to 11, or from a version of 11 to another like 22H2 to 23H3, then create a new VM the marketplace with the target version, customize, capture and add it to the gallery as a new version. If you need to make changes to the existing image, create a VM from the image snapshot, customize and add it to the gallery as a new version. </p>



<p>In my lab I will create a VM from the snapshot just to see the process. Find the disk snapshot at the Azure Portal and press +Create Disk. </p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-27.png"><img loading="lazy" decoding="async" width="455" height="169" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-27.png" alt="" class="wp-image-4138" style="width:347px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-27.png 455w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-27-300x111.png 300w" sizes="auto, (max-width: 455px) 100vw, 455px" /></a></figure>



<p>Open the disk and Create VM</p>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-28.png"><img loading="lazy" decoding="async" width="387" height="143" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-28.png" alt="" class="wp-image-4139" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-28.png 387w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-28-300x111.png 300w" sizes="auto, (max-width: 387px) 100vw, 387px" /></a></figure>



<p>Once the VM is ready do any customizations and run Sysprep, the same way we run it for the initial image, then Capture the VM and select to add it to the gallery as a new version. I selected the same gallery, the same VM image definition, since it is still win11, and I changed the version number. </p>



<div class="wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex">
<ul class="wp-block-list">
<li style="line-height:1.5">Share image to Azure compute gallery: Yes</li>



<li style="line-height:1.5">Automatically delete this virtual machine after creating the image: Yes</li>



<li style="line-height:1.5">Azure compute gallery: AVDACG</li>



<li style="line-height:1.5">Operating system state: Generalized</li>



<li style="line-height:1.5">Target VM image definition: win11-23H2</li>



<li style="line-height:1.5">Version number:<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-primary-color"> <strong>0.0.2</strong></mark></li>



<li style="line-height:1.5">Source virtual machine: imagevm</li>
</ul>



<p>The process of updating the host pool</p>



<ul class="wp-block-list">
<li>Add new hosts to the host pool, selecting the latest image</li>
</ul>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-32.png"><img loading="lazy" decoding="async" width="637" height="244" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-32.png" alt="" class="wp-image-4147" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-32.png 637w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-32-300x115.png 300w" sizes="auto, (max-width: 637px) 100vw, 637px" /></a></figure>
</div>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-31.png"><img loading="lazy" decoding="async" width="726" height="74" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-31.png" alt="" class="wp-image-4146" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-31.png 726w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-31-300x31.png 300w" sizes="auto, (max-width: 726px) 100vw, 726px" /></a></figure>



<p>Once the new hosts are ready &amp; Available at the host pool, select the old hosts and turn n drain mode, in order to stop accepting new sessions. After that point all new sessions will go to the new hosts. Once the old hosts are empty, remove them from the pool and delete the VMs.</p>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-33.png"><img loading="lazy" decoding="async" width="865" height="166" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-33.png" alt="" class="wp-image-4149" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-33.png 865w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-33-300x58.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-33-768x147.png 768w" sizes="auto, (max-width: 865px) 100vw, 865px" /></a></figure>



<p>After log off / log on:</p>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-34.png"><img loading="lazy" decoding="async" width="883" height="161" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-34.png" alt="" class="wp-image-4150" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-34.png 883w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-34-300x55.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-34-768x140.png 768w" sizes="auto, (max-width: 883px) 100vw, 883px" /></a></figure>



<h2 class="wp-block-heading" id="autoscale">Auto scale &amp; Start VM on connect</h2>



<p>There are two options to save a lot of money by using auto scale and start VM on connect. With auto scale, you can have one host running 24/7 and the rest stopped. Once the host reach the max session limit, the AVD will start the next host, until it reaches the maximum hosts created for this host pool. Combining the auto scale with the start VM on connect, even the first host can be stopped, and it will start when the first user will try to logon. With a Scaling Plan, you can have the hosts start and stop based to a schedule, like weekdays and working hours. </p>



<h3 class="wp-block-heading">Some requirements</h3>



<p>You must have a configured Max Session Limit parameter for that host pool &amp; enable the Start VM On connect (if you need this feature too). Those options are at the Host Pool Properties.</p>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-35.png"><img loading="lazy" decoding="async" width="769" height="523" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-35.png" alt="" class="wp-image-4151" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-35.png 769w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-35-300x204.png 300w" sizes="auto, (max-width: 769px) 100vw, 769px" /></a></figure>



<p>you must assign the Desktop Virtualization Power On Off Contributor RBAC role to the Azure Virtual Desktop service principal l with your Azure subscription as the assignable scope. Go to the Subscription / Access Control (AIM, Add role assignment, select Role: &#8220;Desktop Virtualization Power On Off Contributor&#8221;, select member the service principal &#8220;Azure Virtual Desktop&#8221; and assign.</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-36.png"><img loading="lazy" decoding="async" width="748" height="204" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-36.png" alt="" class="wp-image-4152" style="width:528px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-36.png 748w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-36-300x82.png 300w" sizes="auto, (max-width: 748px) 100vw, 748px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-39.png"><img loading="lazy" decoding="async" width="885" height="340" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-39.png" alt="" class="wp-image-4155" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-39.png 885w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-39-300x115.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-39-768x295.png 768w" sizes="auto, (max-width: 885px) 100vw, 885px" /></a></figure>



<p>At this point, you can stop/deallocate the VMs from the Azure portal and then try to access the SessionDesktop with one user. The user will see a message stating that the VM is starting, and it may take up to 5 minutes and at the host pool you will see the first VM starting. For the LAB, I configured the max sessions to 1, so once I try to login with the second user, I will see the same message and it will start the second VM. If you need at least one VM to stay running, you can add a resource lock and make is read-only so the automation will not be able to deallocate it.</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-40.png"><img loading="lazy" decoding="async" width="423" height="126" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-40.png" alt="" class="wp-image-4157" style="width:359px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-40.png 423w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-40-300x89.png 300w" sizes="auto, (max-width: 423px) 100vw, 423px" /></a></figure>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-41.png"><img loading="lazy" decoding="async" width="550" height="114" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-41.png" alt="" class="wp-image-4158" style="width:454px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-41.png 550w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-41-300x62.png 300w" sizes="auto, (max-width: 550px) 100vw, 550px" /></a></figure>



<h4 class="wp-block-heading" id="scalingplan">Scaling plan</h4>



<p>Create a Scaling plan. Go to the Azure Virtual Desktop, under Manage select Scaling plans and Create a scaling plan. At the scaling plan you select a General configuration, like weekdays, select a presentence of the host to ramp-up a specific hour, to spin the VMs to be ready for your users in order to don&#8217;t wait 5 minutes for the VM to start on connect, select the peak hours, where most of your users are working, then select the Ramp-down, where a percentage of the hosts will stop. Here you can select if you will force log off the users or it will wait for the last user to log off. <a href="https://learn.microsoft.com/en-us/azure/virtual-desktop/autoscale-create-assign-scaling-plan">You can learn more here</a>.</p>



<p>Once the scaling plan is created, select Next: Host pool assignments and assign the Schedule to one or more host pools. </p>



<h4 class="wp-block-heading" id="automation">Session Limits &amp; Stop the VMs automation</h4>



<p>One thing that is recommended is to configure the Session limits for the Remote Desktop Session Hosts. You can use the same GPO as the FSLogix settings, as it is computer configuration too. Open the GPO and go to Computer Configuration &gt; Administrative Templates &gt; Windows Components &gt; Remote Desktop Services &gt; Remote Desktop Session Host &gt; Session Time Limits. </p>



<p>Set time limit for disconnected sessions: End a disconnected session = 30 minutes. Keep in mind that setting this after 30 minutes the disconnected session will be logged off.</p>



<p>If you want to trigger the Hosts to Stop/Deallocate once there are no active sessions, you can leverage Azure Automation account. There are plenty of guides like this: <a href="https://learn.microsoft.com/en-us/answers/questions/1180844/how-to-automate-avd-vm-shutdown-based-on-usage-and">How to automate AVD VM shutdown based on usage and disconnected state? &#8211; Microsoft Q&amp;A</a></p>



<p>The specific guide creates a runbook that runs a PowerShell script that queries the hosts for active sessions. If a host has no active sessions, then it stops the VM. First create a managed identity and assign the &#8220;Desktop Virtualization On Off Contributor&#8221; Azure role at the Hosts Resource Group. I altered it to check all the Session Hosts in a Host Pool:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="powershell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#Please enable appropriate RBAC permissions to the system identity of this automation account. Otherwise, the runbook may fail

# Authenticate to Azure with user assigned managed identity
try
{
    "Logging in to Azure..."
    Connect-AzAccount -Identity
}
catch {
    Write-Error -Message $_.Exception
    throw $_.Exception
}

# Set the Azure subscription ID, resource group name, and VM name
$subscriptionId = "*************-360a051fbe3d"
$hostPoolName = "AVDPooledHP"
$resourceGroupName = "avd-resources-rg"
$myADDSDomain = ".myavdd.com"

$sessionhosts = Get-AzWvdSessionHost -ResourceGroupName $resourceGroupName -HostPoolName $hostPoolName
foreach ($sessionhost in $sessionhosts) {
$splitText = $sessionhost.name.Split("/")
$hostName = $splitText[1]
$vmName = $hostName.Replace($myADDSDomain, "")
# Get the connected user count
$connectedUserCount = Get-AzWvdSessionHost -ResourceGroupName $resourceGroupName -HostPoolName $hostPoolName -Name $hostName | Select-Object -ExpandProperty Session
# Check if the conditions are met and deallocate the VM
if ($connectedUserCount -eq 0 ) {Stop-AzVM -ResourceGroupName $resourceGroupName -Name $vmName -Force}
}</pre>



<h2 class="wp-block-heading" id="mfa">Authentication &amp; security</h2>



<p>Microsoft Entra ID provides some security features that can help secure the access to the Azure Virtual Desktop. One of those features is the Conditional Access Policies. Conditional Access Policies are essentially if-then statements used to enforce organizational security policies. They bring together various signals (like user or group membership, IP location, device information, etc.) to make access decisions. For example, if a user wants to access a resource, they might be required to complete an action like multifactor authentication. </p>



<p>Add a Policy to require MFA to access Azure Virtual Desktop</p>



<ol class="wp-block-list">
<li>From the Azure Portal go to Microsoft Entra ID / Security / Conditional Access / Create new policy</li>



<li>Users: Select the group that includes the avd users. Mine is &#8220;avdusers&#8221; group.</li>



<li>Target resources: Include / Select apps / Select / Azure Virtual Desktop</li>
</ol>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-43.png"><img loading="lazy" decoding="async" width="632" height="391" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-43.png" alt="" class="wp-image-4181" style="width:509px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-43.png 632w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-43-300x186.png 300w" sizes="auto, (max-width: 632px) 100vw, 632px" /></a></figure>



<ul class="wp-block-list">
<li>4. Conditions: Client Apps / select Browser and Mobile apps and desktop clients</li>
</ul>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-44.png"><img loading="lazy" decoding="async" width="880" height="373" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-44.png" alt="" class="wp-image-4182" style="width:742px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-44.png 880w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-44-300x127.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-44-768x326.png 768w" sizes="auto, (max-width: 880px) 100vw, 880px" /></a></figure>



<p>5. Access Controls: Grand / Grand access / Require multi factor authentication</p>



<p>6. Session: It is not required but you can select the frequency that the user will be required to re-authenticate. You can select a periodic authentication and select some hours or some days or you can select every time.</p>



<figure class="wp-block-image size-full is-resized"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-45.png"><img loading="lazy" decoding="async" width="922" height="297" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-45.png" alt="" class="wp-image-4183" style="width:752px;height:auto" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-45.png 922w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-45-300x97.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-45-768x247.png 768w" sizes="auto, (max-width: 922px) 100vw, 922px" /></a></figure>



<p>Find out more here: <a href="https://learn.microsoft.com/en-us/azure/virtual-desktop/set-up-mfa?tabs=avd">Enforce Microsoft Entra multifactor authentication for Azure Virtual Desktop using Conditional Access &#8211; Azure | Microsoft Learn</a></p>



<h2 class="wp-block-heading" id="ux">User experience &amp; Security</h2>



<p style="line-height:1.5">Many settings can be set directly from the Host Pool RDP Properties, like Device Redirection, Display Settings and Session behavior. Some other security settings, like Screen capture protection and Watermarking must be set by the GPO or Intune, by using the <a href="https://learn.microsoft.com/en-us/azure/virtual-desktop/administrative-template?tabs=group-policy-domain">AVD Administrative Template</a>. Once you install the templates the policy settings will be available under Azure Virtual Desktop administrative template is available, browse to Computer Configuration &gt; Policies &gt; Administrative Templates &gt; Windows Components &gt; Remote Desktop Services &gt; Remote Desktop Session Host &gt; Azure Virtual Desktop.</p>



<ul style="line-height:1.5" class="wp-block-list">
<li style="line-height:1.5"><a href="https://learn.microsoft.com/en-us/azure/virtual-desktop/screen-capture-protection">Screen capture protection in Azure Virtual Desktop &#8211; Azure | Microsoft Learn</a></li>



<li style="line-height:1.5"><a href="https://learn.microsoft.com/en-us/azure/virtual-desktop/watermarking">Watermarking in Azure Virtual Desktop | Microsoft Learn</a></li>
</ul>



<p>In addition, the Hosts can be hardened by using GPO or/and <a href="https://learn.microsoft.com/en-us/mem/intune/fundamentals/azure-virtual-desktop">Intune</a>. </p>



<h2 class="wp-block-heading" id="monitor">Monitoring</h2>



<p>Azure Virtual Desktop Insights have plenty of information about Connection Reliability, Diagnostics, Performance, Users, Utilization, Clients and alerts out-of-the-box. You can customize the Insights dashboards and you can create a Workbook that fit your needs.</p>



<figure class="wp-block-image size-large"><a href="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-42.png"><img loading="lazy" decoding="async" width="1024" height="475" src="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-42-1024x475.png" alt="" class="wp-image-4161" srcset="https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-42-1024x475.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-42-300x139.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-42-768x356.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-42-1320x612.png 1320w, https://www.cloudcorner.gr/wp-content/uploads/2024/04/image-42.png 1358w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
<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:proxi&#109;&#097;&#103;r&#064;hot&#109;&#097;&#105;&#108;.&#099;om" 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-virtual-desktop-avd-lab%2F&amp;linkname=Azure%20Virtual%20Desktop%20%28AVD%29%20LAB" 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-virtual-desktop-avd-lab%2F&amp;linkname=Azure%20Virtual%20Desktop%20%28AVD%29%20LAB" 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-virtual-desktop-avd-lab%2F&#038;title=Azure%20Virtual%20Desktop%20%28AVD%29%20LAB" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/azure-virtual-desktop-avd-lab/" data-a2a-title="Azure Virtual Desktop (AVD) LAB"><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-virtual-desktop-avd-lab/">Azure Virtual Desktop (AVD) LAB</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-virtual-desktop-avd-lab/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure Firewall Policy Rules to CSV</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/azure-firewall-policy-rules-to-csv/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/azure-firewall-policy-rules-to-csv/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Sat, 12 Feb 2022 08:21:53 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure firewall]]></category>
		<category><![CDATA[azure firewall policies]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[powershell]]></category>
		<guid isPermaLink="false">https://www.cloudcorner.gr/?p=3903</guid>

					<description><![CDATA[<p>Azure Firewall is a virtual network firewall service that provides your resources in an Azure Virtual Network. It&#8217;s a firewall</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-firewall-policy-rules-to-csv/">Azure Firewall Policy Rules to CSV</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Azure Firewall is a virtual network firewall service that provides your resources in an Azure Virtual Network. It&#8217;s a firewall as a service, build on the cloud for the cloud. It provides both east-west and north-south traffic inspection. Some features are Threat Intelligence, DNAT, SNAT, Application &amp; Network filtering rules, DNS Proxy, TLS Inspection, IDPS, URL Filtering, Web Categories. And as an Azure native service has built-in high availability and cloud scalability.</p>



<p>There is plenty of information and guides for Azure Firewall at the Microsoft Docs <a href="https://docs.microsoft.com/en-us/azure/firewall/">Azure Firewall documentation | Microsoft Docs</a>. In this post, I want to share some PowerShell scripts that we created with my colleague Panagiotis Tsoukias. One script to Export all Firewall Policy rules, of all Policy Groups in a CSV file. Then edit the rules in Excel.  And a second script to import the rules to the same or to a different Firewall Policy.</p>



<h2 class="wp-block-heading" id="export-the-azure-firewall-policy-rules">Export the Azure Firewall Policy Rules</h2>



<p>The first script is to Export the Firewall Policy Rules of a Rule Collection, in a manageable CSV format. Edit the script, change the first three variables, and the path to export, and run it. Open the exported CSV with Microsoft Excel and you will have this result:</p>



<figure class="wp-block-image size-large"><a href="https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-5.png"><img loading="lazy" decoding="async" width="1024" height="87" src="https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-5-1024x87.png" alt="csv export" class="wp-image-3905" srcset="https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-5-1024x87.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-5-300x26.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-5-768x66.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2022/02/image-5.png 1090w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>The first three columns are the Rule Collection&#8217;s Name, Priority &amp; Action Type. We will need this info to create the Rule Collections and import the rules to the corresponding Rule Collection.</p>



<p>You can copy the script from the below box or download it from my GitHub link: <strong><a href="https://github.com/proximagr/automation/blob/master/Export%20Azure%20Firewall%20Policy%20Rules.ps1">Export Azure Firewall Policy Rules.ps1</a></strong></p>



<pre class="EnlighterJSRAW" data-enlighter-language="powershell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#Provide Input. Firewall Policy Name, Firewall Policy Resource Group &amp; Firewall Policy Rule Collection Group Name
$fpname = azfwpolicy
$fprg = azurehub
$fprcgname = DefaultNetworkRuleCollectionGroup

$fp = Get-AzFirewallPolicy -Name $fpname -ResourceGroupName $fprg
$rcg = Get-AzFirewallPolicyRuleCollectionGroup -Name $fprcgname -AzureFirewallPolicy $fp

$returnObj = @()
foreach ($rulecol in $rcg.Properties.RuleCollection) {

foreach ($rule in $rulecol.rules)
{
$properties = [ordered]@{
    RuleCollectionName = $rulecol.Name;
    RulePriority = $rulecol.Priority;
    ActionType = $rulecol.Action.Type;
    RUleConnectionType = $rulecol.RuleCollectionType;
    Name = $rule.Name;
    protocols = $rule.protocols -join ", ";
    SourceAddresses = $rule.SourceAddresses -join ", ";
    DestinationAddresses = $rule.DestinationAddresses -join ", ";
    SourceIPGroups = $rule.SourceIPGroups -join ", ";
    DestinationIPGroups = $rule.DestinationIPGroups -join ", ";
    DestinationPorts = $rule.DestinationPorts -join ", ";
    DestinationFQDNs = $rule.DestinationFQDNs -join ", ";
}
$obj = New-Object psobject -Property $properties
$returnObj += $obj
}

#change c:\temp to the path to export the CSV
$returnObj | Export-Csv c:\temp\rules.csv -NoTypeInformation
}</pre>



<h2 class="wp-block-heading" id="import-the-azure-firewall-policy-rules">Import the Azure Firewall Policy Rules</h2>



<p>After done editing the rules in Excel, we are ready to import them back to the Azure Policy or to a new Azure Policy.  We need to export one CSV per Rule Collection. It will help us that the first column has the Rule Collection Name. Then run the import script. The script creates a Rule Collection, if it does not already exist, and adds the Rules in this specific Rule Collection.</p>



<p>You can copy the script from the below box or download it from my GitHub link: <strong><a href="https://github.com/proximagr/automation/blob/master/Import%20Azure%20Firewall%20Policy%20Rules.ps1">Import Azure Firewall Policy Rules.ps1</a></strong></p>



<pre class="EnlighterJSRAW" data-enlighter-language="powershell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#Provide Input. Firewall Policy Name, Firewall Policy Resource Group &amp; Firewall Policy Rule Collection Group Name
$fpname = azfwpolicy
$fprg = azurehub
$fprcgname = DefaultNetworkRuleCollectionGroup

$targetfp = Get-AzFirewallPolicy -Name $fpname -ResourceGroupName $fprg
$targetrcg = New-AzFirewallPolicyRuleCollectionGroup -Name $fprcgname -Priority 200 -FirewallPolicyObject $targetfp

$RulesfromCSV = @()
# Change the folder where the CSV is located
$readObj = import-csv C:\temp\rules.csv
foreach ($entry in $readObj)
{
    $properties = [ordered]@{
        RuleCollectionName = $entry.RuleCollectionName;
        RulePriority = $entry.RulePriority;
        ActionType = $entry.ActionType;
        Name = $entry.Name;
        protocols = $entry.protocols -split ", ";
        SourceAddresses = $entry.SourceAddresses -split ", ";
        DestinationAddresses = $entry.DestinationAddresses -split ", ";
        SourceIPGroups = $entry.SourceIPGroups -split ", ";
        DestinationIPGroups = $entry.DestinationIPGroups -split ", ";
        DestinationPorts = $entry.DestinationPorts -split ", ";
        DestinationFQDNs = $entry.DestinationFQDNs -split ", ";
    }
    $obj = New-Object psobject -Property $properties
    $RulesfromCSV += $obj
}

$RulesfromCSV
Clear-Variable rules
$rules = @()
foreach ($entry in $RulesfromCSV)
{
    $RuleParameter = @{
        Name = $entry.Name;
        Protocol = $entry.protocols
        sourceAddress = $entry.SourceAddresses
        DestinationAddress = $entry.DestinationAddresses
        DestinationPort = $entry.DestinationPorts
    }
    $rule = New-AzFirewallPolicyNetworkRule @RuleParameter
    $NetworkRuleCollection = @{
        Name = $entry.RuleCollectionName
        Priority = $entry.RulePriority
        ActionType = $entry.ActionType
        Rule       = $rules += $rule
    }
}

# Create a network rule collection
$NetworkRuleCategoryCollection = New-AzFirewallPolicyFilterRuleCollection @NetworkRuleCollection
# Deploy to created rule collection group
Set-AzFirewallPolicyRuleCollectionGroup -Name $targetrcg.Name -Priority 200 -RuleCollection $NetworkRuleCategoryCollection -FirewallPolicyObject $targetfp</pre>



<p>Feel free to take, edit, use &amp; comment on the scripts, you can find them at my repo:</p>


<div class="ebg-br-wrapper ebg-br-wrapper-dark-mode-on">
	<div class="ebg-br-background-image"></div>
	<div class="ebg-br-editmode egb-br-darkmode-status">
		<span class="egb-br-darkmode-status-img">Dark Mode</span>
	</div>
	<div class="ebg-br-avatar">
		<img loading="lazy" decoding="async" class="ebg-br-header-avatar" src="https://avatars.githubusercontent.com/u/4180413?v=4" alt="" width="150" height="150" />
	</div>
	<div class="ebg-br-main">
		<p class="ebg-br-title">
			<strong>
				<a target="_blank" rel="noopener noreferrer" href="https://github.com/proximagr/automation">
					automation
					<span class="screen-reader-text">(this link opens in a new window)</span>
				</a>
			</strong>
			<em>
				by<a target="_blank" rel="noopener noreferrer" href="https://github.com/proximagr">
					proximagr
					<span class="screen-reader-text">(this link opens in a new window)</span>
				</a>
			</em>
		</p>
		<p class="ebg-br-description"></p>
		<p class="ebg-br-footer">
			<span class="ebg-br-subscribers">
				<span class="ebg-br-background-image"></span>
				1 Subscriber			</span>
			<span class="ebg-br-watchers">
				<span class="ebg-br-background-image"></span>
				0 Watchers			</span>
			<span class="ebg-br-forks">
				<span class="ebg-br-background-image"></span>
				0 Forks			</span>
			<a target="_blank" rel="noopener noreferrer" class="ebg-br-link" href="https://github.com/proximagr/automation">
				Check out this repository on GitHub.com				<span class="screen-reader-text">(this link opens in a new window)</span>
			</a>
		</p>
	</div>
</div><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:pr&#111;&#120;&#105;ma&#103;r&#064;h&#111;t&#109;&#097;&#105;l&#046;&#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%2Fazure-firewall-policy-rules-to-csv%2F&amp;linkname=Azure%20Firewall%20Policy%20Rules%20to%20CSV" 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-firewall-policy-rules-to-csv%2F&amp;linkname=Azure%20Firewall%20Policy%20Rules%20to%20CSV" 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-firewall-policy-rules-to-csv%2F&#038;title=Azure%20Firewall%20Policy%20Rules%20to%20CSV" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/azure-firewall-policy-rules-to-csv/" data-a2a-title="Azure Firewall Policy Rules to CSV"><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-firewall-policy-rules-to-csv/">Azure Firewall Policy Rules to CSV</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-firewall-policy-rules-to-csv/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
			</item>
		<item>
		<title>Azure VM &#124; Add Multiple Data Disks v2</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/azure-vm-add-multiple-data-disks-v2/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/azure-vm-add-multiple-data-disks-v2/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Fri, 02 Jul 2021 08:26:54 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure vm]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[managed disks]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[windows server]]></category>
		<guid isPermaLink="false">http://ge08jfh8ds93sdf.azurewebsites.net/?p=3786</guid>

					<description><![CDATA[<p>This is a new version of my previous script Add multiple managed disks to Azure RM VM Changes: Shows the</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-vm-add-multiple-data-disks-v2/">Azure VM | Add Multiple Data Disks v2</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is a new version of my previous script <a href="/microsoft/add-multiple-managed-disks-to-azure-rm-vm/">Add multiple managed disks to Azure RM VM</a></p>
<p>Changes:</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>Shows the disk capacity of the VM and asks how many disks to add.</li>
<li>Prompts for the size of every disk</li>
<li>Checks for empty Luns to add the disks</li>
</ul>
</li>
</ul>
<pre class="EnlighterJSRAW" data-enlighter-language="powershell"># 1. You need to login to the Azure Rm Account

Login-AzAccount

# 2. The script will query the Subscriptions that the login account has access and will promt the user to select the target Subscription from the drop down list
 
$subscription = Get-AzSubscription | Out-GridView -Title "Select a Subscription" -PassThru
Select-AzSubscription -SubscriptionId $subscription.Id

# 3. The script will query the available VMs and promt to select the target VM from the VM list
 
$vm = Get-AzVM | Out-GridView -Title "Select the Virtual Machine to add Data Disks to" -PassThru

# 4. I set the storage type based on the OS disk. If you want to spesify somehting else you can cahnge this to: $storageType = StandardLRS or PremiumLRS etc.

$storageType = $VM.StorageProfile.OsDisk.ManagedDisk.StorageAccountType

# 5. Enter how many data disks you need to create

$VMdiskCapacity = ($VM.StorageProfile.DataDisks).Capacity
 
$diskquantity = Read-Host "How many disks you need to create? Max Capacity" $VMdiskCapacity "."

# 6. The script will promt for disk size, in GB

$diskSizeList = @()
for($i = 1; $i -le $diskquantity; $i++)
{
    $disk = (Read-Host "Disk " $i " Size")
    $diskSizeList += $disk
}
$diskSizeList

# 7. check for exisiting disks

$existinglun = @()
for($i = 0; $i -lt $VMdiskCapacity; $i++) {
    $existinglun += ($VM.StorageProfile.DataDisks)[$i].Lun
}

# 8. disks creation

for($i = 0; $i -lt $diskquantity; $i++)
{
$diskName = $vm.Name + "-DataDisk-" + $i.ToString()
$diskConfig = New-AzDiskConfig -AccountType $storageType -Location $vm.Location -CreateOption Empty -DiskSizeGB $diskSizeList[$i]
$DataDisk = New-AzDisk -DiskName $diskName -Disk $diskConfig -ResourceGroupName $vm.ResourceGroupName
for ($j = 0; $j -lt $VMdiskCapacity; $j++) {
    if ( $null -eq $existinglun[$j] ) {
        $nextLunIndex
        for ($k = 0; $k -lt $VMdiskCapacity; $k++ ) {
            $nextLunIndex = $k
            for ( $m = 0; $m -lt $VMdiskCapacity; $m++ ) {
                if ( $k -eq $existinglun[$m] ) {
                    $nextLunIndex = -1 
                    break 
                }
            }
            if ($nextLunIndex -ne -1 ) {
                break
            }
        }
        Add-AzVMDataDisk -VM $vm -Name $DiskName -CreateOption Attach -ManagedDiskId $DataDisk.Id -Lun $nextLunIndex
        $existinglun[$j] = $nextLunIndex
        break
    } 
}
}
Update-AzVM -VM $vm -ResourceGroupName $vm.ResourceGroupName</pre>
<p>You can download the script from: <a href="https://github.com/proximagr/automation/blob/master/Add-DataDisks-DIffSize_v3.ps1">https://github.com/proximagr/automation/blob/master/Add-DataDisks-DIffSize_v3.ps1</a></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;&#120;i&#109;a&#103;r&#064;ho&#116;ma&#105;&#108;.c&#111;&#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%2Fazure-vm-add-multiple-data-disks-v2%2F&amp;linkname=Azure%20VM%20%7C%20Add%20Multiple%20Data%20Disks%20v2" 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-add-multiple-data-disks-v2%2F&amp;linkname=Azure%20VM%20%7C%20Add%20Multiple%20Data%20Disks%20v2" 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-add-multiple-data-disks-v2%2F&#038;title=Azure%20VM%20%7C%20Add%20Multiple%20Data%20Disks%20v2" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/azure-vm-add-multiple-data-disks-v2/" data-a2a-title="Azure VM | Add Multiple Data Disks v2"><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-add-multiple-data-disks-v2/">Azure VM | Add Multiple Data Disks v2</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-add-multiple-data-disks-v2/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Learn Azure for Free using Sandbox!</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/learn-azure-for-free-using-sandbox/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/learn-azure-for-free-using-sandbox/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Fri, 13 Nov 2020 09:59:04 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure portal]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[microsoft azure]]></category>
		<category><![CDATA[microsoft learn]]></category>
		<category><![CDATA[powershell]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=3688</guid>

					<description><![CDATA[<p>Learn Azure for Free using Sandbox! Did you know that you can use Azure for free for learning purposes? And</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/learn-azure-for-free-using-sandbox/">Learn Azure for Free using Sandbox!</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Learn Azure for Free using Sandbox!</h1>
<p>Did you know that you can use Azure for free for learning purposes? And when I say free, i am not talking about the <a href="https://azure.microsoft.com/en-us/free/">free account</a> where you need to add your credit card and have 170€ credit. I am talking about a completely free environment to learn the Azure services and resources, but <strong>only for Learning purposes</strong>.</p>
<p>The Azure Sandbox is offered by the <a href="https://docs.microsoft.com/en-us/learn/">Microsoft Learn platform</a>. Microsoft Learn is a <strong>completely free</strong>, online training platform that provides interactive learning for Microsoft products and more.</p>
<p>The <a href="https://docs.microsoft.com/en-us/learn/support/faq?pivots=sandbox"><strong>Microsoft Learn sandbox</strong> </a>(sometimes called the Azure sandbox) is a <strong>free environment</strong> that you can use to explore Azure through Microsoft Learn content.</p>
<p>And the magic here is that <span style="font-size: 28px;"><b style="font-size: 28px;">you </b><span style="font-size: 28px;"><b>don&#8217;t </b></span><b style="font-size: 28px;">need an Azure account to use a sandbox! </b>All you need is a <a href="https://account.microsoft.com/account" data-linktype="external">Microsoft account</a> to sign in with. If you don&#8217;t have one, you can create one for free.</span></p>
<p>Take a look at this. This is the Microsoft Learn home page where you can select whatever learning path or module you want to follow.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-3700 " src="https://www.e-apostolidis.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free.png" width="592" height="211" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free.png 2071w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-300x107.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-1024x365.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-768x274.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-1536x547.png 1536w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-2048x730.png 2048w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-1320x470.png 1320w" sizes="auto, (max-width: 592px) 100vw, 592px" /></p>
<p>When you start a module that needs Microsoft Azure Access, there is an &#8220;<strong>Activate sandbox</strong>&#8221; button</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-3690 " src="https://www.e-apostolidis.gr/wp-content/uploads/2020/11/Pasted-into-1-1.png" width="616" height="369" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-1.png 1367w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-1-300x180.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-1-1024x613.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-1-768x460.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-1-1320x790.png 1320w" sizes="auto, (max-width: 616px) 100vw, 616px" /></p>
<p>When you press is, the only thing that you will be asked is to enter a mobile phone number, just for verification. It will not ask for credit card!</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-3691 " src="https://www.e-apostolidis.gr/wp-content/uploads/2020/11/Pasted-into-1-2.png" width="595" height="393" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-2.png 1375w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-2-300x198.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-2-1024x676.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-2-768x507.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-2-120x80.png 120w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-2-1320x872.png 1320w" sizes="auto, (max-width: 595px) 100vw, 595px" /></p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-3692 " src="https://www.e-apostolidis.gr/wp-content/uploads/2020/11/Pasted-into-1-3.png" width="571" height="159" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-3.png 1011w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-3-300x83.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-3-768x213.png 768w" sizes="auto, (max-width: 571px) 100vw, 571px" /></p>
<p>Once you verify your number, it will ask you to Review and accept the permissions to use Microsoft Azure using your Microsoft Account</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-3693 " src="https://www.e-apostolidis.gr/wp-content/uploads/2020/11/Pasted-into-1-4.png" width="579" height="178" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-4.png 1017w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-4-300x92.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-4-768x236.png 768w" sizes="auto, (max-width: 579px) 100vw, 579px" /></p>
<p>And the Sandbox environment is ready! You can have 10 Sandboxes per day, for 2 hours each.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-3694 " src="https://www.e-apostolidis.gr/wp-content/uploads/2020/11/Pasted-into-1-5.png" width="576" height="120" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-5.png 1202w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-5-300x63.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-5-1024x214.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-5-768x160.png 768w" sizes="auto, (max-width: 576px) 100vw, 576px" /></p>
<p>You can use Bash, PowerShell and the Azure Poral at will:</p>
<p>Bash:</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-3696 " src="https://www.e-apostolidis.gr/wp-content/uploads/2020/11/Pasted-into-1-7.png" width="574" height="65" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-7.png 1382w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-7-300x34.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-7-1024x116.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-7-768x87.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-7-1320x149.png 1320w" sizes="auto, (max-width: 574px) 100vw, 574px" /></p>
<p>PowerShell:</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-3702 " src="https://www.e-apostolidis.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-using-Sandbox.png" width="574" height="116" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-using-Sandbox.png 1440w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-using-Sandbox-300x61.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-using-Sandbox-1024x208.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-using-Sandbox-768x156.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-Learn-Azure-for-Free-using-Sandbox-1320x268.png 1320w" sizes="auto, (max-width: 574px) 100vw, 574px" /></p>
<p>Azure Portal:</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-3697 " src="https://www.e-apostolidis.gr/wp-content/uploads/2020/11/Pasted-into-1-8.png" width="581" height="326" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-8.png 1487w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-8-300x168.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-8-1024x574.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-8-768x431.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-8-1320x740.png 1320w" sizes="auto, (max-width: 581px) 100vw, 581px" /></p>
<p>You can use the Sandbox to complete the specific exercise, but you can also play around with the resources. You can see at the below screenshot, that except the two &#8220;webVM&#8221;s of the exercise, I have created a &#8220;test&#8221; VM directly from the portal.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-3698 " src="https://www.e-apostolidis.gr/wp-content/uploads/2020/11/Pasted-into-1-9.png" width="600" height="476" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-9.png 1146w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-9-300x238.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-9-1024x811.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2020/11/Pasted-into-1-9-768x609.png 768w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<p>Start your learning path at <a href="https://docs.microsoft.com/en-us/learn/">Microsoft Learn NOW</a>!</p>
<p>And remember: <strong>The sandbox may only be used to complete training on Microsoft Learn.</strong></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:pr&#111;&#120;&#105;m&#097;gr&#064;&#104;&#111;&#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%2Flearn-azure-for-free-using-sandbox%2F&amp;linkname=Learn%20Azure%20for%20Free%20using%20Sandbox%21" 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%2Flearn-azure-for-free-using-sandbox%2F&amp;linkname=Learn%20Azure%20for%20Free%20using%20Sandbox%21" 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%2Flearn-azure-for-free-using-sandbox%2F&#038;title=Learn%20Azure%20for%20Free%20using%20Sandbox%21" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/learn-azure-for-free-using-sandbox/" data-a2a-title="Learn Azure for Free using Sandbox!"><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/learn-azure-for-free-using-sandbox/">Learn Azure for Free using Sandbox!</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/learn-azure-for-free-using-sandbox/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Azure VM CMD &#038; PowerShell from the Portal</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/azure-vm-cmd-powershell-from-the-portal/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/azure-vm-cmd-powershell-from-the-portal/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Thu, 06 Jun 2019 13:18:33 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure portal]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[cmd]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[serial console]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=2660</guid>

					<description><![CDATA[<p>Azure VM CMD &#38; PowerShell from the Portal Today I was trying to troubleshoot an Azure VM. This VM is</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-vm-cmd-powershell-from-the-portal/">Azure VM CMD &#038; PowerShell from the Portal</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Azure VM CMD &amp; PowerShell from the Portal</h1>
<p>Today I was trying to troubleshoot an Azure VM. This VM is behind a Network Virtual Appliance (NVA) and at the subnet it has User Defined Routes (UDR) that routes the traffic to the NVA. We was troubleshooting the NVA and it was not possible to connect with RDP to the VM.</p>
<h2>Serial Console</h2>
<p>This is an excellent scenario to use the Serial Console. From the Azure Portal, portal.azure.com, navigate to the Azure VMs blade, scroll down to the Support + Troubleshooting section and select &#8220;Serial Console&#8221;</p>
<p id="txUqFfw"><img loading="lazy" decoding="async" class="alignnone wp-image-2661 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8e39a648d0.png" alt="azure vm cmd &amp; powershell" width="832" height="988" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8e39a648d0.png 832w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8e39a648d0-253x300.png 253w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8e39a648d0-768x912.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8e39a648d0-600x713.png 600w" sizes="auto, (max-width: 832px) 100vw, 832px" /></p>
<p>The Serial Console will initialise and after a while it will establish the connection and the prompt will be the SAC&gt;. If you encounter any errors establishing the SAC link, please follow this link: <a href="https://aka.ms/serialconsolewindows">https://aka.ms/serialconsolewindows</a></p>
<p>At the SAC&gt; prompt press help to list the available commands.</p>
<p id="eoEXtih"><img loading="lazy" decoding="async" class="alignnone wp-image-2663 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8e48b97951.png" alt="azure vm cmd &amp; powershell" width="722" height="416" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8e48b97951.png 722w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8e48b97951-300x173.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8e48b97951-600x346.png 600w" sizes="auto, (max-width: 722px) 100vw, 722px" /></p>
<p>Using the i command we can get the IP Address configuration of the VM</p>
<p id="QOWOWLn"><img loading="lazy" decoding="async" class="alignnone wp-image-2665 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8ed949b92a.png" alt="azure vm cmd &amp; powershell" width="638" height="92" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8ed949b92a.png 638w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8ed949b92a-300x43.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8ed949b92a-600x87.png 600w" sizes="auto, (max-width: 638px) 100vw, 638px" /></p>
<h2>Command Prompt</h2>
<p>To create a command prompt session, first enter &#8220;cmd&#8221;. This will create a session.</p>
<p id="hMGFGwZ"><img loading="lazy" decoding="async" class="alignnone wp-image-2667 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8eeff4cfd2.png" alt="azure vm cmd &amp; powershell" width="657" height="123" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8eeff4cfd2.png 657w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8eeff4cfd2-300x56.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8eeff4cfd2-600x112.png 600w" sizes="auto, (max-width: 657px) 100vw, 657px" /></p>
<p>To list the cmd sessions press &#8220;ch&#8221;</p>
<p id="mbcAcxX"><img loading="lazy" decoding="async" class="alignnone wp-image-2669 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8ef7f2c554.png" alt="azure vm cmd &amp; powershell" width="442" height="191" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8ef7f2c554.png 442w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8ef7f2c554-300x130.png 300w" sizes="auto, (max-width: 442px) 100vw, 442px" /></p>
<p>to select &amp; login to a cmd session press &#8220;ch -si #&#8221; where # is the channel number. At the below screen press Enter</p>
<p id="nYJObfG"><img loading="lazy" decoding="async" class="alignnone wp-image-2670 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8efabaceb2.png" alt="azure vm cmd &amp; powershell" width="571" height="238" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8efabaceb2.png 571w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8efabaceb2-300x125.png 300w" sizes="auto, (max-width: 571px) 100vw, 571px" /></p>
<p>At the next screen enter the admin credentials</p>
<p id="khekBOT"><img loading="lazy" decoding="async" class="alignnone wp-image-2671 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8f03ed1b86.png" alt="azure vm cmd &amp; powershell" width="443" height="181" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f03ed1b86.png 443w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f03ed1b86-300x123.png 300w" sizes="auto, (max-width: 443px) 100vw, 443px" /></p>
<p>and we have Command Prompt. At this command prompt we can use all cmd commands.</p>
<p id="OLScYAY"><img loading="lazy" decoding="async" class="alignnone wp-image-2672 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8f061d3edb.png" alt="azure vm cmd &amp; powershell" width="867" height="487" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f061d3edb.png 867w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f061d3edb-300x169.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f061d3edb-768x431.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f061d3edb-600x337.png 600w" sizes="auto, (max-width: 867px) 100vw, 867px" /></p>
<p>Some examples:</p>
<p>ping -t</p>
<p id="nXZchlN"><img loading="lazy" decoding="async" class="alignnone wp-image-2673 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8f0d3a60f8.png" alt="azure vm cmd &amp; powershell" width="430" height="257" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f0d3a60f8.png 430w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f0d3a60f8-300x179.png 300w" sizes="auto, (max-width: 430px) 100vw, 430px" /></p>
<p>dir</p>
<p id="byuRCoJ"><img loading="lazy" decoding="async" class="alignnone wp-image-2674 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8f0fb8e7c6.png" alt="azure vm cmd &amp; powershell" width="556" height="368" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f0fb8e7c6.png 556w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f0fb8e7c6-300x199.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f0fb8e7c6-120x80.png 120w" sizes="auto, (max-width: 556px) 100vw, 556px" /></p>
<p>enable telnet client:</p>
<p><strong style="padding: 0px; margin: 0px; list-style: none; border: 0px; outline: none; box-sizing: border-box; font-weight: 600; color: #27292d; font-family: Inter; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">dism /online /Enable-Feature /FeatureName:TelnetClient</strong></p>
<h2>PowerShell</h2>
<p>at the command prompt enter &#8220;PowerShell&#8221; and press Enter to open a PowerShell Session</p>
<p id="GNWmzox"><img loading="lazy" decoding="async" class="alignnone wp-image-2676 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8f14e24299.png" alt="azure vm cmd &amp; powershell" width="600" height="103" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f14e24299.png 600w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f14e24299-300x52.png 300w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<p>PowerShell example, disable windows firewall:</p>
<p>Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False</p>
<p id="nTpqCQi"><img loading="lazy" decoding="async" class="alignnone wp-image-2678 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8f34463a54.png" alt="azure vm cmd &amp; powershell" width="739" height="106" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f34463a54.png 739w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f34463a54-300x43.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f34463a54-600x86.png 600w" sizes="auto, (max-width: 739px) 100vw, 739px" /></p>
<p>and yes, its off</p>
<p id="FVCCTJF"><img loading="lazy" decoding="async" class="alignnone wp-image-2679 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/06/img_5cf8f3609d243.png" alt="azure vm cmd &amp; powershell" width="475" height="171" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f3609d243.png 475w, https://www.cloudcorner.gr/wp-content/uploads/2019/06/img_5cf8f3609d243-300x108.png 300w" sizes="auto, (max-width: 475px) 100vw, 475px" /></p>
<p>of course, for the firewall we could disable it using CMD</p>
<p>netsh advfirewall set allprofiles state off</p>
<p>PowerShell for conenction test: Test-NetConnection -Computername &#8220;hostname,IP,URL&#8221; -Port &#8220;portNumber&#8221;</p>
<p>For more example commands follow this link: <a href="https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/serial-console-cmd-ps-commands">https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/serial-console-cmd-ps-commands</a></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:pro&#120;im&#097;&#103;&#114;&#064;&#104;&#111;t&#109;&#097;&#105;&#108;&#046;&#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%2Fazure-vm-cmd-powershell-from-the-portal%2F&amp;linkname=Azure%20VM%20CMD%20%26%20PowerShell%20from%20the%20Portal" 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-cmd-powershell-from-the-portal%2F&amp;linkname=Azure%20VM%20CMD%20%26%20PowerShell%20from%20the%20Portal" 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-cmd-powershell-from-the-portal%2F&#038;title=Azure%20VM%20CMD%20%26%20PowerShell%20from%20the%20Portal" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/azure-vm-cmd-powershell-from-the-portal/" data-a2a-title="Azure VM CMD &amp; PowerShell from the Portal"><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-cmd-powershell-from-the-portal/">Azure VM CMD &#038; PowerShell from the Portal</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-cmd-powershell-from-the-portal/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure VM Antimalware Extension Management</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/azure-vm-antimalware-extension-management/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/azure-vm-antimalware-extension-management/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Sun, 31 Mar 2019 18:23:13 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[antimalware]]></category>
		<category><![CDATA[antivirus]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[az]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azurevm]]></category>
		<category><![CDATA[defender]]></category>
		<category><![CDATA[microsoft antimalware]]></category>
		<category><![CDATA[microsoft defender]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tags]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=2387</guid>

					<description><![CDATA[<p>Azure VM Antimalware Extension Management Azure VM Antimalware Extension Management has always been a tricky subject. You can easily enable</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-vm-antimalware-extension-management/">Azure VM Antimalware Extension Management</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1 style="text-align: left;">Azure VM Antimalware Extension Management</h1>
<p style="text-align: justify;">Azure VM Antimalware Extension Management has always been a tricky subject. You can easily enable the Microsoft Antimalware Extension from the Azure Portal upon the Azure VM creation or by using the Extensions blade. But after that, the management of the extension is somehow tricky. There is no way to manage the Microsoft Antimalware exclusion list and auto-scan setting from the portal or from inside the VM. Even using PowerShell there is not a single command to manage the Microsoft Antimalware settings.</p>
<p style="text-align: justify;">There is no need to point out that all VMs must have an Endpoint Protection Solution. Azure provides the ability to add an Endpoint Protection Solution to all Azure VMs. Microsoft Antimalware for Azure Virtual Machines is a real-time protection capability that helps identify and remove viruses, spyware, and other malicious software, with configurable alerts when known malicious or unwanted software attempts to install itself or run on your system and it is absolutely free. For the 3rd party extensions you need to add your key.</p>
<p style="text-align: justify;">For Windows Server VMs up to version 2012 R2, the extension will install the System Center Endpoint Protection client and apply the configuration policies. Windows Server 2016 and above have build-in the Windows Defender, so the extension will only apply the configuration.</p>
<p>Below we will walk through on how to deploy &amp; manage the Microsoft Antimalware Extension Using the <strong><a href="#portal">Azure Portal (Single VM)</a>, </strong>Using the <strong><a href="#asc">Azure Security Center (Multiple VMs)</a></strong>and Using <strong><a href="#singlevm">PowerShell for a Single VM</a></strong>and <strong><a href="#multivmrg">for Multiple VMs filtered by Resource Groups </a></strong>or <strong><a href="#multivmtags">Tags</a>.</strong></p>
<h2 style="text-align: justify;">Deploy the Microsoft Antimalware Extension</h2>
<h3 style="text-align: justify;"><a id="portal"></a>Using the Azure Portal for single VM deployment</h3>
<p style="text-align: justify;">Go to the Azure VM&#8217;s blade, navigate to the Extensions section and press Add.</p>
<p id="TEeDKhy" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2499 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0ed33ac441.png" alt="microsoft antimalware" width="743" height="475" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed33ac441.png 743w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed33ac441-300x192.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed33ac441-600x384.png 600w" sizes="auto, (max-width: 743px) 100vw, 743px" /></p>
<p style="text-align: justify;">Select the Microsoft Antimalware extension and press Create</p>
<p id="tirjqKm" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2500 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0ed79238b1.png" alt="microsoft antimalware" width="628" height="247" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed79238b1.png 628w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed79238b1-300x118.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed79238b1-600x236.png 600w" sizes="auto, (max-width: 628px) 100vw, 628px" /></p>
<p style="text-align: justify;">Fill the &#8220;Install extension&#8221; form as desired and press OK. Here we can set the exclusions and the scan  type and schedule.</p>
<p id="ureoQSb" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2501 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d.png" alt="microsoft antimalware" width="581" height="900" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d.png 581w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d-194x300.png 194w" sizes="auto, (max-width: 581px) 100vw, 581px" /></p>
<h2 style="text-align: justify;"><a id="asc"></a>Using the Azure Security Center for multi VM deployment</h2>
<p style="text-align: justify;">Go to the Azure Security Center, navigate to &#8220;Compute &amp; Apps&#8221; and click &#8220;Install endpoint protection solution on virtual machines&#8221;</p>
<p id="lzlorCc" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2503 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0ef8a831e5.png" alt="microsoft antimalware" width="689" height="625" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ef8a831e5.png 689w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ef8a831e5-300x272.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ef8a831e5-600x544.png 600w" sizes="auto, (max-width: 689px) 100vw, 689px" /></p>
<p style="text-align: justify;">The Azure Security Center will check which VMs does not have Endpoint Protection and will check them all. Press &#8220;Install on # VMs&#8221; to select the extension</p>
<p id="lRCNkXB" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2504 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0f16488ced.png" alt="microsoft antimalware" width="624" height="533" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0f16488ced.png 624w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0f16488ced-300x256.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0f16488ced-600x513.png 600w" sizes="auto, (max-width: 624px) 100vw, 624px" /></p>
<p style="text-align: justify;">Select &#8220;Microsoft Antimalware&#8221; and press create</p>
<p id="pmQCFtC" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2505 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0f1b89bcd7.png" alt="microsoft antimalware" width="559" height="126" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0f1b89bcd7.png 559w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0f1b89bcd7-300x68.png 300w" sizes="auto, (max-width: 559px) 100vw, 559px" /></p>
<p style="text-align: justify;">Fill the &#8220;Install extension&#8221; form as desired and press OK. Here we can set the exclusions and the scan  type and schedule.</p>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2501 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d.png" alt="microsoft antimalware" width="581" height="900" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d.png 581w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d-194x300.png 194w" sizes="auto, (max-width: 581px) 100vw, 581px" /></p>
<h2 style="text-align: justify;">Using the PowerShell for single and multi VM deployments</h2>
<h3 style="text-align: justify;"><a id="singlevm"></a>Single VM</h3>
<p style="text-align: justify;">Declare the variables</p>
<pre class="lang:ps decode:true ">$ResourceGroupName = "devrg"
$VMName = "devrgvm"
$Location = "West Europe"
$PublisherName = "Microsoft.Azure.Security"
$Type = "IaaSAntimalware"</pre>
<p style="text-align: justify;">Get the latest major version</p>
<pre class="lang:ps decode:true">#view all versions for the West Europe location
Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type | fl Version
#view the latest major version
((Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type).Version[-1][0..2] -join '')
#add the latest major version in a variable called "amversion"
$amversion = ((Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type).Version[-1][0..2] -join '')</pre>
<p style="text-align: justify;">Set the Microsoft Antimalware Settings, exclusions and schedules</p>
<pre class="lang:ps decode:true">$amsettings = @'
{
    "AntimalwareEnabled": true,
    "RealtimeProtectionEnabled": true,
    "ScheduledScanSettings": {
        "isEnabled": true,
        "day": 7,
        "time": 120,
        "scanType": "Quick"
    },
    "Exclusions": {
        "Extensions": ".log;.ldf",   
        "Paths": "D:\\IISlogs;D:\\DatabaseLogs",
        "Processes": "mssence.svc"
    }
}
'@</pre>
<h3 style="text-align: justify;">Enable the Microsoft Antimalware Extension at one Azure VM</h3>
<pre class="lang:ps decode:true">Set-AzVMExtension -ResourceGroupName $ResourceGroupName -VMName $VMName -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $Location -TypeHandlerVersion $amversio -ResourceGroupName $ResourceGroupName -VMName $Name -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $Location -TypeHandlerVersion $amversio</pre>
<p style="text-align: justify;">The whole scipt</p>
<pre class="lang:ps decode:true">Login-AzAccount
#variables
$ResourceGroupName = "devrg"
$VMName = "devrgvm"
$Location = "West Europe"
$PublisherName = "Microsoft.Azure.Security"
$Type = "IaaSAntimalware"
#Get the latest major version
$amversion = ((Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type).Version[-1][0..2] -join '')
#Antimalware extension settings, exclusions and schedules
$amsettings = @'
{
    "AntimalwareEnabled": true,
    "RealtimeProtectionEnabled": true,
    "ScheduledScanSettings": {
        "isEnabled": true,
        "day": 7,
        "time": 120,
        "scanType": "Quick"
    },
    "Exclusions": {
        "Extensions": ".log;.ldf",   
        "Paths": "D:\\IISlogs;D:\\DatabaseLogs",
        "Processes": "mssence.svc"
    }
}
'@
#enable the Microsoft Antimalware Extension with the above settings
Set-AzVMExtension -ResourceGroupName $ResourceGroupName -VMName $VMName -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $Location -TypeHandlerVersion $amversion</pre>
<h3 style="text-align: justify;"><a id="multivmrg"></a>Multi VM &#8211; All VMs in a Resource Group</h3>
<p style="text-align: justify;">To deploy the extension to multiple VMs use the &#8220;For Each-Object&#8221; loop, like this:</p>
<pre class="lang:ps decode:true ">#enable the Microsoft Antimalware Extension with the above settings to all VMs in the Resource Group
Get-AzVM -ResourceGroupName $ResourceGroupName | ForEach-Object {
    Set-AzVMExtension -ResourceGroupName $_.ResourceGroupName -VMName $_.Name -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $_.Location -TypeHandlerVersion $amversion
    }</pre>
<p style="text-align: justify;">The whole script</p>
<pre class="lang:ps decode:true">#Login-AzAccount
#variables
$Location = "West Europe"
$PublisherName = "Microsoft.Azure.Security"
$Type = "IaaSAntimalware"
#Get the latest major version
$amversion = ((Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type).Version[-1][0..2] -join '')
#Antimalware extension settings, exclusions and schedules
$amsettings = @'
{
    "AntimalwareEnabled": true,
    "RealtimeProtectionEnabled": true,
    "ScheduledScanSettings": {
        "isEnabled": true,
        "day": 7,
        "time": 120,
        "scanType": "Quick"
    },
    "Exclusions": {
        "Extensions": ".log;.ldf",   
        "Paths": "D:\\IISlogs;D:\\DatabaseLogs",
        "Processes": "mssence.svc"
    }
}
'@
#enable the Microsoft Antimalware Extension with the above settings to all VMs in the Resource Group
Get-AzVM -ResourceGroupName $ResourceGroupName | ForEach-Object {
    Set-AzVMExtension -ResourceGroupName $_.ResourceGroupName -VMName $_.Name -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $_.Location -TypeHandlerVersion $amversion
    }</pre>
<h2 style="text-align: justify;"><a id="multivmtags"></a>Using Tags instead of Resource Group to filter the VMs</h2>
<pre class="lang:ps decode:true ">Login-AzAccount
#variables (filter by tags)
$tagName = "Service"
$tagValue = "dev"
$Location = "West Europe"
$PublisherName = "Microsoft.Azure.Security"
$Type = "IaaSAntimalware"
#Get the latest major version
$amversion = ((Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type).Version[-1][0..2] -join '')
#Antimalware extension settings, excusions and schedules
$amsettings = @'
{
    "AntimalwareEnabled": true,
    "RealtimeProtectionEnabled": true,
    "ScheduledScanSettings": {
        "isEnabled": true,
        "day": 7,
        "time": 120,
        "scanType": "Quick"
    },
    "Exclusions": {
        "Extensions": ".log;.ldf",   
        "Paths": "D:\\IISlogs;D:\\DatabaseLogs",
        "Processes": "mssence.svc"
    }
}
'@
#enable the Microsoft Antimalware Extension with the above settings to all VMs of a spesific Tag
$tagResList = Get-AzResource -TagName $tagName -TagValue $tagValue
foreach($tagRes in $tagResList) { 
    Set-AzVMExtension -ResourceGroupName $tagRes.ResourceGroupName -VMName $tagRes.Name -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $tagRes.Location -TypeHandlerVersion $amversion
    }</pre>
<p style="text-align: justify;">After a successful deployment, at the VMs extensions, you will see an IaaS Antimalware extension with status &#8220;Provisioning succeeded&#8221;</p>
<p id="qBfxdXr" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2508 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676.png" alt="microsoft antimalware" width="1217" height="457" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676.png 1217w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676-300x113.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676-768x288.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676-1024x385.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676-600x225.png 600w" sizes="auto, (max-width: 1217px) 100vw, 1217px" /></p>
<h2 style="text-align: justify;">Change the settings in an existing deployment</h2>
<p style="text-align: justify;">After the first deployment / installation, to change any settings of the WIndows Defender  / Forefront Endpoint Protection, we need to run the same PowerShell after changing the required settings at the &#8220;#Antimalware extension settings, exclusions and schedules&#8221; section</p>
<p style="text-align: left;">Reference: https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/iaas-antimalware-windows</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:pro&#120;&#105;&#109;a&#103;&#114;&#064;&#104;&#111;t&#109;&#097;i&#108;.&#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%2Fazure-vm-antimalware-extension-management%2F&amp;linkname=Azure%20VM%20Antimalware%20Extension%20Management" 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-antimalware-extension-management%2F&amp;linkname=Azure%20VM%20Antimalware%20Extension%20Management" 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-antimalware-extension-management%2F&#038;title=Azure%20VM%20Antimalware%20Extension%20Management" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/azure-vm-antimalware-extension-management/" data-a2a-title="Azure VM Antimalware Extension Management"><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-antimalware-extension-management/">Azure VM Antimalware Extension Management</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-antimalware-extension-management/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Serverless Computing &#124; Check your expired public certificates</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/serverless-computing-check-your-expired-public-certificates/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/serverless-computing-check-your-expired-public-certificates/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Fri, 12 Oct 2018 09:41:29 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure function apps]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[serverless]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=2220</guid>

					<description><![CDATA[<p>Serverless Computing &#124; Check your expired public certificates Check for expired public certificates serverless, using an Azure Function App. Magically</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/serverless-computing-check-your-expired-public-certificates/">Serverless Computing | Check your expired public certificates</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1 style="text-align: justify;">Serverless Computing | Check your expired public certificates</h1>
<p style="text-align: justify;">Check for expired public certificates serverless, using an Azure Function App. Magically run the required PowerShell script directly at the Portal without deploying VMs or App Services. At this post I combine Azure Function Apps, with a PowerShell script to check the certificate expirations and the Send-MailMessage PowerShell function for sending emails directly from the PowerShell script.</p>
<h2 style="text-align: justify;">Setup the Azure Function App</h2>
<p style="text-align: justify;">At the Azure Portal, create a new Function App. Select Consumption Plan and .NET Runtime Stack</p>
<p id="MXzlFhG" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2226 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa628f28d7.png" alt="Azure Function App" width="565" height="798" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa628f28d7.png 565w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa628f28d7-212x300.png 212w" sizes="auto, (max-width: 565px) 100vw, 565px" /></p>
<p style="text-align: justify;">Once the Function App is created, we need to enable PowerShell language support. To do so, open it, select the Function App and at the Platform features tab, open the Application Settings</p>
<p id="OhAViFR" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2228 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa72059c9c.png" alt="Azure Function App" width="758" height="371" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa72059c9c.png 758w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa72059c9c-300x147.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa72059c9c-600x294.png 600w" sizes="auto, (max-width: 758px) 100vw, 758px" /></p>
<p style="text-align: justify;">Change the FUNCTIONS_EXTENSION_VERSION to ~1 and delete the FUNCTIONS_WORKER_RUNTIME line</p>
<p style="text-align: justify;">Before:</p>
<p id="xEnrOsO" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2230 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa7f11745d.png" alt="Azure Function App" width="715" height="296" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa7f11745d.png 715w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa7f11745d-300x124.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa7f11745d-600x248.png 600w" sizes="auto, (max-width: 715px) 100vw, 715px" /></p>
<p style="text-align: justify;">After:</p>
<p id="SIlnSos" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2231 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa85190469.png" alt="Azure Function App" width="746" height="301" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa85190469.png 746w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa85190469-300x121.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa85190469-600x242.png 600w" sizes="auto, (max-width: 746px) 100vw, 746px" /></p>
<h2 style="text-align: justify;">Create the Function</h2>
<p style="text-align: justify;">Once you click Save, go back to the Function App, select the &#8220;Functions&#8221; and press &#8220;New function&#8221;</p>
<p id="hCPzlED" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2232 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa883c7ab5.png" alt="Azure Function App" width="798" height="361" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa883c7ab5.png 798w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa883c7ab5-300x136.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa883c7ab5-768x347.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa883c7ab5-600x271.png 600w" sizes="auto, (max-width: 798px) 100vw, 798px" /></p>
<p style="text-align: justify;">If we change the application settings correctly, the &#8220;Experimental Language Support&#8221; option will appear. Enable it and the templates will be able to support PowerShell (And more languages). To get started click the &#8220;Time trigger&#8221; template.</p>
<p id="FMRGdTd" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2233 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa8d95fe43.png" alt="Azure Function App" width="825" height="314" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa8d95fe43.png 825w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa8d95fe43-300x114.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa8d95fe43-768x292.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa8d95fe43-600x228.png 600w" sizes="auto, (max-width: 825px) 100vw, 825px" /></p>
<p style="text-align: justify;">At the window, select &#8220;PowerShell&#8221; for language and set the schedule. &#8220;Enter a cron expression of the format &#8216;{second} {minute} {hour} {day} {month} {day of week}&#8217; to specify the schedule.&#8221;</p>
<p style="text-align: justify;">Entering 0 0 0 1 * * the function will run once per day</p>
<p id="igDGJif" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2234 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa9c9bedcd.png" alt="Azure Function App" width="547" height="574" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa9c9bedcd.png 547w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa9c9bedcd-286x300.png 286w" sizes="auto, (max-width: 547px) 100vw, 547px" /></p>
<h2 style="text-align: justify;">Add the PowerShell script</h2>
<p style="text-align: justify;">Once the Function is created, you will be directed to the &#8220;Function Name&#8221; run.ps1 file. There we can run PowerShell scripts.</p>
<p id="RlvLXyc" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2235 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bc06384d99f4.png" alt="Azure Function App" width="842" height="505" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc06384d99f4.png 842w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc06384d99f4-300x180.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc06384d99f4-768x461.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc06384d99f4-600x360.png 600w" sizes="auto, (max-width: 842px) 100vw, 842px" /></p>
<p style="text-align: justify;">Below is the script, change the required variables to fit your needs and paste it to the Function run.ps1 file. The variables that you need to change is:</p>
<p style="text-align: justify;">$WebsiteURLs | This is the list, comma separated, of the URLs you want to check for certificate expiration<br />
$From | The email address of the Sender<br />
$To | The email address of the Recipient<br />
$Cc | The email address of the CC Recipient<br />
$Subject | The subject of the email<br />
$SMTPServer | The email server you will use to send the emails. You can Use the SendGrid service from Azure that currenlty provides 25000 email per month for free. More details here: <a href="http://guidestomicrosoft.com/2016/02/17/configure-a-smtp-server-in-azure/">https://sendgrid.com/docs/API_Reference/SMTP_API/getting_started_smtp.html </a><br />
$SMTPPort | The port that the SMTP service requires<br />
$username | The username to authenticate to the SMTP Service<br />
$password = ConvertTo-SecureString &#8220;here you need to add the password in plain text&#8221; -AsPlainText -Force</p>
<pre class="lang:ps decode:true">$WebsiteURLs= @("e-apostolidis.gr","azureheads.gr")
$WebsitePort=443
$Threshold=120
$Severe=30
$ID=0

$body +=  "&lt;html&gt;&lt;body&gt;&lt;br&gt;"
$body +=  "&lt;font color =""darkblue""&gt;"
$body += "#	Website_URL:	Current Certificate:	Expiration Date:	Days Remaining:	Errors:"
foreach ($WebsiteURL in $WebsiteURLs){
$CommonName=$WebsiteURL
$ID+=1
Try{
$Conn = New-Object System.Net.Sockets.TcpClient($WebsiteURL,$WebsitePort) 
Try {
$Stream = New-Object System.Net.Security.SslStream($Conn.GetStream(),$false, {
param($sender, $certificate, $chain, $sslPolicyErrors) 
return $true
})
$Stream.AuthenticateAsClient($CommonName) 

$Cert = $Stream.Get_RemoteCertificate()
$CN=(($cert.Subject -split "=")[1] -split ",")[0]
$ValidTo = [datetime]::Parse($Cert.GetExpirationDatestring())

$ValidDays = $($ValidTo - [datetime]::Now).Days
if ($ValidDays -lt $Threshold) {
$fontcolor +=  "&lt;font color =darkgreen&gt;"
} 
if ($ValidDays -lt $Severe) {
$fontcolor +=  "&lt;font color =darkred&gt;"
}
$body += "&lt;br /&gt;"
$body += $fontcolor
$body += "$ID	$WebsiteURL	$CN	$ValidTo	$ValidDays"
}
Catch { Throw $_ }
Finally { $Conn.close() }
}
Catch {
$body += "&lt;br /&gt;"
$body +="&lt;font color=red&gt; gest &lt;/font&gt;"
$body += " $ID	$WebsiteURL"
$body +=  "&lt;/body&gt;&lt;/html&gt;"
}

}

$From = "alias@domain.gr"
$To = "alias@domain.gr"
$Cc = "alias@domain.gr"
$Subject = "check the certificates"

$SMTPServer = "mail.mailserver.gr"
$SMTPPort = "587"


$username = "username"
$password = ConvertTo-SecureString "password" -AsPlainText -Force
$mycred = New-Object System.Management.Automation.PSCredential($username, $password)
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { return $true }
Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject -SmtpServer $SMTPServer -UseSSL -port $SMTPPort -Credential ($mycred) -Body $body -BodyAsHtml</pre>
<p style="text-align: justify;">Press SAve &amp; Run and you are ready. Now on, once per day the script will run and it will sent an email with the certificates. Something like this:</p>
<p id="fYgDHmV" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2236 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bc0649bdf4ce.png" alt="Azure Function App" width="637" height="229" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc0649bdf4ce.png 637w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc0649bdf4ce-300x108.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc0649bdf4ce-600x216.png 600w" sizes="auto, (max-width: 637px) 100vw, 637px" /></p>
<p style="text-align: justify;">Feel free to play with the colors on the script. I have added Dark Green for the valid certificates and Red for those that is about to expire.</p>
<h2 style="text-align: justify;">Credits</h2>
<p style="text-align: justify;">Use this line to ignore the certificate check on the email server when sending the email</p>
<pre class="prettyprint prettyprinted"><span class="pun">[</span><span class="typ">System</span><span class="pun">.</span><span class="typ">Net</span><span class="pun">.</span><span class="typ">ServicePointManager</span><span class="pun">]::</span><span class="typ">ServerCertificateValidationCallback</span> <span class="pun">=</span> <span class="pun">{</span> <span class="kwd">return</span><span class="pln"> $true </span><span class="pun">}</span></pre>
<p style="text-align: justify;"><a href="https://social.technet.microsoft.com/Forums/windows/en-US/d9e9af2b-3bb9-4cb4-8046-dd0a092bc456/send-email-by-powershell?forum=winserverpowershell">https://social.technet.microsoft.com/Forums/windows/en-US/d9e9af2b-3bb9-4cb4-8046-dd0a092bc456/send-email-by-powershell?forum=winserverpowershell</a></p>
<p style="text-align: justify;">The basic script for checking for certificate revocation:</p>
<p style="text-align: justify;"><a href="https://isc.sans.edu/forums/diary/Assessing+Remote+Certificates+with+Powershell/20645/">https://isc.sans.edu/forums/diary/Assessing+Remote+Certificates+with+Powershell/20645/</a></p>
<p style="text-align: justify;">At his blog is the idea for sending emails with powershell with html:</p>
<p style="text-align: justify;"><a href="http://www.techtrek.io/send-automated-email-with-powershell/">http://www.techtrek.io/send-automated-email-with-powershell/</a></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;&#120;&#105;m&#097;gr&#064;ho&#116;&#109;&#097;i&#108;.&#099;om" 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%2Fserverless-computing-check-your-expired-public-certificates%2F&amp;linkname=Serverless%20Computing%20%7C%20Check%20your%20expired%20public%20certificates" 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%2Fserverless-computing-check-your-expired-public-certificates%2F&amp;linkname=Serverless%20Computing%20%7C%20Check%20your%20expired%20public%20certificates" 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%2Fserverless-computing-check-your-expired-public-certificates%2F&#038;title=Serverless%20Computing%20%7C%20Check%20your%20expired%20public%20certificates" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/serverless-computing-check-your-expired-public-certificates/" data-a2a-title="Serverless Computing | Check your expired public certificates"><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/serverless-computing-check-your-expired-public-certificates/">Serverless Computing | Check your expired public certificates</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/serverless-computing-check-your-expired-public-certificates/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure Start Point &#124; Point-to-Site VPN</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/azure-start-point-point-to-site-vpn/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/azure-start-point-point-to-site-vpn/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Tue, 12 Jun 2018 21:08:36 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure rm]]></category>
		<category><![CDATA[azure start point]]></category>
		<category><![CDATA[point-to-site]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[virtual network]]></category>
		<category><![CDATA[virtual network gateway]]></category>
		<category><![CDATA[vpn]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=1914</guid>

					<description><![CDATA[<p>Azure Start Point &#124; Point-to-Site VPN In this post series we will go through some basic steps on how to</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-start-point-point-to-site-vpn/">Azure Start Point | Point-to-Site VPN</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Azure Start Point | Point-to-Site VPN</h1>
<p>In this post series we will go through some basic steps on how to start with Microsoft Azure. At this post we will see how we can create Point-to-Site VPN connection with Azure.</p>
<p>If you don’t have an Azure Subscription, you can easily create a free trial by just going to <a href="https://azure.microsoft.com/en-us/free/" data-slimstat="5">https://azure.microsoft.com/en-us/free/</a></p>
<p>Create typical a VIrtual Network</p>
<p id="avTzoLL"><img loading="lazy" decoding="async" width="308" height="658" class="alignnone size-full wp-image-1908 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/06/img_5b20228473455.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b20228473455.png 308w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b20228473455-140x300.png 140w" sizes="auto, (max-width: 308px) 100vw, 308px" /></p>
<p>In order to create Point-to-Site VPN connection it needs a Virtual Network Gateway. Go to the Virtual Network, Subnets and add a Gateway Subnet.</p>
<p id="kiLVuPr"><img loading="lazy" decoding="async" width="505" height="468" class="alignnone size-full wp-image-1910 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/06/img_5b2024343b509.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2024343b509.png 505w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2024343b509-300x278.png 300w" sizes="auto, (max-width: 505px) 100vw, 505px" /></p>
<p>FInally we can add the Virtual Network Gateway. From the portal, create a Virtual Network Gateway resource and add it to the previously created Virtual Network.</p>
<p id="JUsPPae"><img loading="lazy" decoding="async" width="313" height="669" class="alignnone size-full wp-image-1911 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/06/img_5b20263f8acee.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b20263f8acee.png 313w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b20263f8acee-140x300.png 140w" sizes="auto, (max-width: 313px) 100vw, 313px" /></p>
<p>The Virtual Network Gateway can take up to 45 minutes to be created.</p>
<p>Once the Virtual Network Gateway is created we need one more step. To configure Point-to-site. Open the Virtual Network Gateway and press configure.</p>
<p id="YPfWjDz"><img loading="lazy" decoding="async" width="599" height="475" class="alignnone size-full wp-image-1913 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/06/img_5b202dc90828b.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b202dc90828b.png 599w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b202dc90828b-300x238.png 300w" sizes="auto, (max-width: 599px) 100vw, 599px" /></p>
<p>We will need a root and a client self-signed certificate to complete the setup. Using a WIndows 10 or Windows Server 2016 machine we can make use of the New-SelfSignedCertificate cmdlet that makes the process easy. The whole process is described here: <a href="https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-certificates-point-to-site">https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-certificates-point-to-site</a></p>
<p>For the root certificate run the below PowerShell using ISE:</p>
<pre class="lang:ps decode:true ">$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature `
-Subject "CN=prodevrootcert" -KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 2048 `
-CertStoreLocation "Cert:\CurrentUser\My" -KeyUsageProperty Sign -KeyUsage CertSign</pre>
<p>For the client certificate run the below PowerShell using ISE:</p>
<pre class="lang:ps decode:true">New-SelfSignedCertificate -Type Custom -DnsName ProDevChildCert -KeySpec Signature `
-Subject "CN=ProDevChildCert" -KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 2048 `
-CertStoreLocation "Cert:\CurrentUser\My" `
-Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2")</pre>
<p>Export the root certificate in cer format using MMC, open the Certificates snap-in and select &#8220;current user&#8221;. Find the root certificate under Personal &#8211;&gt; Certificates and right click &#8211;&gt; All Tasks export</p>
<p id="PSEWgMk"><img loading="lazy" decoding="async" width="679" height="458" class="alignnone size-full wp-image-1919 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/06/img_5b2031ed7aa91.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2031ed7aa91.png 679w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2031ed7aa91-300x202.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2031ed7aa91-600x405.png 600w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2031ed7aa91-120x80.png 120w" sizes="auto, (max-width: 679px) 100vw, 679px" /></p>
<p>Select to &#8220;not export the private key&#8221; and use Base64 encoded.</p>
<p id="bVAgGyk"><img loading="lazy" decoding="async" width="457" height="193" class="alignnone size-full wp-image-1920 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/06/img_5b203288e15e1.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b203288e15e1.png 457w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b203288e15e1-300x127.png 300w" sizes="auto, (max-width: 457px) 100vw, 457px" /></p>
<p>Now you have the prodevrootcert.cer</p>
<p>After that, export the client certificate by selecting &#8220;export the private key&#8221; , select the &#8220;include all certificates in the certification path&#8221; and the &#8220;enable certificate privacy&#8221;. Add a password and export it to pfx file.</p>
<p id="mVaxzmv"><img loading="lazy" decoding="async" width="259" height="111" class="alignnone size-full wp-image-1921 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/06/img_5b2032f2672e2.png" alt="" /></p>
<p>Now you have the prodevchildcert.pfx. This pfx file must be installed to all the client computers that will use this Point-to-Site connection.</p>
<p>Now lets go back to the Point-to-Site configuration page. Add an address pool that the VPN clients will use. This subnet must be different from the Virtual Network address space.</p>
<p id="MDRVWDz"><img loading="lazy" decoding="async" width="905" height="365" class="alignnone size-full wp-image-1922 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/06/img_5b2033859cca7.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2033859cca7.png 905w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2033859cca7-300x121.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2033859cca7-768x310.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2033859cca7-600x242.png 600w" sizes="auto, (max-width: 905px) 100vw, 905px" /></p>
<p>Then open the root certificate, the cer file, using notepad, copy the text between the Begin and End marks.</p>
<p id="YXTWkeA"><img loading="lazy" decoding="async" width="647" height="440" class="alignnone size-full wp-image-1923 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/06/img_5b2033f7e32a7.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2033f7e32a7.png 647w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2033f7e32a7-300x204.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b2033f7e32a7-600x408.png 600w" sizes="auto, (max-width: 647px) 100vw, 647px" /></p>
<p>Paste the certificate text to the &#8220;Root certificated&#8221; &#8211;&gt; Public certificate data&#8221; field and add a name to the &#8220;Name&#8221; field.</p>
<p id="YKByLUE"><img loading="lazy" decoding="async" width="1398" height="169" class="alignnone size-full wp-image-1924 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/06/img_5b20342cd032a.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b20342cd032a.png 1398w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b20342cd032a-300x36.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b20342cd032a-768x93.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b20342cd032a-1024x124.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2018/06/img_5b20342cd032a-600x73.png 600w" sizes="auto, (max-width: 1398px) 100vw, 1398px" /></p>
<p>Press Save and the &#8220;Download VPN Client&#8221; button will be enabled and we can download the VPN client.</p>
<p>In order to establish the VPN connection we need to install the VPN Client and the Client &#8220;pfx&#8221; certificate to the workstation.</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;roxim&#097;&#103;&#114;&#064;&#104;otmail.&#099;om" 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-start-point-point-to-site-vpn%2F&amp;linkname=Azure%20Start%20Point%20%7C%20Point-to-Site%20VPN" 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-start-point-point-to-site-vpn%2F&amp;linkname=Azure%20Start%20Point%20%7C%20Point-to-Site%20VPN" 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-start-point-point-to-site-vpn%2F&#038;title=Azure%20Start%20Point%20%7C%20Point-to-Site%20VPN" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/azure-start-point-point-to-site-vpn/" data-a2a-title="Azure Start Point | Point-to-Site VPN"><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-start-point-point-to-site-vpn/">Azure Start Point | Point-to-Site VPN</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-start-point-point-to-site-vpn/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Custom pfSense on Azure Rm &#124; a complete guide</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/custom-pfsense-on-azurerm-a-complete-guide/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/custom-pfsense-on-azurerm-a-complete-guide/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Wed, 03 Jan 2018 15:12:52 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure vm]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[custom routes]]></category>
		<category><![CDATA[custom vhd]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[pfSense]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[route tables]]></category>
		<category><![CDATA[udr]]></category>
		<category><![CDATA[upload vhd]]></category>
		<category><![CDATA[virtual network]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=1528</guid>

					<description><![CDATA[<p>Custom pfSense on Azure Rm &#124; a complete guide A complete guide on how to create a pfSense VM on</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/custom-pfsense-on-azurerm-a-complete-guide/">Custom pfSense on Azure Rm | a complete guide</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1 style="text-align: justify;">Custom pfSense on Azure Rm | a complete guide</h1>
<p style="text-align: justify;">A complete guide on how to create a pfSense VM on a local Hyper-V server, prepare it for Microsoft Azure, upload the disk to Azure and create a multi-NIC VM.</p>
<p style="text-align: justify;">Download the latest image from https://www.pfsense.org/download/</p>
<p id="UOGOgbu" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1719 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a46417942ce4.png" alt="pfsense" width="554" height="365" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46417942ce4.png 554w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46417942ce4-300x198.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46417942ce4-120x80.png 120w" sizes="auto, (max-width: 554px) 100vw, 554px" /></p>
<p style="text-align: justify;">Open Hyper-V Manager create a Generation 1 VM. I added 4096 ram, 2 cores, use VHD, add an extra NIC (for second interface)  and select the downloaded ISO. (create a fixed VHD as Azure supports only fixed VHDs for custom VMs)</p>
<p id="bWwoqGz" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1703 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a4612db0c33f.png" alt="pfsense" width="300" height="484" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4612db0c33f.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4612db0c33f-186x300.png 186w" sizes="auto, (max-width: 300px) 100vw, 300px" /></p>
<p style="text-align: justify;">Start the VM and at the first screen press enter.</p>
<p id="mIaxRHN" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1700 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a4611c229af2.png" alt="pfsense" width="626" height="384" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4611c229af2.png 626w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4611c229af2-300x184.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4611c229af2-600x368.png 600w" sizes="auto, (max-width: 626px) 100vw, 626px" /></p>
<p style="text-align: justify;">At all screens I accepted the default settings. Finally at the reboot prompt remove the installation ISO.</p>
<p style="text-align: justify;">There is no need to setup VLANs, select the second interface for WAN and the first for LAN.</p>
<p id="jLbbuSk" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1705 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a4614323b079.png" alt="pfsense" width="636" height="472" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4614323b079.png 636w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4614323b079-300x223.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4614323b079-600x445.png 600w" sizes="auto, (max-width: 636px) 100vw, 636px" /></p>
<p id="FNJPixZ" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1706 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a46147b409db.png" alt="pfsense" width="653" height="137" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46147b409db.png 653w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46147b409db-300x63.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46147b409db-600x126.png 600w" sizes="auto, (max-width: 653px) 100vw, 653px" /></p>
<p style="text-align: justify;">Once the pfSense is ready press 2 and change the LAN (hn0) interface IP to one at your network. Then select the option 14 to enable SSH.</p>
<p id="ZWseqdU" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1720 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a464549bd64f.png" alt="pfsense" width="633" height="438" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a464549bd64f.png 633w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a464549bd64f-300x208.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a464549bd64f-600x415.png 600w" sizes="auto, (max-width: 633px) 100vw, 633px" /></p>
<p style="text-align: justify;">Now we can login with putty, with username admin password pfsense and press 8 for Shell access.</p>
<p id="FNSfbHz" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1711 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a4619a436eb5.png" alt="pfsense" width="653" height="415" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4619a436eb5.png 653w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4619a436eb5-300x191.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a4619a436eb5-600x381.png 600w" sizes="auto, (max-width: 653px) 100vw, 653px" /></p>
<p style="text-align: justify;">The first thing is to update the packages running:</p>
<pre class="lang:sh decode:true ">pkg upgrade</pre>
<h2 style="text-align: justify;">Python</h2>
<p style="text-align: justify;">Then install Python, as it is requirement for the Azure Linux Agent.</p>
<p style="text-align: justify;">Search for Python packages running:</p>
<pre class="lang:sh decode:true ">pkg search python</pre>
<p id="jmunmwR" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1721 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a46475c9ca1b.png" alt="pfsense" width="631" height="112" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46475c9ca1b.png 631w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46475c9ca1b-300x53.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46475c9ca1b-600x106.png 600w" sizes="auto, (max-width: 631px) 100vw, 631px" /></p>
<p style="text-align: justify;">Install the latest Python package, setup tools and bash:</p>
<pre class="lang:sh decode:true">pkg install -y python27-2.7.14</pre>
<pre class="lang:ps decode:true">pkg search setuptools

pkg install py27-setuptools-36.2.2

ln -s /usr/local/bin/python /usr/local/bin/python2.7

pkg install -y bash</pre>
<h2 style="text-align: justify;">Azure Linux Agent</h2>
<p style="text-align: justify;">ref: <a href="https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/freebsd-create-upload-vhd">https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/freebsd-create-upload-vhd</a></p>
<pre class="lang:sh decode:true">pkg install git

git clone https://github.com/Azure/WALinuxAgent.git

cd WALinuxAgent

git tag

git checkout WALinuxAgent-2.1.1

git checkout WALinuxAgent-2.0.16

python setup.py install

ln -sf /usr/local/sbin/waagent /usr/sbin/waagent</pre>
<p style="text-align: justify;">check the agent is running:</p>
<pre class="lang:sh decode:true ">waagent -Version</pre>
<p id="XyDFgfJ" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1722 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a46540428ee9.png" alt="pfsense" width="536" height="54" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46540428ee9.png 536w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a46540428ee9-300x30.png 300w" sizes="auto, (max-width: 536px) 100vw, 536px" /></p>
<p style="text-align: justify;">One final step before uploading the VHD to Azure is to set the LAN interface as dhcp.</p>
<p style="text-align: justify;">This can be done by the web interface, go to https://lanaddress, login using admin / pfsense, and go to interfaces / LAN and select DHCPas ipv4 configuration.</p>
<p id="imfoSFv" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1725 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2017/12/img_5a469d4f2dd21.png" alt="pfsense" width="306" height="351" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a469d4f2dd21.png 306w, https://www.cloudcorner.gr/wp-content/uploads/2017/12/img_5a469d4f2dd21-262x300.png 262w" sizes="auto, (max-width: 306px) 100vw, 306px" /></p>
<p style="text-align: justify;">Now, shutdown the pfSense and upload it to Azure Storage.</p>
<p style="text-align: justify;">I use the Storage Explorer, <a href="https://azure.microsoft.com/en-us/features/storage-explorer/">https://azure.microsoft.com/en-us/features/storage-explorer/</a> a free and powerful tool to manage Azure Storage. Login to your Azure Account and press Upload. Select as Blob type: &#8220;Page blob&#8221;</p>
<p id="rlEuHoA" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1739 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4cc0ac27e62.png" alt="pfsense" width="855" height="649" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cc0ac27e62.png 855w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cc0ac27e62-300x228.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cc0ac27e62-768x583.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cc0ac27e62-600x455.png 600w" sizes="auto, (max-width: 855px) 100vw, 855px" /></p>
<p style="text-align: justify;">After the upload is completed we can create a multiple NIC VM. This cannot be accomplished from GUI. We will create this using PowerShell.</p>
<pre class="lang:ps decode:true ">$ResourceGroupName = "******"
$pfresourcegroup = "*******"
$StorageAccountName = "******"
$vnetname = "*****"
$location = "West Europe"
$vnet = Get-AzureRmVirtualNetwork -Name $vnetname -ResourceGroupName $ResourceGroupName
$backendSubnet = Get-AzureRMVirtualNetworkSubnetConfig -Name default -VirtualNetwork $vnet
$vmName="pfsense"
$vmSize="Standard_F1"
$vnet = Get-AzureRmVirtualNetwork -Name $vnetname -ResourceGroupName $ResourceGroupName
$pubip = New-AzureRmPublicIpAddress -Name "PFPubIP" -ResourceGroupName $pfresourcegroup -Location $location -AllocationMethod Dynamic
$nic1 = New-AzureRmNetworkInterface -Name "EXPFN1NIC1" -ResourceGroupName $pfresourcegroup -Location $location -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pubip.Id
$nic2 = New-AzureRmNetworkInterface -Name "EXPFN1NIC2" -ResourceGroupName $pfresourcegroup -Location $location -SubnetId $vnet.Subnets[0].Id
$VM = New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize
$VM | Set-AzureRmVMOSDisk `
            -VhdUri https://********.blob.core.windows.net/vhds/pfsensefix.vhd `
            -Name pfsenseos -CreateOption attach -Linux -Caching ReadWrite
$vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nic1.Id
$vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nic2.Id
$vm.NetworkProfile.NetworkInterfaces.Item(0).Primary = $true
New-AzureRMVM -ResourceGroupName $pfresourcegroup -Location $locationName -VM $vm -Verbose</pre>
<p style="text-align: justify;">Once the VM is created, go to the VM&#8217;s blade and scroll down to &#8220;Boot diagnostics&#8221;. There you can see a screenshot of the VM&#8217;s monitor.</p>
<p id="acIPyky" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1744 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4cddde2157b.png" alt="pfsense" width="1002" height="707" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cddde2157b.png 1002w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cddde2157b-300x212.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cddde2157b-768x542.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cddde2157b-600x423.png 600w" sizes="auto, (max-width: 1002px) 100vw, 1002px" /></p>
<p style="text-align: justify;">Then go to the Networking section and SSH to the Public IP.</p>
<p id="RpmtQJA" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1746 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ce2adeacc3.png" alt="pfsense" width="673" height="547" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce2adeacc3.png 673w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce2adeacc3-300x244.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce2adeacc3-600x488.png 600w" sizes="auto, (max-width: 673px) 100vw, 673px" /></p>
<p style="text-align: justify;">and also we can login to the Web Interface of the pfSense</p>
<p id="RTPgdSW" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1747 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ce3fe0353a.png" alt="pfsense" width="882" height="630" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce3fe0353a.png 882w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce3fe0353a-300x214.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce3fe0353a-768x549.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce3fe0353a-600x429.png 600w" sizes="auto, (max-width: 882px) 100vw, 882px" /></p>
<p id="YIHfCde" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1748 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1.png" alt="pfsense" width="1161" height="857" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1.png 1161w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1-300x221.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1-768x567.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1-1024x756.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce85fe97a1-600x443.png 600w" sizes="auto, (max-width: 1161px) 100vw, 1161px" /></p>
<p style="text-align: justify;">In my case I have added both NICs at the same Subnet, but at a production environment add the LAN interface to the backend subnet and the WAN interface to the DMZ (public) subnet.</p>
<p style="text-align: justify;">Of course more NICs can be added to the VM, one for each Subnet at our environment.</p>
<h2 style="text-align: justify;">Route external traffic through the pfSense</h2>
<p style="text-align: justify;">We cannot change the gateway at an Azure VM, but we can use routing tables to route the traffic through the pfSense.</p>
<p style="text-align: justify;">From the Azure Portal, select New and search for Route table.</p>
<p id="OKjEcPT" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1749 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b.png" alt="pfsense" width="1037" height="309" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b.png 1037w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b-300x89.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b-768x229.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b-1024x305.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ce9f90f26b-600x179.png 600w" sizes="auto, (max-width: 1037px) 100vw, 1037px" /></p>
<p style="text-align: justify;">We need to configure two things. One is to associate the Route table to a Subnet and the second is to create a Route.</p>
<p id="uHNKvMv" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1750 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ceae539c0b.png" alt="pfsense" width="232" height="111" /></p>
<p style="text-align: justify;">Open the &#8220;Route table&#8221; and click the &#8220;Routes&#8221;. Press &#8220;Add route&#8221; and in order to route all outbound traffic through the pfSense then add for Address prefix &#8220;0.0.0.0&#8221;, next hop type Virtual appliance&#8221; and Net hop address the ip address of the pfSense&#8217;s LAN interface IP.</p>
<p id="feCVtbZ" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-1751 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4cec67cf571.png" alt="pfsense" width="569" height="302" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cec67cf571.png 569w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4cec67cf571-300x159.png 300w" sizes="auto, (max-width: 569px) 100vw, 569px" /></p>
<p>Then go to the &#8220;Subnets&#8221; and associate the required subnets.</p>
<p id="IgXjKZN"><img loading="lazy" decoding="async" class="alignnone wp-image-1753 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4.png" alt="pfsense" width="1068" height="430" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4.png 1068w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4-300x121.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4-768x309.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4-1024x412.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2018/01/img_5a4ced5dacef4-600x242.png 600w" sizes="auto, (max-width: 1068px) 100vw, 1068px" /></p>
<p>One final thing to do is to enable IP Forwarding at the LAN interface of the pfSense, in order to be able to receive and forward traffic not originated for it.</p>
<p id="vsIVpQc"><img loading="lazy" decoding="async" width="907" height="321" class="alignnone size-full wp-image-1807 " src="https://www.e-apostolidis.gr/wp-content/uploads/2018/02/img_5a83ec9159a98.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/02/img_5a83ec9159a98.png 907w, https://www.cloudcorner.gr/wp-content/uploads/2018/02/img_5a83ec9159a98-300x106.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/02/img_5a83ec9159a98-768x272.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/02/img_5a83ec9159a98-600x212.png 600w" sizes="auto, (max-width: 907px) 100vw, 907px" /></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;o&#120;&#105;&#109;a&#103;&#114;&#064;&#104;o&#116;&#109;a&#105;&#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%2Fcustom-pfsense-on-azurerm-a-complete-guide%2F&amp;linkname=Custom%20pfSense%20on%20Azure%20Rm%20%7C%20a%20complete%20guide" 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%2Fcustom-pfsense-on-azurerm-a-complete-guide%2F&amp;linkname=Custom%20pfSense%20on%20Azure%20Rm%20%7C%20a%20complete%20guide" 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%2Fcustom-pfsense-on-azurerm-a-complete-guide%2F&#038;title=Custom%20pfSense%20on%20Azure%20Rm%20%7C%20a%20complete%20guide" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/custom-pfsense-on-azurerm-a-complete-guide/" data-a2a-title="Custom pfSense on Azure Rm | a complete guide"><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/custom-pfsense-on-azurerm-a-complete-guide/">Custom pfSense on Azure Rm | a complete guide</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/custom-pfsense-on-azurerm-a-complete-guide/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
	</channel>
</rss>
