<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Cloud Blog]]></title><description><![CDATA[Thoughts, stories and ideas.]]></description><link>http://raghuram-blog.azurewebsites.net/</link><generator>Ghost 0.9</generator><lastBuildDate>Thu, 09 Apr 2026 10:53:59 GMT</lastBuildDate><atom:link href="http://raghuram-blog.azurewebsites.net/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[App Innovation Circle - 2018 (App Dev)]]></title><description><![CDATA[<p>Microsoft often organizes a training event named "<strong>App Innovation Circle</strong>". The event was held across multiple cities and I got an opportunity to deliver a session twice 14th April and 28th Sept at Microsoft, Hyderabad. </p>

<p>Every session I deliver end up with a different experience for me where not only</p>]]></description><link>http://raghuram-blog.azurewebsites.net/app-innovation-circle-2018-app-dev/</link><guid isPermaLink="false">2bace84d-ec61-44e9-a73f-a77472633845</guid><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Wed, 10 Oct 2018 07:50:28 GMT</pubDate><content:encoded><![CDATA[<p>Microsoft often organizes a training event named "<strong>App Innovation Circle</strong>". The event was held across multiple cities and I got an opportunity to deliver a session twice 14th April and 28th Sept at Microsoft, Hyderabad. </p>

<p>Every session I deliver end up with a different experience for me where not only attendees but even I get to learn multiple things from the people who attend my session and this is what I learn the most..!!(always a roller coaster)</p>

<p>As there is famous saying: <br>
<strong>..by doing what you love, you inspire and awaken the hearts of others..</strong></p>

<p>In this event I presented <strong>Deep Dive on Microsft Azure</strong> and <strong>Serverless Computing</strong> at App Innovation Circle 2018 event held at Microsoft IDC, Hyderabad</p>

<p>App Innovation Circle 2018 Agenda: <br>
<img src="https://farm1.staticflickr.com/881/39645562470_2931360950_z.jpg" alt="App Innovation Circle 2018"></p>

<p>Few pics from the Event: <a href="https://www.flickr.com/gp/kraghu_306/t05j15">https://www.flickr.com/gp/kraghu_306/t05j15</a></p>

<p>Few helpful links on Function Apps, Logic Apps, ASP.NET Core, and Container: <br>
<a href="https://drive.google.com/file/d/1370ZpRMdY63cDtMlg-7PRMA8omYtgiEm/view">Links</a>, <a href="https://1drv.ms/f/s!Aqd_Zd4hXkLdlEca6EpKY8ErQRud">PPT</a> </p>

<p>Finally, thanks Pranav, Shravan, Swetha(Microsoft) and the complete App Innovation Team for the assistance and each and every attendee for patiently listened to my session :P </p>

<p>Happy Learning...!! Do follow my blog for Azure Content :)</p>]]></content:encoded></item><item><title><![CDATA[Global Azure Bootcamp 2018]]></title><description><![CDATA[<p>It's always a pleasure to share knowledge with the community. Presenting <strong>Cloud Design Patterns</strong> at Global Azure Bootcamp 2018 @ Microsoft IDC Hyderabad, India.</p>

<p>Global Azure Bootcamp is always a huge event all around the world user groups and communities who want to learn about Azure and Cloud Computing.</p>

<p>The event</p>]]></description><link>http://raghuram-blog.azurewebsites.net/global-azure-bootcamp-2018/</link><guid isPermaLink="false">bd78f4ae-f359-4779-944a-f8eabb15bc6c</guid><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Sat, 21 Apr 2018 09:06:00 GMT</pubDate><content:encoded><![CDATA[<p>It's always a pleasure to share knowledge with the community. Presenting <strong>Cloud Design Patterns</strong> at Global Azure Bootcamp 2018 @ Microsoft IDC Hyderabad, India.</p>

<p>Global Azure Bootcamp is always a huge event all around the world user groups and communities who want to learn about Azure and Cloud Computing.</p>

<p>The event was a huge success with 8 speakers covering 8 different topics covering Azure Bot Service, DevOps using VSTS, Cloud Design Patterns, Deep Learning and Azure Encryption with over 300+ Azure enthusiast attendees.</p>

<p>Event details: <a href="https://themugh.github.io/gabc2018/">https://themugh.github.io/gabc2018/</a></p>

<p>Few pics from the Event: <a href="https://twitter.com/imkraghu/status/987747758336430080">https://twitter.com/imkraghu/status/987747758336430080</a></p>

<p>Special thanks to <a href="https://twitter.com/techieshravan">Shravan Kumar Kasagoni</a> and all Microsoft User Group Hyderabad Organisers for the opportunity.</p>

<p>Thanks to Global Azure Bootcamp Global Team and all the attendees who attended.</p>

<p>Keep Rocking on Cloud ☁</p>]]></content:encoded></item><item><title><![CDATA[App Innovation Circle - 2018]]></title><description><![CDATA[Details about App Innovation Circle - 2018, Hyderabad]]></description><link>http://raghuram-blog.azurewebsites.net/app-innovation-circle-2018/</link><guid isPermaLink="false">176514ff-a85a-4d12-a4d9-17b36057a488</guid><category><![CDATA[azure]]></category><category><![CDATA[Azure Function App]]></category><category><![CDATA[App-innovation-circle]]></category><category><![CDATA[Containers]]></category><category><![CDATA[Logic App]]></category><category><![CDATA[ASP.NET Core]]></category><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Sat, 14 Apr 2018 17:59:47 GMT</pubDate><content:encoded><![CDATA[<p>It's always been a pleasure to present on Microsoft Azure Cloud.</p>

<p>Had an amazing experience in presenting <strong>Deep Dive on Microsft Azure</strong> and <strong>Serverless Computing</strong> at App Innovation Circle 2018 event held at Microsoft IDC, Hyderabad</p>

<p>App Innovation Circle 2018 Agenda: <br>
<img src="https://farm1.staticflickr.com/881/39645562470_2931360950_z.jpg" alt="App Innovation Circle 2018"></p>

<p>Few pics from the Event: <a href="https://www.flickr.com/gp/kraghu_306/37C1Cm">https://www.flickr.com/gp/kraghu_306/37C1Cm</a></p>

<p>Few helpful links on Function Apps, Logic Apps, ASP.NET Core, and Container: <br>
<a href="https://drive.google.com/file/d/1370ZpRMdY63cDtMlg-7PRMA8omYtgiEm/view">Resources</a></p>

<p>Finally, I want to end this blog with an inspirational quote by a famous American writers William Arthur Ward who once said: <strong>"Curiosity is the Wick in the candle of Leaning"</strong>.</p>

<p>Happy Learning...!! Do follow my blog for Azure Content. :)</p>]]></content:encoded></item><item><title><![CDATA[Deploy Functions App to Azure using VS Code]]></title><description><![CDATA[This blog will walk you through the creation and deployment of a JavaScript Functions application using the Azure Functions extension in Visual Studio Code.]]></description><link>http://raghuram-blog.azurewebsites.net/deploy-functions-app-to-azure-using-vs-code/</link><guid isPermaLink="false">90a65380-1790-49f9-8095-6b4a52fc4869</guid><category><![CDATA[Azure Function App]]></category><category><![CDATA[VS Code]]></category><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Sun, 04 Mar 2018 17:07:00 GMT</pubDate><content:encoded><![CDATA[<p>This blog will walk you through the creation and deployment of a JavaScript Functions application using the Azure Functions extension in Visual Studio Code.</p>

<p>Prerequisites:</p>

<ol>
<li>Download <a href="https://code.visualstudio.com/">Visual Studio Code</a>  </li>
<li>Install <a href="https://nodejs.org/en/download/">Node.js and npm</a> <br>
<strong>Note:</strong> To enable local debugging, you need to install the <a href="https://github.com/Azure/azure-functions-core-tools#installing">Azure Functions Core Tools</a>.</li>
<li><p>Operating Systems:  </p>

<ul><li>For <strong>macOS</strong>, install using Homebrew.</li></ul>

<p><code>$ brew tap azure/functions</code></p>

<p><code>$ brew install azure-functions-core-tools</code></p>

<ul><li>For <strong>Windows</strong>, install using npm.</li></ul>

<p><code>$ npm install -g azure-functions-core-tools@core</code></p></li>
</ol>

<p>Once you have the prerequisites we can proceed by Installing the Azure Function Extension</p>

<p><a class="tutorial-install-extension-btn" href="vscode:extension/ms-azuretools.vscode-azurefunctions">Install the Azure Functions extension</a></p>

<p>Once the extension is installed, log into your <strong>Azure account</strong> - in the <strong>AZURE FUNCTIONS</strong> explorer, click <strong>Sign in to Azure...</strong> and follow the instructions.</p>

<p><img src="https://code.visualstudio.com/assets/tutorials/functions-extension/sign-in.png" alt="Azure login to VS Code"></p>

<p>Once logged in we should see our Azure email address in the status bar and the subscriptions in the <strong>AZURE FUNCTIONS</strong> explorer.</p>

<p>Verify that you have the Azure Functions tools installed by opening a terminal and running <code>$ func</code> <br>
<img src="https://farm1.staticflickr.com/798/39642885130_b51611b0b5_b.jpg" alt="Prerequisites-Check"></p>

<p>Once we have all set up we can quickly create a Function App </p>

<p>Follow the below image and choose an empty directory for the app and then select JavaScript for the language of your Functions App. </p>

<p><img src="https://farm1.staticflickr.com/885/40558585735_20796e7d36_b.jpg" alt="Create a Function App"></p>

<p><img src="https://code.visualstudio.com/assets/tutorials/functions-extension/create-function-app-project-language.png" alt="Select the Language"></p>

<p>Next, Choose a <strong>HTTP trigger</strong> Function for your function app and choose <strong>Anonymous</strong> authentication.</p>

<p><img src="https://farm1.staticflickr.com/888/26581663807_a104885ac9_b.jpg" alt="Select the Language"></p>

<p>Function app includes <code>index.js</code> and <code>functions.json</code> files. The <code>index.js</code> file contains the source code that responds to the <strong>HTTP request</strong> and <code>functions.json</code> contain the <a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings">binding configuration</a> for the HTTP trigger.</p>

<p><img src="https://farm1.staticflickr.com/813/39644141750_7fd585330e_b.jpg" alt="Select the Language"></p>

<p>Once done, let's run the function app locally by pressing <strong>F5</strong> which will launch the app locally and attach to the Azure Functions host(which is the same runtime that runs on Azure).</p>

<p><img src="https://farm1.staticflickr.com/900/40559713655_2df08b3625_b.jpg" alt="Executing Function App by pressing F5"></p>

<p>Now we can navigate to <a href="http://localhost:7071/api/HttpTriggerJS">http://localhost:7071/api/HttpTriggerJS</a> and pass the query parameter for the response, add <code>?name=&lt;yourname&gt;</code> to the localhost URL in the browser to see the response.</p>

<blockquote>
  <p><strong>NOTE:</strong> You can also set a breakpoint(by pressing F9) when running locally to test any changes just as we do in Visual Studio.</p>
</blockquote>

<p><img src="https://farm1.staticflickr.com/880/40739154794_f872725bda_z.jpg" alt="Executing Function App locally"></p>

<p>To deploy we can deploy from the <code>Command Palette (Ctrl+Shift+P)</code> by typing <strong>'deploy to function app'</strong> and running the Azure Functions: Deploy to Function App command or use the Azure Function extension:</p>

<p><img src="https://farm1.staticflickr.com/894/40739332514_430efaf121_z.jpg" alt="Executing Function App locally"></p>

<p>Follow the prompts in VS Code and Choose the directory of Function App, select your target Azure subscription, and then choose to Create New Function App or select an existing Function App, but if selected to create a new function app you might have to provide more details like below:</p>

<ol>
<li><p>Typing a unique name for the Function App.</p></li>
<li><p>Choose <strong>Create New Resource Group</strong>, type a resource group name, like <strong>myResourceGroup</strong> and press <strong>Enter</strong>.</p></li>
<li><p>Choose a <strong>location</strong> in a region near you or near other services you may need to access.</p></li>
<li><p>Choose to <strong>Create New Storage Account</strong>, type unique name for creating new storage account which will be used by the function app.  </p>

<blockquote>
  <p>Note: Storage account names must be less than 24 characters in length and should contain lower case and valid characters. </p>
</blockquote></li>
</ol>

<p>VS Code will create the Function app along with storage account.</p>

<p>We can check the Output panel which displays all the Azure resources that were created in the subscription.</p>

<p>Once deployed successfully we can navigate to the Function App endpoint and pass the query parameter for the response, add <code>?name=&lt;yourname&gt;</code> to the Function Endpoint URL in the browser to see the response.</p>

<p>Finally, we've successfully completed the creation and deployment of Function App using VS Code..!</p>

<p>Few resources on Function Apps:</p>

<ol>
<li><a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-scheduled-function">Create a function that runs on a schedule</a>  </li>
<li><a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-storage-queue-triggered-function">Create a function triggered by Storage queue messages</a>  </li>
<li><a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-generic-webhook-triggered-function">Create a function triggered by a generic webhook</a>  </li>
<li><a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-github-webhook-triggered-function">Create a function triggered by a GitHub webhook</a>  </li>
<li><a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-integrate-storage-queue-output-binding">Add messages to an Azure Storage queue using Functions</a>  </li>
<li><a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-integrate-store-unstructured-data-cosmosdb">Store unstructured data in Azure Cosmos DB using Functions</a></li>
</ol>

<p>Thanks for Reading..!! Do follow my blog for more stuff on Azure.</p>]]></content:encoded></item><item><title><![CDATA[Azure Global VNET Peering]]></title><description><![CDATA[Microsoft has expanded its supporting regions — enabling direct VM-to-VM connectivity without any public internet involvement or any extra hops]]></description><link>http://raghuram-blog.azurewebsites.net/azure-global-vnet-peering/</link><guid isPermaLink="false">1b973981-eeee-43ac-a147-2c2b7abd6a61</guid><category><![CDATA[azure]]></category><category><![CDATA[VNET-peering]]></category><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Sat, 20 Jan 2018 11:13:00 GMT</pubDate><content:encoded><![CDATA[<p>At Ignite, Microsoft has <a href="https://azure.microsoft.com/en-us/updates/global-vnet-peering-preview/">announced</a> that we can use Global VNet Peering to peer virtual networks across Azure regions. Today, Microsoft has expanded its supporting regions — enabling direct VM-to-VM connectivity without any public internet involvement or any extra hops.</p>

<p>With just a few clicks, we can use Global VNet Peering to connect virtual networks across Azure regions to share resources or create a global, private peered virtual network. This enables a variety of scenarios such as data replication, disaster recovery, and database failover through private IPs alone.</p>

<p>You can now peer across the following regions:</p>

<ul>
<li>Korea South</li>
<li>UK South</li>
<li>UK West</li>
<li>Canada East</li>
<li>India South</li>
<li>India Central</li>
<li>India West</li>
</ul>

<p>The new regions add to the previously announced regions:</p>

<ul>
<li>US West Central</li>
<li>Canada Central</li>
<li>US West 2</li>
</ul>

<p>For more information, refer to our <br>
<a href="https://docs.microsoft.com/en-us/azure/virtual-network/tutorial-connect-virtual-networks-portal#register">documentation</a>
and <a href="https://azure.microsoft.com/en-us/pricing/details/virtual-network/">pricing</a>.</p>]]></content:encoded></item><item><title><![CDATA[App Innovation Circle - 2017]]></title><description><![CDATA[<p>A famous American journalist <strong>Margaret Fuller</strong> once said: "If you have the knowledge, let others light their candles with it." </p>

<p>It's always been a pleasure to present on Microsoft Azure Cloud. </p>

<p>Special thanks to Pranav Ainavolu, Shravan Kumar Kasagoni and Microsoft folks for the opportunity </p>

<p>Had a wonderful time presenting</p>]]></description><link>http://raghuram-blog.azurewebsites.net/app-innovation-circle-2017/</link><guid isPermaLink="false">67904f3e-ff6f-46dd-8653-b43ce55fd491</guid><category><![CDATA[event]]></category><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Sun, 10 Dec 2017 10:21:00 GMT</pubDate><content:encoded><![CDATA[<p>A famous American journalist <strong>Margaret Fuller</strong> once said: "If you have the knowledge, let others light their candles with it." </p>

<p>It's always been a pleasure to present on Microsoft Azure Cloud. </p>

<p>Special thanks to Pranav Ainavolu, Shravan Kumar Kasagoni and Microsoft folks for the opportunity </p>

<p>Had a wonderful time presenting <strong>Azure Infrastructure</strong> at <strong>App Innovation Circle 2017</strong> at <strong>Microsoft Hyderabad, India</strong>.</p>

<p>Few pics from the Event: <a href="https://1drv.ms/f/s!Aqd">https://1drv.ms/f/s!Aqd</a><em>Zd4hXkLdlD5wPPo</em>jtm9wIa1</p>]]></content:encoded></item><item><title><![CDATA[Azure Virtual Machine Just-In-Time Access]]></title><description><![CDATA[<p>What is Just in time Virtual Machine access ?</p>

<p>Just in time virtual machine (VM) access can be used to lock down inbound traffic to your Azure VMs, reducing exposure to attacks while providing easy access to connect to VMs when needed.</p>

<p>JIT VM feature is more like an automated Azure</p>]]></description><link>http://raghuram-blog.azurewebsites.net/azure-virtual-machine-just-in-time-access/</link><guid isPermaLink="false">2a5c23de-4c68-46d9-8749-de790e66f559</guid><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Sat, 25 Nov 2017 23:47:35 GMT</pubDate><content:encoded><![CDATA[<p>What is Just in time Virtual Machine access ?</p>

<p>Just in time virtual machine (VM) access can be used to lock down inbound traffic to your Azure VMs, reducing exposure to attacks while providing easy access to connect to VMs when needed.</p>

<p>JIT VM feature is more like an automated Azure Network Security Group rule set for accessing to any Azure specific VM(s) for a temporary period  which can be enabled any set of ports restricted from and to IP/Network range.</p>

<p>Typically, Azure Security Center locks down the inbound traffic to any specific ports and opens a port by creating a Network Security Group rule(s) for an appropriate time and from approved IP addresses(which in most cases would be our Public IP address for our local machines), and only for users with proper permissions. </p>

<p>All the requests are also logged in the <strong>Azure Activity Log</strong>, so we can easily monitor and audit the access.</p>

<p>How the Azure VM JIT Access works ?</p>

<p>When a user requests access to a VM, Security Center checks that the user has <strong>Role-Based Access Control (RBAC)</strong> permissions that provide write access for the VM. If they have write permissions, the request is approved and <strong>Security Center</strong> automatically configures the <strong>Network Security Groups (NSGs)</strong> to allow inbound traffic to the management ports for the amount of time you specified. After the time has expired, Security Center restores the NSGs to their previous state.</p>

<blockquote>
  <p><strong><em>NOTE:</em></strong> The Free Tier does not include the JIT VM Access, but you should get an option for a 60 day trial for the Standard Tier that does.</p>
</blockquote>

<p>Automating Azure VM Just in Time Access via PowerShell:</p>

<pre><code># Import Azure RM PSM
Import-Module AzureRM  
# Import Azure SecCenter PSM
Import-Module Azure-Security-Center

# resource group name
$resourceGroup = "ResourceGroupName"
# VM that will be started after updating the NSG
$VMName = "VM-01"
# Get my Public IP - Navigate to "https://www.whatismyip.com/" and get the Public IP
$ipAddress = "183.83.222.243"
# paste the local RDP File
$RDPFile = "C:\Users\raghu\Downloads\vs2017-win2016.rdp"
# Hours for access
[int]$hours = 3

$cred = $null
$cred = Get-Credential -Message "Please enter the credentials to Login to Azure"

$SubscriptionId="4f98b0d0-a2bd-4389-bea7-31faae224077"

Login-AzureRmAccount -Credential $cred –SubscriptionId $SubscriptionId -ErrorAction Stop | out-null

# Main powershell script
# Requesting Access to the Azure VM for current public IP Address for RDP for 2 hours
Invoke-ASCJITAccess -ResourceGroupName $resourceGroup -VM $VMName -Port 3389 -Hours $hours -AddressPrefix $ipAddress

$vmDetails = Get-AzureRmVM -ResourceGroupName $resourceGroup -Name $vmName -Status -ErrorAction Stop

# Starting the Azure Virtual Machine if in Deallocated status.
$VMPowerState = (get-culture).TextInfo.ToTitleCase(($vmDetails.statuses)[1].code.split("/")[1])

if ($VMPowerState -eq "Deallocated"){  
    #Starting Azure Virtual machine
    $vmstatus = Start-AzureRMVM -ResourceGroupName $resourceGroup -Name $vmName              
    # Connecting to Azure Virtual Machine by using RDP Settings File
    if($vmstatus.Status.Equals("Succeeded")){
        # Script Sleeps for 2 mins to start the Azure VM.
        Start-Sleep 120
        Start-Process "$env:windir\system32\mstsc.exe" -ArgumentList $RDPFile
    }
    else{
        Write-Host "Something went wrong when starting Azure VM Name: $VMName at - $(Get-date -format "dd-MMM-yyyy HH:mm:ss")" -foregroundcolor "red" -backgroundcolor "yellow"
    }
} else {
    Start-Process "$env:windir\system32\mstsc.exe" -ArgumentList $RDPFile
}

#End of the script
</code></pre>

<p>From the above the script we are trying to import two modules:</p>

<ol>
<li>AzureRM Module  </li>
<li>Azure-Security-Center</li>
</ol>

<p>Where <strong>Invoke-ASCJITAccess</strong> cmdlet is from Azure-Security-Center Powershell module for requesting the Just in Time Access.</p>

<p>For execution with proper logs, please find the automated powershell script which enables Just-In-Time Access for the Azure Virtual Machine for Security Center: <a href="https://gallery.technet.microsoft.com/Azure-Virtual-Machine-Just-0de3fa9a">Technet Script Center Link</a></p>]]></content:encoded></item><item><title><![CDATA[Public preview: Application Security Groups, Service Tags, Augmented Security Rules]]></title><description><![CDATA[You can use ASG to configure network security as natural extension of an application's structure, by arbitrarily grouping of VMs & defining policies based on those groups.]]></description><link>http://raghuram-blog.azurewebsites.net/public-preview-application-security-groups-service-tags-augmented-security-rules/</link><guid isPermaLink="false">98589d94-103a-46ab-98dc-4a2cb1826966</guid><category><![CDATA[public-preview]]></category><category><![CDATA[nsg]]></category><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Thu, 05 Oct 2017 10:37:00 GMT</pubDate><content:encoded><![CDATA[<p>Microsoft has announced the following features for network security groups (NSGs) which are in public preview: </p>

<ul>
<li>Application Security Groups, </li>
<li>Service Tags, </li>
<li>Augmented Security Rules</li>
</ul>

<p><strong>Application Security Groups:</strong></p>

<p>We can use application security groups to configure network security as natural extension of an application’s structure, by arbitrarily grouping VMs and defining network security policies based on those groups. You can reuse your security policy and scale without manual maintenance of explicit IP addresses. The platform handles the complexity of explicit IP addresses and multiple rule sets, so you can focus on your business logic. For more information, see the documentation. </p>

<p><strong>Service tags for NSGs:</strong></p>

<p>Service Tags simplify security for Azure Virtual Machines and Azure Virtual Networks by enabling you to easily restrict network access to just the Azure services that you use. You can use service tags in your NSG rules to allow or deny traffic to a specific Azure service globally or per Azure region. Azure provides the maintenance of IP addresses underlying each tag. This preview includes Storage, Sql, and AzureTrafficManager tags. For more information, see the documentation.</p>

<p><strong>Augmented security rules for NSGs:</strong></p>

<p>Augmented rules for NSGs simplify the security definition for Virtual Networks, so you can define larger, more complex network security policies with fewer rules. Multiple ports, multiple explicit IP addresses, service tags, and application security groups can all be combined into a single, easily understood security rule. For more information, see the documentation. </p>

<p><strong>Application security groups</strong> is in-preview in US West Central. </p>

<p><strong>Service Tags</strong> and <strong>Augmented Security Rules</strong> are in preview in the following regions:</p>

<ul>
<li>US West Central</li>
<li>US East</li>
<li>US West</li>
<li>US West 2</li>
<li>Australia East</li>
<li>Australia Southeast</li>
<li>UK South</li>
</ul>]]></content:encoded></item><item><title><![CDATA[Global Azure Bootcamp 2017]]></title><description><![CDATA[<p>Had an amazing experience presenting on <strong>Azure Automation</strong> at Global Azure Bootcamp 2017 hosted @ Hyderabad, India which was a huge huge success with 10 speakers and 7 sessions with over 300+ Azure enthusiast attendees.</p>

<p>Event details: <a href="https://themugh.github.io/gabc2017/">https://themugh.github.io/gabc2017/</a></p>

<p>Few pics from the Event: <a href="https://1drv.ms/f/s!Aqd_Zd4hXkLdkkzWuLgda38WbFPw">https://1drv.ms/f/</a></p>]]></description><link>http://raghuram-blog.azurewebsites.net/global-azure-bootcamp-2017/</link><guid isPermaLink="false">81c30fed-edc3-4ac7-991c-fccdece4638e</guid><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Wed, 21 Jun 2017 09:30:28 GMT</pubDate><content:encoded><![CDATA[<p>Had an amazing experience presenting on <strong>Azure Automation</strong> at Global Azure Bootcamp 2017 hosted @ Hyderabad, India which was a huge huge success with 10 speakers and 7 sessions with over 300+ Azure enthusiast attendees.</p>

<p>Event details: <a href="https://themugh.github.io/gabc2017/">https://themugh.github.io/gabc2017/</a></p>

<p>Few pics from the Event: <a href="https://1drv.ms/f/s!Aqd_Zd4hXkLdkkzWuLgda38WbFPw">https://1drv.ms/f/s!Aqd_Zd4hXkLdkkzWuLgda38WbFPw</a></p>

<p>Special thanks to <a href="https://twitter.com/techieshravan">Shravan Kumar Kasagoni</a> and all Microsoft User Group Hyderabad Organisers for the opportunity.</p>

<p>Thanks to Global Azure Bootcamp Global Team and all the attendees who attended.</p>

<p>And also thanks Ravi for your feedback on my session. <br>
<img src="https://do3uvq-sn3301.files.1drv.com/y4mXA0efhrrYOMfjrY_q8OV4MFeR7_nts6r2oG--_r2nEFGNbjMOwOfu3m3LlXf5BVzMhrUI047HhE_4v0JJwlQqNwryKbqv38UBVqq2uppnnapq6_-zuyl9YgVyLfnOkdj27Ra9EVrvvAyo7lSaG9FTqCIKWZO-fFG7XEEKepCsKJPAQtWYJkCdlCyWZ2I63pRULGqeqWLujfkwxbNI7RMew/GABC2017.png?psid=1" alt="Appreciation"></p>

<p>Keep Rocking on Cloud ☁</p>]]></content:encoded></item><item><title><![CDATA[Virtual Private Network(VPN)]]></title><description><![CDATA[
VPN is generally a Client and Server architecture where we have VPN Servers and VPN Clients. Software which allows client machines to securely connect over the VPN Servers.]]></description><link>http://raghuram-blog.azurewebsites.net/virtual-private-network/</link><guid isPermaLink="false">11d583ba-06b2-492e-818b-0d91dbef939d</guid><category><![CDATA[networking]]></category><category><![CDATA[Virtual-Private-Network]]></category><category><![CDATA[VPN]]></category><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Fri, 17 Feb 2017 22:40:00 GMT</pubDate><content:encoded><![CDATA[<p>When we hear VPN most of the people think of proxying your IP with another regions address. </p>

<p>VPN is generally a Client and Server architecture where we have VPN Servers and VPN Clients. Software which allows client machines to securely connect over the VPN Servers.</p>

<p><img alt="VPN Architecture" src="https://farm1.staticflickr.com/935/42943848824_6ab17c2d71_b.jpg"></p>

<p>To understand how VPN is more secure we need to understand the mechanism which VPNs follow to make the communication secure and encrypted. </p>

<p><strong>Man In The Middle attack(MITM attack):</strong>
In cryptography and computer security, MITM attach is where Intermedia Hacker secretly tries to read the data packets which are sent from the source to destination i.e, Server to Victim from the image below.</p>

<p><img alt="Man In the Middle Attach" src="https://farm1.staticflickr.com/915/29789992838_77ef48381e_k.jpg" style="width: 700px; height:500px"></p>

<p><strong>Tunneling Protocol</strong>: It creates a tunnel between source-destination an encrypts the data transferred between them.</p>

<p>The tunnel will try to detect the penetration done by hackers &amp; the tunnel will shut down and create an alternate way to reach the destination. </p>

<p>Most tunneling protocols operate at layer 4, which means they are implemented as a protocol that replaces something like TCP or UDP. VPN tunnels allow remote clients to tunnel into our network.</p>

<p><img alt="Tunneling Protocol" src="https://farm1.staticflickr.com/931/42943849044_a834b429e2_z.jpg"></p>

<p><strong>Challenges for VPN:</strong></p>

<p>We have to check the upload connection at destination network where the VPN Server is trying to connect otherwise it will be very slow.</p>]]></content:encoded></item><item><title><![CDATA[Provisioning and Configuration Management]]></title><description><![CDATA[What does Provisioning, Automation and Configuration Management mean in the real world along with a simple scenario.]]></description><link>http://raghuram-blog.azurewebsites.net/provisioning-and-configuration-management/</link><guid isPermaLink="false">c05f240d-9da4-4ae7-96dc-9fbe8ced3ad6</guid><category><![CDATA[configuration-management]]></category><category><![CDATA[cloud]]></category><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Thu, 26 Jan 2017 18:59:00 GMT</pubDate><content:encoded><![CDATA[<p>In Cloud Infrastructure world when we hear the words like Provisioning, Automation and Configuration Management people will always consider only what they hear as a case study or a famous scenario.</p>

<p>There is a famous saying "<strong>Understanding is always a two-way street</strong>".</p>

<p>Today we will be understanding in more detail on what actually meant by Provisioning, Automation, Configuration Management and their use cases in traditional and cloud world.</p>

<p>Consider a scenario where we want to host a web application:</p>

<p><img alt="Application Scenario" src="https://farm1.staticflickr.com/862/28770839017_58e6a8be04_k.jpg" style="width: 600px; height:500px"></p>

<p>First, we need a Server which can be a physical or a Virtual Machine using a Hypervisor or a Container. If it's a single pet project it might be manual but in an enterprise, they might have their own procedure to request servers.</p>

<p>Later in the next blog will see how to create a virtual machine using Vagrant but nowadays everyone uses cloud by which we can simply create or delete any number of servers in very little time.</p>

<p>Provisioning - In any Data Center or even on a single Physical Server we can set-up a logical server by using a script or using a manual process to create a virtual server which utilizes the resources of the Physical Server. We can also automate the provisioning of a server process by passing the necessary parameters to PowerShell, Terraform, etc to create servers in an easy and quick way.</p>

<p><img alt="Application Scenario" src="https://farm1.staticflickr.com/861/28770892027_967fd2884a_k.jpg" style="width: 750px; height:350px"></p>

<ul>
<li>There is always a huge difference between Cloud and On-Premises.</li>
<li>Cloud is flexible, On-Demand, API Support.</li>
<li>Can also use Hybrid Solution - Partial Cloud and Partial On-Prem</li>
</ul>

<p>Once we have our machines spun up we can install different services to run on our servers which can be Web Server Software like Apache, IIS, PHP, and .NET at this place we talk about Automation &amp; Configuration Management. All the application will have their unique configuration files and upon which we will have our application code.</p>

<p>So what is Configuration Management ?</p>

<blockquote>
  <p>Configuration Management (CM) is a system engineering process for maintaining establishing and maintaining consistency of a product's performance, functional and physical attributes with its requirements, design and operational information throughout its life. </p>
</blockquote>

<p>Maintaining consistency of software and configuration. i.e, we create a pipeline where we provision servers in an automated way and then maintaining the consistency of the software configuration.</p>

<p>Automation is necessary when:</p>

<ul>
<li>Easy to create any number of servers without any human error.</li>
<li>Infrastructure is unmanageable.</li>
</ul>

<p>Some tools we can use are <strong>Chef, Puppet, Ansible, SaltStack</strong>.</p>

<p>Do follow my blog for more posts on cloud and related concepts...</p>

<p>Happy Reading :)</p>]]></content:encoded></item><item><title><![CDATA[Azure ARM VM Snapshot]]></title><description><![CDATA[In this blog you will learn how Snapshot can be performed in Azure for an unmanaged Virtual Machine.]]></description><link>http://raghuram-blog.azurewebsites.net/azure-arm-vm-snapshot/</link><guid isPermaLink="false">19b92d59-2947-46de-9ce5-42240475d0b0</guid><category><![CDATA[azure]]></category><category><![CDATA[backup]]></category><category><![CDATA[snapshot]]></category><category><![CDATA[blob]]></category><category><![CDATA[restore]]></category><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Sun, 18 Dec 2016 11:19:00 GMT</pubDate><content:encoded><![CDATA[<p>As Azure provides a perfect Azure Backup Solution for Virtual Machines. There is another alternate way where you can create your own customized Backup Solution for Virtual machines using Blob Snapshots.</p>

<p>Azure Storage provides the capability to take snapshots of blobs. </p>

<p>You might me wondering what is a Snapshots ? </p>

<p><img src="http://windowsitpro.com/site-files/windowsitpro.com/files/archive/windowsitpro.com/content/content/100473/100473%20snapshotmerge.jpg" alt="Traditional Snapshot">
In Hyper-V Environment the configuration, memory, and supporting process information is saved and a differencing disk is created to store future disk changes. When you delete a VM, all the snapshots are deleted. However, the virtual hard disk (VHD) is not deleted, which means all content stored in the differencing disks associated with the snapshots must be merged with the original VHD, as the following diagram shows.</p>

<p>In Azure its similar where Azure capture the blob state at that point in time. Lets dig down the scenario of how we can maintain backups of virtual machine disks using snapshots. </p>

<p>What is a Blob Snapshot? <br>
A blob snapshot is a read-only version of a blob that is captured at a point in time. Once a snapshot has been created, it can be read, copied, or deleted, but not modified. </p>

<blockquote>
  <p><strong>Note:</strong> Snapshots can be copied to another storage account as a blob to keep backups of the base blob. You can also copy a snapshot over its base blob, which is like restoring the blob to an earlier version. When a snapshot is copied from one storage account to another, it will occupy the same space as the base page blob. Therefore, copying whole snapshots from one storage account to another will be slow and will also consume lot of space in the target storage account</p>
</blockquote>

<p>Steps for Implementing a full snapshot copy:</p>

<ol>
<li>First, take a snapshot of the base blob using the Snapshot Blob operation.</li>
<li>Then, copy the snapshot to a target storage account using Copy Blob.</li>
<li>Repeat this process to maintain backup copies of your base blob.</li>
</ol>

<p>For execution, please find the Automated Powershell Script which Create Snapshot for unmanaged Virtual Machines in a resource group: <a href="https://gallery.technet.microsoft.com/scriptcenter/Azure-ARM-VM-Snapshot-3292a891">Link</a></p>

<p>The above script is for creating Blob Snapshots for all Azure IaaS VMs(includes root volume and Data volumes) for Azure Resource Manager VM(unmanaged disks). This is intended to run only for Virtual Machines with TagName as "Environment" and TagValue as "Production". You can also automate the process of Blob Snapshot by publishing the script in Azure Automation as well with few changes.</p>

<p>See the corresponding article for details and instructions:<a href="https://docs.microsoft.com/en-us/azure/storage/storage-blob-snapshots">https://docs.microsoft.com/en-us/azure/storage/storage-blob-snapshots</a></p>

<blockquote>
  <p>NOTE: It is suggested that you download the script file from this page instead of copying and pasting the script code below, in order to avoid any formatting issues that may affect script execution.</p>
</blockquote>

<p>Thanks for reading. Following to this blog we will have a detailed blog explaining how to restore an unmanaged VM in Azure using Powershell Scripts.</p>

<p>Happy Reading :) </p>]]></content:encoded></item><item><title><![CDATA[Microsoft Azure Networking (Part - 3)]]></title><description><![CDATA[<p>Hello Everyone :) Thanks for following the blog. </p>

<p>As we know this blog is a part of Microsoft Azure Networking blog series. This blog is Part - 3 where we continue the Networking resources from understanding Azure Application Gateway. If you haven't read the <a href="http://raghu.space/azure-networking/">Part - 1</a> and <a href="http://raghu.space/microsoft-azure-networking-part-2/">Part - 2</a></p>]]></description><link>http://raghuram-blog.azurewebsites.net/microsoft-azure-networking-part-3/</link><guid isPermaLink="false">1d47f25a-4d4c-431f-8e72-458462c22429</guid><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Sun, 13 Nov 2016 13:13:00 GMT</pubDate><content:encoded><![CDATA[<p>Hello Everyone :) Thanks for following the blog. </p>

<p>As we know this blog is a part of Microsoft Azure Networking blog series. This blog is Part - 3 where we continue the Networking resources from understanding Azure Application Gateway. If you haven't read the <a href="http://raghu.space/azure-networking/">Part - 1</a> and <a href="http://raghu.space/microsoft-azure-networking-part-2/">Part - 2</a></p>

<p><strong>Azure application Gateway</strong></p>

<ol>
<li>Layer 7 : HTTP/HTTPS load balancing WebSocket support.</li>
<li>Web application firewall</li>
<li>URL-based routing.</li>
<li>Routing based on tuple of source &amp; destination IP addresses.
<ul><li>Round Robin</li>
<li>Session affinity via cookies</li>
<li>SSL decoding/terminations &amp; end-to-end SSL processing.</li></ul></li>
</ol>

<p><strong>Services:</strong></p>

<ol>
<li>Two SKU's -> Web Application firewall (WAF) and Standard.  </li>
<li>Small, Medium &amp; Large services tiers.  </li>
<li>Differences in pricing for outbound data  </li>
<li>Small doesn’t support WAF  </li>
<li>Differenced in speed of putdound data processing.  </li>
<li>Inbound data is free for all service tiers.</li>
</ol>

<p><strong>Web Application Firewall</strong></p>

<ol>
<li>Protects from common attacks.  </li>
<li>SQL Injection &amp; cross-site scripting.  </li>
<li>Bots &amp; Scanners.  </li>
<li>HTTP violation/anomalies/forgeries.  </li>
<li>Server Misconfigurations.</li>
</ol>

<p><strong><em>Detection Mode</em></strong> : Detects and logs threats; no direct alerting.</p>

<p><strong><em>Prevention Mode</em></strong> : Sends 403 response to detected threats.</p>

<p><strong>Pros:</strong></p>

<ol>
<li>Super-simple to use. <br>
<ul><li>Create it, assign it to an IP address and VNET, add a listener and you’re done.</li></ul></li>
<li>Can protect Web Apps(in a Virtual Network).  </li>
<li>Public and private IP's load balancing.  </li>
<li>WAF protects against common attacks.  </li>
<li>SSL offloading <br>
<ul><li>Requires additional configuration.</li></ul></li>
<li>Custom health probes.</li>
</ol>

<p><strong>Cons:</strong></p>

<ol>
<li>Only works for HTTP/HTTPS.  </li>
<li>Round Robin and URL based routing limits overall routing options.  </li>
<li>Doesn’t support IP reservations.  </li>
<li>Laxer rule Vs Load balancer for health probes.</li>
</ol>

<p><strong>Usage Examples</strong></p>

<ol>
<li>Protest Virtual Machines &amp; Web Apps against Common Attacks(WAF)  </li>
<li>Routing traffic among several web servers VMs or web apps within a specific <br>
VNets.  </li>
<li>In concert with a load balancer for multities application.  </li>
<li>Maintain session affinity for specific applications (Shopping carts, Web mail, etc.)  </li>
<li>SSL-intensive workload.</li>
</ol>

<p>Thanks for reading.. :) Keep following for Part - 4</p>]]></content:encoded></item><item><title><![CDATA[Microsoft Azure Networking (Part-2)]]></title><description><![CDATA[<p>Hello again :)</p>

<p>Thanks for following the blog. As we know we have been covering Microsoft Azure Networking resources. This blog is Part - 2 where we continue the Networking resources. If you haven't read the Part 1, <a href="http://raghu.space/azure-networking/">click here</a></p>

<p>Lets understand about Azure Load Balancer and see why anyone should</p>]]></description><link>http://raghuram-blog.azurewebsites.net/microsoft-azure-networking-part-2/</link><guid isPermaLink="false">b45cb2b1-0821-4119-92c9-68a47aa4fc3e</guid><category><![CDATA[Azure Load Balancer]]></category><category><![CDATA[traffic]]></category><category><![CDATA[load-balance]]></category><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Sat, 22 Oct 2016 12:23:00 GMT</pubDate><content:encoded><![CDATA[<p>Hello again :)</p>

<p>Thanks for following the blog. As we know we have been covering Microsoft Azure Networking resources. This blog is Part - 2 where we continue the Networking resources. If you haven't read the Part 1, <a href="http://raghu.space/azure-networking/">click here</a></p>

<p>Lets understand about Azure Load Balancer and see why anyone should use, Pros and Cons, and finally few examples of the resource in real world.</p>

<p><strong>Azure Load Balancer</strong></p>

<ol>
<li>Layer 4(transport) : TCP &amp; UDP.</li>
<li>Routing for virtual machines &amp; cloud services.</li>
<li>Support virtual &amp; hybrid networks(on prem/-- -)</li>
<li>Supports reserved IP Addresses.</li>
<li>Routing based on tuple of source &amp; destination IP addresses.
<ul><li>Supports session affinity.</li>
<li>Supports port forwarding.</li></ul></li>
</ol>

<p><strong>Internet Facing Load Balancer</strong> :- Load Balancer passes public IP request to Virtual Machine. Virtual Machine's response is routed back to client through the Load Balancer, onto the public IP.</p>

<p><strong>Internal Facing Load Balancer</strong> :- Traffic within the Virtual Network is passed through the Load Balancer.</p>

<ol>
<li>Virtual Machine to Virtual Machine traffic within the same Virtual Network.</li>
<li>Virtual Machine to Virtual Machine within the same cloud services(Classic).</li>
<li>On-Premises to Virtual Machine within the same cloud services and Virtual Network.</li>
<li>Among tiers in a multi-tier Application.</li>
</ol>

<p><strong>Pros:</strong></p>

<ol>
<li>Flexible &amp; geared towards performance.  </li>
<li>Can route any UDP/TCP traffic.  </li>
<li>Create port forwarding &amp; session present rules  </li>
<li>Direct server return for bandwidth-intensive requests.  </li>
<li>Allows for tiered routing in N-tier architecture.  </li>
<li>Correctly addresses sealed out VM instances.  </li>
<li>Can be used to pool multiple publicIP.  </li>
<li>Can customize health probes.</li>
</ol>

<p><strong>Cons:</strong></p>

<ol>
<li>Difficult to be very granular.  </li>
<li>Doesn’t support SSL offloading.  </li>
<li>Can be tempting to misuse. <br>
<ul><li>Too much specific endpoint routing.</li>
<li>Stymied auto-scaling.</li></ul></li>
<li>Requires HTTP health probes on each endpoint. <br>
<ul><li>Endpoint must respond with HTTP 200 status code.</li></ul></li>
</ol>

<p><strong>Usage Examples:</strong></p>

<ol>
<li>Load balance each tier of an N-tier architecture with multiple machines.  </li>
<li>Load balance all traffic on a specific IP address or group of IP addresses.  </li>
<li>co-ordinate traffic between a Virtual Network and On-Premise Network.  </li>
<li>Direct traffic on specific port or from a specific IP address to a specific virtual machine.</li>
</ol>

<p>Thanks for reading.. :) Keep following for Part - 3</p>]]></content:encoded></item><item><title><![CDATA[Azure Key Vault Implementation]]></title><description><![CDATA[In this blog you will learn practical implementation of how we can secure application secrets by using Azure Key Vault Management]]></description><link>http://raghuram-blog.azurewebsites.net/azure-key-vault-implementation/</link><guid isPermaLink="false">a7be0a5b-d1c3-4ee9-9350-7c5e27edf2ff</guid><category><![CDATA[azure key vault]]></category><category><![CDATA[key management]]></category><category><![CDATA[secure connectionstring]]></category><dc:creator><![CDATA[Raghuram Korukonda]]></dc:creator><pubDate>Mon, 10 Oct 2016 11:12:00 GMT</pubDate><content:encoded><![CDATA[<p>Continuing to the previous blogs where we learned about <a href="http://raghuram-blog.azurewebsites.net/azure-key-vault/">Azure Key Vault Overview</a> and also about <a href="http://raghuram-blog.azurewebsites.net/azure-key-vault-lifecycle/">Key Vault Lifecycle</a>, lets do some hands on and understand how Key Vault is implemented in real world scenario.</p>

<p>Today we will cover how to Authenticate a Client Application with Azure Key Vault using Azure Active Directory Application and how to set various access policies for the applications. Each application should be given minimum set of permissions that it requires to operate on. A <strong>Security Administrator</strong> would be given full permission so that it could modify the <strong>Vault Key/Secret</strong> as required and an Azure Developer will have limited permissions on Keys and Secrets. For Such a scenarios, it is best to have two or more AD applications created and have separate permissions provided.</p>

<p><img src="https://by3uvq-sn3301.files.1drv.com/y4mY2KeN7clg06Fx42wHlhHlme1sLekQChQxZpkIOrfiKmkPoS0O0KRwLwrGD72WqeqWniQMUZKWZogMShI4usi4pctNXNrwiHQcQJSAnvLdXA-93KF8vOzSAeApa6HqgBsrD13823-WblwKBM4DBFzE22P7zm3C1ZLmjgh58q8wolw0_PrlAPhJRQ-c4uaQfGTLPv5eZT0f7VLQXifXUZeZA/implementation.png?psid=1" alt="Azure Key Vault Implementation"></p>

<p>Process flow: <br>
1) The application first uses the AD application credentials to authenticate and once obtained the Access Token is used for further interactions with the Key Vault. Using the Key Identifier that is available we get the details of the key. We have to provide the appropriate permissions by <strong>Set-AzureKeyVaultAccessPolicy</strong>, against the key vault. In C# we generally Encrypt data with the <strong>System.Security.Cryptography.RSA algorithm</strong>.</p>

<p>To implement Azure Key Vault to our applications we have 4 Steps: </p>

<ul>
<li>Create an Azure AD Application</li>
<li>Creating Key Vault and associate the Service Principal</li>
<li>Create a Key and Secret in Key Vault</li>
<li>Using Key Vault from a Web Application</li>
</ul>

<p><strong>Step 1: Create an Azure AD Application</strong></p>

<p>We have to create an AD Application that will authenticate using Client ID and Client Secret, generating the credentials can be done using either Powershell or Azure Portal. </p>

<p>In this Step we cover Powershell way to create an Azure AD Application</p>

<p><em>Pre-Requisites:</em> </p>

<ul>
<li>Powershell with Azure Module Installed.</li>
<li>Required Permissions needed to create an AD Application.</li>
<li>Azure Portal Access.</li>
</ul>

<p><em>Procedure:</em></p>

<ul>
<li>Run the below powershell code to create an Azure AD Application. When the script starts running a pop-up appears where we have to specify the username and password for Azure Account. Once its authentication then an AD Application is created.</li>
</ul>

<pre><code>#Login to Azure Module from powershell.
Login-AzureRmAccount

$aadClientSecret = 'ramClientSecret'
$appDisplayName = 'ramKvApp'

#To Create an AD Applicatication with a custom Password
$aadApp = New-AzureRmADApplication -DisplayName $appDisplayName -HomePage 'http://ramKvApp' -IdentifierUris 'http://ramKvApp' -Password $aadClientSecret

$appID = $aadApp.ApplicationId

#Creating a Service Principal to the Application
$aadServicePrincipal = New-AzureRmADServicePrincipal -ApplicationId $appID
</code></pre>

<ul>
<li><p>Once the script completes running successfully we can navigate to Azure Portal and Search for App Registrations and select.
<img src="https://2hgtgw-sn3301.files.1drv.com/y4mTQMtDx5-dRK5wSjF8coH6MC7FCuBqleCISPpZi_luUc5vUxiPdf0UUVNEjnbWh01GMg5l6rctv5UVhI2ql7lRheYWHs-8stUWWJmz49qygVEDKRbrdTF1F6WeW0qrMpXRRpylpdQi_u4tO0Zjc1sFAxyvlqM9c-bAlM0HNDkSQDMYAB5WrCExoFGgsbIYqe0wVWqTF6t27XRSL8ttIjxdg/1-ADApplication.png?psid=1" alt="Navigate to App Registrations" title=""></p></li>
<li><p>Search by AD Application Name and note the Application ID which is our Client ID and the Client Secret from the above Script(in our case its 'ramClientSecret').</p></li>
</ul>

<p><strong>Step 2: Creating Key Vault and associate the Service Principal</strong></p>

<p><em>Pre-Requisites:</em> </p>

<ul>
<li>Powershell with Azure Module Installed.</li>
<li>Required Permissions needed to create an AD Application.</li>
<li>Azure Portal Access.</li>
</ul>

<p><em>Procedure:</em></p>

<ul>
<li>Run the below powershell script to create a Resource Group in an Azure Subscription. In the above step as we have logged in to Azure Subscription, we create a Resource Group to place Key Vault resource inside it.</li>
</ul>

<pre><code>$kvName = 'ramKV'
$rgName = 'ramRG'
$location = 'South India'

#selecting target Subscription
Select-AzureRmSubscription –SubscriptionName ‘&lt;SubscriptionName&gt;’

#creating a Resource Group from the above values
New-AzureRmResourceGroup -Name $rgName -Location $location  
#creating an Azure Key Vault from the above values.
New-AzureRmKeyVault -VaultName $kvName -ResourceGroupName $rgName -Location $location

#assigning the Access policy to the Key Vault
Set-AzureRmKeyVaultAccessPolicy -VaultName $kvName -ServicePrincipalName $appID -PermissionsToKeys all –PermissionsToSecrets all  
</code></pre>

<ul>
<li>In the above script we create a resource group and also assign an access policy to the target key vault.</li>
<li>Once the script run successfully we can navigate to Azure Portal and search for the <strong>Resource Group</strong> and click on <strong>Key Vault</strong>.</li>
</ul>

<p><img src="https://3bgtgw-sn3301.files.1drv.com/y4mGWB65Qsp1wqc7Ajep0hrqu0IFu8HwgqNid96H9ZXTh1O_tjtMtbckiwmgv-qZVjA9J4W6veNY1UFxrL0DSZ9YKz2Nu_cQbdrrIEi69WUW5szMxWirW1iAH3Otmtni0eSPbQqCw1j_VzGWTavE4dSzvE9uDz8rNMqSD3owH_IF7Yqt_hwr2eGYVF9cpkiBLFXUEOrqBy5gqmjRMMl2LuIlg/3-AzureKV.png?psid=1" alt="Azure Key Vault in a Resource Group"></p>

<p><strong>Step 3: Creating and Deleting Key and Secret in Azure Key Vault</strong></p>

<p>As we have created AD Application and Key Vault let now create Key and Secret in Key Vault(<a href="http://raghuram-blog.azurewebsites.net/azure-key-vault/">for more info on Keys and Secret</a>)</p>

<p>It walks you through the process of accessing a secret from an Azure Key Vault so that it can be used in your web</p>

<ul>
<li>Adding a Key or Secret to Vault:</li>
</ul>

<pre><code>#creating a Software protected Key
$key = Add-AzureKeyVaultKey -VaultName ‘ramKeyVault' -Name 'softProtectKey' -Destination 'Software'
</code></pre>

<ul>
<li>If we have an existing software-protected key in a .pfx file saved at local machine named “KeyCert.pfx” that can be uploaded to Azure Key Vault:</li>
</ul>

<pre><code># .pfx certificate password
$securepfxpwd = ConvertTo-SecureString –String 'Password@123' –AsPlainText –Force

#import the key from the .PFX file, which protects the key by software in the Key Vault service
$key = Add-AzureKeyVaultKey -VaultName 'ramKeyVault' -Name 'CertificateKey' -KeyFilePath 'C:\keyCert.pfx' -KeyFilePassword $securepfxpwd
</code></pre>

<ul>
<li>To add a secret say SQL Password which is <em>sqlpassword</em> to the Key Vault, firstly we convert it to SecureString  by typing the following:</li>
</ul>

<pre><code>#convert password to Secure String 
$secretvalue = ConvertTo-SecureString 'sqlpassword' -AsPlainText –Force

#assigning a Secret to Key Vault
$secret = Set-AzureKeyVaultSecret -VaultName 'ramKeyVault' -Name 'SQLPassword' -SecretValue $secretvalue
</code></pre>

<ul>
<li>To display the URL of the Secret, the below URL is also called as Key Identifier which can be found from Azure Portal as well:</li>
</ul>

<pre><code>#which will be similar to https://ramkv.vault.azure.net/secrets/demFinals/f2b508e89d3f44b6a184f97dd967e51d
$secret.Id
</code></pre>

<ul>
<li>To get all available Keys &amp; Secrets in the Key Vault:</li>
</ul>

<pre><code>#List of keys in the Key vault named 'ramKeyVault'
Get-AzureKeyVaultKey –VaultName 'ramKeyVault'

#List of Secrets in the Key vault named 'ramKeyVault'
Get-AzureKeyVaultSecret –VaultName 'ramKeyVault'  
</code></pre>

<ul>
<li>Delete the Key Vault and associate keys and Secrets:</li>
</ul>

<pre><code>#remove Azure Key Vault from the subscription 
Remove-AzureRmKeyVault -VaultName 'ramKeyVault'  
</code></pre>

<p>Link for More Powershell Key Vault Modules: <a href="https://docs.microsoft.com/en-us/powershell/resourcemanager/azurerm.keyvault/v2.1.0/azurerm.keyvault?redirectedfrom=msdn">https://docs.microsoft.com/en-us/powershell/resourcemanager/azurerm.keyvault/v2.1.0/azurerm.keyvault?redirectedfrom=msdn</a></p>

<p><strong>Step 4: Using Key Vault Secret from Web Application</strong></p>

<p><em>Pre-requisites:</em></p>

<ul>
<li>A URI to a secret in an Azure Key Vault</li>
<li>A Client ID and a Client Secret for a web application registered with Azure Active Directory that has access to your Key Vault</li>
<li>An ASP.NET MVC application deployed in Azure as a Web App/Virtual Machine</li>
</ul>

<p><em>Procedure:</em></p>

<ul>
<li>There are two packages that your web application needs to have installed. Both of these packages can be installed using the Package Manager Console using the Install-Package command.</li>
</ul>

<p>Add Nuget Packages:  </p>

<pre><code>// this is currently the latest stable version of ADAL
C:\&gt; Install-Package Microsoft.IdentityModel.Clients.ActiveDirectory -Version 2.16.204221202  
C:\&gt; Install-Package Microsoft.Azure.KeyVault  
</code></pre>

<p><img src="https://1rgtgw-sn3301.files.1drv.com/y4mrb-IR2y33vau9DxYEF9D8lAmN4J9DZfHv4U4BUAXpljqeJYJmfFk_qxk-zGA2EACbIfpBMHK9PkhwBAGe7Sm9XXqDHyg1k355dWv_O6d9sKQpSGqxPZNkKaVUy6ZCL2vCtlynMrXZlZLrv6bNQMMMsvLeCJaFv6QsbWHzVc1OK-IQfikoCEpwKA2vCuwCAmJmL3Yti60eF0hCpt0kGrNAQ/4-InstallPackage.png?psid=1" alt="adding Nuget Packages"></p>

<ul>
<li><p>Modify Web.Config
<img src="https://di1vmg-sn3301.files.1drv.com/y4mPRgU-7-kaaztcoDddV5rZ1YciRpjX8-w7zDstnF__W7PDVpmTjw5370bhI9DarDOS66D--Y56krmZR959KnqrPWawrpWRtW58PVOhWHH7Lo6MhmuorH745a96hrCN2E5usNOpCgyJ4hQbMv3JnOQmQ6E3esZlOHx56g4OJiMSxnolNngzfZlBzoIiRm03hMk37ozquGeYPuUsv_QgCrFOA/webConfig.png?psid=1" alt="add Web.Config"></p></li>
<li><p>Add a Method to get an Access token. </p></li>
</ul>

<pre><code>//add these using statements
using Microsoft.IdentityModel.Clients.ActiveDirectory;  
using System.Threading.Tasks;  
using System.Web.Configuration;

public static string EncryptSecret { get; set; }

public static async Task&lt;string&gt; GetToken(string authority, string resource, string scope)  
{
    var authContext = new AuthenticationContext(authority);
    ClientCredential clientCred = new ClientCredential(WebConfigurationManager.AppSettings["ClientId"],
                WebConfigurationManager.AppSettings["ClientSecret"]);
    AuthenticationResult result = await authContext.AcquireTokenAsync(resource, clientCred);

    if (result == null)
        throw new InvalidOperationException("Failed to obtain the JWT token");

    return result.AccessToken;
}
</code></pre>

<ul>
<li>Retrieve the secret on Application Start
Now we need to get the secret from Azure Key Vault by calling the Key Vault API and retrieve the secret. We can place the below code at application start (in our case its <em>Global.asax</em>).</li>
</ul>

<pre><code>using Microsoft.Azure.KeyVault;  
using System.Web.Configuration;

// I put my GetToken method in a Utils class. Change for wherever you placed your method.
var kv = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(Utils.GetToken));

var sec = kv.GetSecretAsync(WebConfigurationManager.AppSettings["SecretUri"]).Result.Value;

//I put a variable in a Utils class to hold the secret for general application use.
Utils.EncryptSecret = sec;
</code></pre>

<p><img src="https://1hgtgw-sn3301.files.1drv.com/y4mHtcNvKyoDYFkBX1ggwRjybYvG0M38TC5lbhKDnsoCw7p5FRdBIDtIWKblwx2jzncEs1HFMrsFc52hsKODwGJDfgFOFlchZxl9_zCmqWK-4gWeGfd8tpCvoZE6xWeMqArFlr_r-UqSHEMn4sKtDUHhrXMzMHvlVUHtMSNYVb978BkUQTwzHGUlMiTzhOjwTko6gevJ4tU-aE6NzuwpauG4w/5-VSGetSecret.png?psid=1" alt="ASP.NET Application with key Vault"></p>

<ul>
<li>Run the application which will fetch the Connection String Secret from Azure Key Vault and pass the Key Vault Secret (ConnectionString) at runtime to the application</li>
</ul>

<p><strong>Summary</strong></p>

<p>From the above blog we can learn how Azure Key Vault can be used to store Application Secrets(API Keys/Connection Strings, etc) and how we can retrieve the secret from Key Vault.</p>

<p>Privacy and encryption works, but it's too easy to make a mistake that exposes you. So let's leverage Key Management System and stay safe with your application secrets.</p>

<p>Thanks for reading and keep learning :) </p>]]></content:encoded></item></channel></rss>