<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Microsoft Azure Cloud Integration Engineering</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/cie/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/cie/feed.xml</link>
    <description>(Compute, Cache, Storage, ACS, Service Bus, WebSites, VMs, SQL Azure, Data Sync, Import Export)</description>
    <lastBuildDate>Fri, 16 Feb 2018 14:18:36 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Troubleshooting Performance Issues with Cloud Services (PaaS) - Data Collection</title>
      <link>https://docs.microsoft.com/archive/blogs/cie/troubleshooting-performance-issues-with-cloud-services-paas-data-collection</link>
      <pubDate>Wed, 17 Jan 2018 19:19:53 GMT</pubDate>
      <dc:creator><![CDATA[chiragpa]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cie/?p=3785</guid>
      <description><![CDATA[Collecting right data at the right time is the most critical part of troubleshooting any sort of...]]></description>
      <content:encoded><![CDATA[Collecting right data at the right time is the most critical part of troubleshooting any sort of Performance issues, especially when the issue is intermittent and you can't reproduce this at will. There are many tools available to collect this data but you need to know which one to use when and how. In this blog post we have tried to summarize what, when and how of Data Collection for troubleshooting various Performance scenarios. Use the table below to find <strong>what</strong> kind of issue you are dealing with and then follow the link to understand <strong>when</strong> and <strong>how.</strong>
<table width="700" border="1">
<tbody>
<tr>
<td width="168"><strong>You are troubleshooting:</strong></td>
<td width="492" style="text-align: center" colspan="2"><strong>Data collection when problem:</strong></td>
</tr>
<tr>
<td width="168"><strong> </strong></td>
<td width="204" style="text-align: center"><strong>can be reproduced easily</strong></td>
<td width="288" style="text-align: center"><strong>is intermittent</strong></td>
</tr>
<tr>
<td width="168"><strong>Crash</strong></td>
<td width="204"><a href="#PDManual">ProcDump manual</a></td>
<td width="288"><a href="https://blogs.msdn.microsoft.com/asiatech/2014/01/09/debug-diagnostic-2-0-creating-a-rule-in-crash-mode/">Debug Diag Automated crash rule</a></td>
</tr>
<tr>
<td width="168"><strong>Hang </strong></td>
<td width="204"><a href="#PDAuto">ProcDump consecutive</a></td>
<td width="288"><a href="https://blogs.msdn.microsoft.com/chaun/2014/02/17/three-ways-to-automate-a-hang-dump-in-debugdiag-2-0/">Debug Diag Automated Hang Rule</a></td>
</tr>
<tr>
<td width="168" rowspan="4"><strong>Slow Response time</strong></td>
<td width="204"><a href="#IISLogs">IIS Logs</a></td>
<td width="288"><a href="#IISLogs">IIS Logs</a></td>
</tr>
<tr>
<td width="204"><a href="#FrebLogs">Freb Logs</a></td>
<td width="288"><a href="#FrebLogs">Freb Logs</a></td>
</tr>
<tr>
<td width="204"><a href="#PDManual">ProcDump manual</a></td>
<td width="288"><a href="https://blogs.msdn.microsoft.com/chiranth/2015/12/22/slow-response-automated-data-collection-using-freb-and-debug-diag/">DebugDiag Automate Slow response</a></td>
</tr>
<tr>
<td width="204"><a href="#PVManual">PerfView manual</a></td>
<td width="288"></td>
</tr>
<tr>
<td width="168" rowspan="2"><strong>High CPU </strong></td>
<td width="204"><a href="#PDManual">ProcDump manual</a></td>
<td width="288"><a href="#PDAuto">Procdump automated</a></td>
</tr>
<tr>
<td width="204"><a href="#PVManual">PerfView manual</a></td>
<td width="288"><a href="#PVAuto">PerfView automated</a></td>
</tr>
<tr>
<td width="168"><strong>High Memory </strong></td>
<td width="204"><a href="#PVManual">PerfView manual</a></td>
<td width="288"><a href="https://blogs.msdn.microsoft.com/asiatech/2014/01/13/debug-diagnostic-2-0-creating-a-memory-leak-rule-unmanaged-code/">Debug Diag Automated high memory</a></td>
</tr>
</tbody>
</table>
You would need one or more of these tools for collecting the logs depending up on the scenario:

Tool 1: <strong>Procdump</strong>  <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/procdump">https://docs.microsoft.com/en-us/sysinternals/downloads/procdump</a>

Tool 2: <strong>Perfview</strong> : <a href="https://www.microsoft.com/en-us/download/details.aspx?id=28567">https://www.microsoft.com/en-us/download/details.aspx?id=28567</a>

Tool 3: <strong>Debug Diag: </strong><a href="https://www.microsoft.com/en-us/download/details.aspx?id=49924">https://www.microsoft.com/en-us/download/details.aspx?id=49924</a>

&nbsp;
<h3 id="PDManual">ProcDump manually</h3>
<p style="padding-left: 30px">Following command can be used to attach the debugger to a process of which you want to capture the memory dump:</p>
<p style="padding-left: 30px"><strong>C:\Tools\procdump&gt; procdump.exe -ma -s 30 -n 3 &lt;PID&gt; &lt;OutputFolder&gt;</strong></p>
<p style="padding-left: 30px">- ma: Write a dump file with all process memory. The default dump format only includes thread and handle information.
-s: Consecutive seconds before dump is written (default is 10).
-n: Number of dumps to write before exiting.
-s:  Seconds between consecutive dumps. Change the parameter based on the slowness.
&lt;PID&gt;: replace this with the IP of the process for which you want to capture the dump. You can use Task Manager to get PID of the process.
&lt;outputFolder&gt;: Location where dump should be stored.</p>
&nbsp;
<h3 id="PDAuto">ProcDump automated / consecutive</h3>
<p style="padding-left: 30px">Following command will capture 3 consecutive memory dumps of process with id 5844 each after 5 seconds when CPU of that process reach 70% and save the dumps at c:\dumps\</p>
<p style="padding-left: 30px"><strong>C:\Tools\procdump&gt; procdump -ma -c 70 -s 5 -n 3 5844 c:\dumps\</strong></p>
<p style="padding-left: 30px">-ma: Write a dump file with all process memory. The default dump format only includes thread and handle information.
-c: CPU threshold at which to create a dump of the process.
-s: Consecutive seconds before dump is written (default is 10). Change the parameter based on slowness
-n: Number of dumps to write before exiting.</p>
&nbsp;
<h3 id="IISLogs">IIS Logs</h3>
<p style="padding-left: 30px">Location for collecting IIS logs
<strong>C:\Resources\Directory<em>\{DeploymentID}.{Rolename}.DiagnosticStore\LogFiles\Web</em></strong>
Collect the log files which are relevant to the time of issue</p>
&nbsp;
<h3 id="FrebLogs">Freb Logs</h3>
<p style="padding-left: 30px">Location for Collecting FREB logs
<strong>C:\Resources\Directory\{DeploymentID}.{Rolename}.DiagnosticStore\FailedReqLogFiles</strong></p>
<p style="padding-left: 30px">NOTE: This is not turned on by default in Windows Azure and is not frequently used.  But if you are troubleshooting IIS/ASP.NET specific issues you should consider turning FREB tracing on in order to get additional details. <a href="https://docs.microsoft.com/en-us/iis/configuration/system.webServer/tracing/traceFailedRequests/#how-to"><strong><em>How to enable Failed Request Tracing</em></strong></a></p>
&nbsp;
<h3 id="PVManual">PerfView manually</h3>
<ul>
 	<li>Open the perfview tool, go to Collect Menu and click on Collect option</li>
 	<li>Select Zip, Merge, thread time check box as below and Click on Start Collection.</li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/01/PerfViewManually.jpg"><img width="857" height="48" class="alignnone wp-image-3795 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/PerfViewManually.jpg" /></a></p>

<ul>
 	<li>Leave it for few seconds and stop the collection. (It will take a minute or so to create a compressed file)</li>
</ul>
&nbsp;
<h3 id="PVAuto">PerfView automated</h3>
<p style="padding-left: 30px">Following command can be used to capture 5 Perfview logs, 1000 MB each for w3wp.exe when it reached 60% CPU</p>
<p style="padding-left: 30px"><strong>C:\Tools\perfview&gt; Perfview /NoGui collect "/StartOnPerfCounter=Process:% Processor Time:w3wp&gt;60" -ThreadTime -CircularMB:1000 -CollectMultiple:5 –accepteula</strong>
<strong><em> </em></strong></p>
<p style="padding-left: 30px">-ThreadTime: Is a parameter that monitors the CPU Thread Time
-accepteula: specifies to automatically accept the Microsoft Software License Terms.
<strong><em> </em></strong>
Example:</p>
<p style="padding-left: 30px">If you're seeing 80% to 90% CPU utilization by w3wp.exe then this threshold value should be 80.</p>
&nbsp;
<h3>Ok, I have captured the data. What do I do with that?</h3>
Following are few helpful guidance to assist you in doing some initial analysis from the memory dumps/PerfView logs. Or you can always reach out to <a href="https://docs.microsoft.com/en-us/azure/azure-supportability/how-to-create-azure-support-request">Microsoft Azure Support</a> for additional help:
<p style="padding-left: 60px"><a href="https://blogs.msdn.microsoft.com/benjaminperkins/2016/02/01/analyze-a-memory-dump-using-the-debug-diagnostic-tool/">How to analyze a memory dump using Debug Diag</a></p>
<p style="padding-left: 60px"><a href="https://blogs.msdn.microsoft.com/cclayton/2010/06/21/basic-analysis-of-a-managed-memory-dump-net/">Process Crash analysis from a memory dump</a></p>
<p style="padding-left: 60px"><a href="https://blogs.msdn.microsoft.com/paullou/2011/06/28/debugging-managed-code-memory-leak-with-memory-dump-using-windbg/">How to analyze Memory Leak with memory dump using  WinDBG</a></p>
<p style="padding-left: 60px"><a href="https://bennettadelson.wordpress.com/2013/04/11/using-perfview-to-diagnose-a-net-memory-leak-2/">How to use PerfView to diagnose Memory Leak</a></p>
<p style="padding-left: 60px"><a href="https://channel9.msdn.com/Series/PerfView-Tutorial/PerfView-Tutorial-9-NET-Memory-Investigation-Basics-of-GC-Heap-Snapshots">Channel9 Tutorial on Memory investigation using PerfView</a></p>
<p style="padding-left: 60px"><a href="https://channel9.msdn.com/Series/PerfView-Tutorial/PerfView-Tutorial-2-A-Simple-CPU-Performance-Investigation">Channel9 Tutorial on CPU Performance investigation using PerfView</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Azure Blob Storage operations with Storage Python SDK</title>
      <link>https://docs.microsoft.com/archive/blogs/cie/azure-blob-storage-operations-with-storage-python-sdk</link>
      <pubDate>Sat, 13 May 2017 12:43:02 GMT</pubDate>
      <dc:creator><![CDATA[Mrutyunjaya Kar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cie/?p=3695</guid>
      <description><![CDATA[This blog describes how to perform the basic operations on blobs using the Python API. We’ll be...]]></description>
      <content:encoded><![CDATA[This blog describes how to perform the basic operations on blobs using the Python API. We’ll be using Python API provided in Azure SDK to achieve the following functionalities.
<ul>
 	<li>Create a container</li>
 	<li>Upload a blob into a container</li>
 	<li>Download blobs</li>
 	<li style="text-align: justify">List the blobs in a container</li>
 	<li>Delete a blob</li>
</ul>
<strong>Installing the SDK:</strong>

My machine is a 64-bit windows machine, so I downloaded the <strong>"Windows x86-64 executable installer" </strong>available under<strong> </strong>the latest version of Python for windows from <a href="https://www.python.org/downloads/windows/">here</a>.

Then I downloaded Azure storage SDK for Python. In order to do that, we need to follow any of the below 3 steps.

<u>Option 1: Via PyPi</u>

To install via the Python Package Index (PyPI), type:

<em>pip install azure-storage</em>

<u>Option 2: Source Via Git</u>

To get the source code of the SDK via git just type:

<em>git clone git://github.com/Azure/azure-storage-python.git</em>

<em>cd ./azure-storage-python</em>

<em>python setup.py install</em>

<u>Option 3: Source Zip</u>

Download a zip of the code via GitHub or PyPi. Then, type:

<em>cd ./azure-storage-python</em>

<em>python setup.py install</em>

<strong>Create a Container:</strong>

Every blob in Azure storage must reside in a container. Please make sure that the following naming convention has been followed for a container.
<ul>
 	<li>Container names must start with a letter or number, and can contain only letters, numbers, and the dash (-) character.</li>
 	<li>Every dash (-) character must be immediately preceded and followed by a letter or number; consecutive dashes are not permitted in container names.</li>
 	<li>All letters in a container name must be lowercase. Please note that the name of a container must always be lowercase. If you include an upper-case letter in a container name, or otherwise violate the container naming rules, you may receive a 400 error (Bad Request).</li>
 	<li>Container names must be from 3 through 63 characters long.</li>
</ul>
By default, the new container that is created is private. "<span><strong>public_access=PublicAccess.Container</strong>" is used in the code below to set the container access policy to "Container".  </span>Alternatively, you can modify a container after you have created it using "<strong>set_container_acl</strong>" method in "<span>blob_service" object</span>.

<span style="text-decoration: underline">Code used to create a container:</span>

<em>from azure.storage.blob import BlockBlobService</em>

<em>from azure.storage.blob import PublicAccess</em>

<em># Setting Parameters</em>

<em>ACCOUNT_NAME = "&lt;Your Storage account name&gt;"</em>

<em>ACCOUNT_KEY = "&lt;Your storage account key&gt;"</em>

<em>CONTAINER_NAME = "&lt;Container name you want to create&gt;"</em>

<em># Code block to create a container</em>

<em>blob_service = BlockBlobService(account_name=ACCOUNT_NAME, account_key=ACCOUNT_KEY)</em>

<em>try:</em>
<p style="padding-left: 60px"><em>container_status = blob_service.create_container(CONTAINER_NAME, public_access=PublicAccess.Container)</em></p>
<p style="padding-left: 60px"><em>print("Container %s"%CONTAINER_NAME + " creation success status: %s"%container_status)</em></p>
<p style="padding-left: 30px"><em>except:</em></p>
<p style="padding-left: 60px"><em>print("Container %s"%CONTAINER_NAME + " creation failed")</em></p>
<span style="text-decoration: underline">Screenshot:</span>

&nbsp;

<img alt="Create Container" src="https://mrkarblogs.blob.core.windows.net/firstblog/CreateContainer.png" />

<strong> </strong>

<strong>Upload a blob into a container:</strong>

To create a block blob and upload data, use the <strong>create_blob_from_path</strong>, <strong>create_blob_from_stream</strong>, <strong>create_blob_from_bytes</strong> or <strong>create_blob_from_text</strong> methods. They are high-level methods that perform the necessary chunking when the size of the data exceeds 64 MB. <strong>create_blob_from_path</strong> uploads the contents of a file from the specified path, and <strong>create_blob_from_stream</strong> uploads the contents from an already opened file/stream. <strong>create_blob_from_bytes</strong> uploads an array of bytes, and <strong>create_blob_from_text</strong> uploads the specified text value using the specified encoding (defaults to UTF-8).

<span style="text-decoration: underline">Code used to upload blob into a container:</span>

<em>from azure.storage.blob import BlockBlobService</em>

<em>from os import listdir</em>

<em>from os.path import isfile, join</em>

<em># Setting Parameters</em>

<em>ACCOUNT_NAME = "&lt;Your Storage account name&gt;"</em>

<em>ACCOUNT_KEY = "&lt;Your storage account key&gt;"</em>

<em>CONTAINER_NAME = "&lt;Your storage container name&gt;"</em>

<em>LOCAL_DIRECT = r"&lt;Local directory containing files&gt;"</em>

<em># Code block to upload blob to Blob storage</em>

<em>blob_service = BlockBlobService(account_name=ACCOUNT_NAME, account_key=ACCOUNT_KEY)</em>

<em>local_file_list = [f for f in listdir(LOCAL_DIRECT) if isfile(join(LOCAL_DIRECT, f))]</em>

<em>file_num = len(local_file_list)</em>

<em>for i in range(file_num):</em>
<p style="padding-left: 30px"><em>local_file = join(LOCAL_DIRECT, local_file_list[i])</em></p>
<p style="padding-left: 30px"><em>blob_name = local_file_list[i]</em></p>
<p style="padding-left: 30px"><em>try:</em></p>
<p style="padding-left: 60px"><em>blob_service.create_blob_from_path(CONTAINER_NAME, blob_name, local_file)</em></p>
<p style="padding-left: 60px"><em>print("File upload successful %s"%blob_name)</em></p>
<p style="padding-left: 30px"><em>except:</em></p>
<p style="padding-left: 60px"><em>print ("Something went wrong while uploading the files %s"%blob_name)</em></p>
<span style="text-decoration: underline">Screenshot:</span>

&nbsp;

<img alt="Upload Blobs" src="https://mrkarblogs.blob.core.windows.net/firstblog/BlobUpload.png" />

&nbsp;

<strong>Download Blobs:</strong>

To download data from a blob, use <strong>get_blob_to_path</strong>, <strong>get_blob_to_stream</strong>, <strong>get_blob_to_bytes</strong>, or <strong>get_blob_to_text</strong>. There are high-level methods that perform the necessary chunking when the size of the data exceeds 64 MB.

<span style="text-decoration: underline">Code used to download blob to a local directory:</span>

<em>from azure.storage.blob import BlockBlobService</em>

<em># Setting Parameters</em>

<em>ACCOUNT_NAME = "&lt;Your Storage account name&gt;"</em>

<em>ACCOUNT_KEY = "&lt;Your storage account key&gt;"</em>

<em>CONTAINER_NAME = "&lt;Your storage container name&gt;"</em>

<em>BLOB_TO_BE_DOWNLOADED = "&lt;Your Blob Name&gt;"</em>

<em># Code block to download blobs</em>

<em>blob_service = BlockBlobService(account_name=ACCOUNT_NAME, account_key=ACCOUNT_KEY)</em>

<em>try:</em>
<p style="padding-left: 30px"><em>blob_service.get_blob_to_path(CONTAINER_NAME, BLOB_TO_BE_DOWNLOADED , file_path = "&lt;Local Path&gt;\&lt;File Name&gt;.&lt;extension of the original blob&gt;")</em></p>
<p style="padding-left: 30px"><em>print("Blob has been downloaded")</em></p>
<em>except:</em>
<p style="padding-left: 30px"><em>print("Blob download failed")</em></p>
<span style="text-decoration: underline"><span>Screenshot</span><span>:</span></span>

&nbsp;

<img alt="Download Blobs" src="https://mrkarblogs.blob.core.windows.net/firstblog/DownloadBlob.png" />

&nbsp;

<strong>List the blobs in a container:</strong>

To list the blobs in a container, use the <strong>list_blobs</strong> method.

<span style="text-decoration: underline">Code used to list blobs in a container:</span>

<em>from azure.storage.blob import BlockBlobService</em>

<em># Setting Parameters</em>

<em>ACCOUNT_NAME = "&lt;Your Storage account name&gt;"</em>

<em>ACCOUNT_KEY = "&lt;Your storage account key&gt;"</em>

<em>CONTAINER_NAME = "&lt;Your storage container name&gt;"</em>

<em># Code block to list the blobs present in a container</em>

<em>blob_service = BlockBlobService(account_name=ACCOUNT_NAME, account_key=ACCOUNT_KEY)</em>

<em>try:</em>
<p style="padding-left: 30px"><em>blob_names = blob_service.list_blobs(CONTAINER_NAME)</em></p>
<p style="padding-left: 30px"><em>for blob in blob_names:</em></p>
<p style="padding-left: 60px"><em>print(blob.name)</em></p>
<em>except:</em>
<p style="padding-left: 30px"><em>print("Blob listing failed")</em></p>
<span style="text-decoration: underline"><span>Screenshot</span>:</span>

&nbsp;

<img alt="List Blobs in Container" src="https://mrkarblogs.blob.core.windows.net/firstblog/ListBlobs.png" />

&nbsp;

<strong>Delete a blob:</strong>

To delete a blob, we leverage <strong>delete_blob </strong>method.

<span style="text-decoration: underline">Code used to delete a blob:</span>

<em>from azure.storage.blob import BlockBlobService</em>

<em># Setting Parameters</em>

<em>ACCOUNT_NAME = "&lt;Your Storage account name&gt;"</em>

<em>ACCOUNT_KEY = "&lt;Your storage account key&gt;"</em>

<em>CONTAINER_NAME = "&lt;Your storage container name&gt;"</em>

<em>BLOB_TO_BE_DELETED = "&lt;Blob name with extension&gt;"</em>

<em># Code block to delete a blob</em>

<em>blob_service = BlockBlobService(account_name=ACCOUNT_NAME, account_key=ACCOUNT_KEY)</em>

<em>try:</em>
<p style="padding-left: 30px"><em>blob_service.delete_blob(CONTAINER_NAME, BLOB_TO_BE_DELETED)</em></p>
<p style="padding-left: 30px"><em>print("Blob has been deleted successfully")</em></p>
<em>except:</em>
<p style="padding-left: 30px"><em>print("Blob deletion failed")</em></p>
<span style="text-decoration: underline"><span>Screenshot</span>:</span>

&nbsp;

<img alt="Delete Blobs" src="https://mrkarblogs.blob.core.windows.net/firstblog/DeleteBlobs.png" />

&nbsp;

Articles referred:

Introduction on azure storage with Python: <a href="https://docs.microsoft.com/en-us/azure/storage/storage-python-how-to-use-blob-storage">https://docs.microsoft.com/en-us/azure/storage/storage-python-how-to-use-blob-storage</a>

Azure Storage SDK for Python: <a href="https://github.com/Azure/azure-storage-python">https://github.com/Azure/azure-storage-python</a>]]></content:encoded>
    </item>
    <item>
      <title>How to fix Load Balancer not working in Round-robin fashion for your Cloud Service</title>
      <link>https://docs.microsoft.com/archive/blogs/cie/how-to-fix-load-balancer-not-working-in-round-robin-fashion-for-your-cloud-service</link>
      <pubDate>Wed, 19 Apr 2017 12:20:28 GMT</pubDate>
      <dc:creator><![CDATA[VinothMariKumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cie/?p=3655</guid>
      <description><![CDATA[Issue:

I recently came across a case where customer has an issue that the Load balancer of...]]></description>
      <content:encoded><![CDATA[<div>

<strong><u><span style="color: #000000;font-family: Calibri">Issue:</span></u></strong>

<span style="color: #000000;font-family: Calibri">I recently came across a case where customer has an issue that the Load balancer of his cloud service is not working in round robin basis. He confirmed that by seeing more number of requests going to few instances whereas the other instances are getting very less number of requests. To analyse the issue, we have collected the IIS logs from all the instances( Customer has 7 instances) and when we parsed the logs, we could be able to confirm the same that 2 instances are getting very less number of requests than the other 5 instances. </span>

<strong><u><span style="color: #000000;font-family: Calibri">How Load Balancer works?</span></u></strong>

<span style="color: #000000;font-family: Calibri">Load balancer uses 5 tuple algorithm to distribute client requests by default. This algorithm is a 5 tuple (<strong>source IP, source port, destination IP, destination port, protocol type</strong>) hash to map traffic to available servers. It provides stickiness only within a transport session. Packets in the same TCP or UDP session will be directed to the same datacenter IP (DIP) instance behind the load balanced endpoint. When the client closes and re-opens the connection or starts a new session from the same source IP, the source port changes and causes the traffic to go to a different DIP endpoint. </span>

<span style="color: #000000;font-family: Calibri">If most of the load goes to a single instance, the number one reason is due to the testing client creating and reusing the same TCP connections. <strong>The Azure loadbalancer does round robin load balancing for new incoming TCP connections, not for new incoming HTTP requests.</strong> So when a client makes the first request to the cloudapp.net URL, the LB sees an incoming TCP connection and routes it to the next instance in the LB rotation, and then the TCP connection is established between the client and the server.  Depending on the client app, all future HTTP traffic from that client will may go over the same TCP connection or a new TCP connection. </span>

<span style="color: #000000;font-family: Calibri">In order to balance traffic across other Azure role instances the client must break the TCP connection and reestablish a new TCP connection.  Load balancing HTTP requests would lead to existing TCP connections getting killed and new ones getting created.  TCP process creation is a resource intensive process hence reusing the same TCP channel for subsequent HTTP requests is an efficient use of the channel. </span>

<span style="color: #000000;font-family: Calibri">If the client application is modified to make new TCP connection instead of HTTP requests (you can use multiple browser instances on the same client machine) then the TCP requests will end up on either Azure Instance in a round robin fashion. </span>

<span style="color: #000000;font-family: Calibri">So depending on how the clients are establishing TCP connections, requests may be routed to the same instance.</span>

<strong><u><span style="color: #000000;font-family: Calibri">Cause:</span></u></strong>

<strong><span style="color: #000000;font-family: Calibri">The Azure load balancer does round robin load balancing for new incoming TCP connections, not for new incoming HTTP requests.</span></strong>

<span style="color: #000000;font-family: Calibri">By default, the</span><span style="margin: 0px;color: #2a2a2a;font-family: 'Segoe UI',sans-serif;font-size: 10pt"> </span><a href="https://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpbinding(v=vs.110).aspx"><span style="margin: 0px;color: #00709f;font-family: 'Segoe UI',sans-serif;font-size: 10pt">BasicHttpBinding</span></a><span style="margin: 0px;color: #2a2a2a;font-family: 'Segoe UI',sans-serif;font-size: 10pt"> </span><span style="color: #000000;font-family: Calibri">sends a connection HTTP header in messages with a</span><span style="margin: 0px;color: #2a2a2a;font-family: 'Segoe UI',sans-serif;font-size: 10pt"> </span><strong>Keep-Alive</strong><span style="margin: 0px;color: #2a2a2a;font-family: 'Segoe UI',sans-serif;font-size: 10pt"> </span><span style="color: #000000;font-family: Calibri">value, which enables clients to establish persistent connections to the services that support them. This configuration offers enhanced throughput because previously established connections can be reused to send subsequent messages to the same server. </span>

<strong><u><span style="color: #000000;font-family: Calibri">Resolution:</span></u></strong>

<span style="color: #000000;font-family: Calibri">However, connection reuse may cause clients to become strongly associated to a specific server within the load-balanced farm, which reduces the effectiveness of round-robin load balancing. If this behavior is undesirable, HTTP</span><span style="font-family: Calibri"> </span><strong>Keep-Alive</strong> <span style="color: #000000;font-family: Calibri">can be disabled on the server using the</span><span style="margin: 0px;color: #2a2a2a;font-family: 'Segoe UI',sans-serif;font-size: 10pt"> </span><a href="https://msdn.microsoft.com/en-us/library/system.servicemodel.channels.httptransportbindingelement.keepaliveenabled(v=vs.110).aspx"><span style="margin: 0px;color: #00709f;font-family: 'Segoe UI',sans-serif;font-size: 10pt">KeepAliveEnabled</span></a><span style="margin: 0px;color: #2a2a2a;font-family: 'Segoe UI',sans-serif;font-size: 10pt"> </span><span style="color: #000000;font-family: Calibri">property with a</span><span style="margin: 0px;color: #2a2a2a;font-family: 'Segoe UI',sans-serif;font-size: 10pt"> </span><a href="https://msdn.microsoft.com/en-us/library/system.servicemodel.channels.custombinding(v=vs.110).aspx"><span style="margin: 0px;color: #00709f;font-family: 'Segoe UI',sans-serif;font-size: 10pt">CustomBinding</span></a><span style="margin: 0px;color: #2a2a2a;font-family: 'Segoe UI',sans-serif;font-size: 10pt"> </span><span style="color: #000000;font-family: Calibri">or user-defined</span><span style="margin: 0px;color: #2a2a2a;font-family: 'Segoe UI',sans-serif;font-size: 10pt"> </span><a href="https://msdn.microsoft.com/en-us/library/system.servicemodel.channels.binding(v=vs.110).aspx"><span style="margin: 0px;color: #00709f;font-family: 'Segoe UI',sans-serif;font-size: 10pt">Binding</span></a><span style="margin: 0px;color: #2a2a2a;font-family: 'Segoe UI',sans-serif;font-size: 10pt">. </span><span style="color: #000000;font-family: Calibri">The following example shows how to do this using configuration.</span><span style="margin: 0px;color: #4e586a;font-family: 'Segoe UI',sans-serif;font-size: 8pt"> </span>

<span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;?</span><span style="margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">xml</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt"> <span style="margin: 0px;color: red;font-family: 'Courier New';font-size: 10pt">version</span></span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">=</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">"</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">1.0</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">" </span><span style="margin: 0px;color: red;font-family: 'Courier New';font-size: 10pt">encoding</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">=</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">"</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">utf-8</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">" </span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">?&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;</span><span style="margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">configuration</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt"> </span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;</span><span style="margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">system.serviceModel</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">    </span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;</span><span style="margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">protocolMapping</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">      &lt;add scheme=”http” binding=”customBinding” /&gt;  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">    </span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;/</span><span style="margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">protocolMapping</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">    </span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;</span><span style="margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">bindings</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">      </span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;</span><span style="margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">customBinding</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">      </span><span style="margin: 0px;color: green;font-family: 'Courier New';font-size: 10pt">&lt;!-- Configure a CustomBinding that disables keepAliveEnabled--&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">        </span><span style="background: yellow;margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;</span><span style="background: yellow;margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">binding</span><span style="background: yellow;margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt"> <span style="background: yellow;margin: 0px;color: red;font-family: 'Courier New';font-size: 10pt">keepAliveEnabled</span></span><span style="background: yellow;margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">=</span><span style="background: yellow;margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">"</span><span style="background: yellow;margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">False</span><span style="background: yellow;margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">"</span><span style="background: yellow;margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">/&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">      </span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;/</span><span style="margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">customBinding</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">    </span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;/</span><span style="margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">bindings</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt"> </span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;/</span><span style="margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">system.serviceModel</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span>

<span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&lt;/</span><span style="margin: 0px;color: #a31515;font-family: 'Courier New';font-size: 10pt">configuration</span><span style="margin: 0px;color: blue;font-family: 'Courier New';font-size: 10pt">&gt;</span><span style="margin: 0px;color: black;font-family: 'Courier New';font-size: 10pt">  </span><span style="margin: 0px;font-family: 'Segoe UI',sans-serif;font-size: 8pt"><span style="color: #000000"> </span></span>

<span style="color: #000000;font-family: Calibri">Note: This is for a WCF application where multiple clients will make use of the services hosted in cloud.</span>

<span style="margin: 0px;color: #4e586a;font-family: 'Segoe UI',sans-serif;font-size: 8pt"> </span><strong><u><span style="color: #000000;font-family: Calibri">Useful Links:</span></u></strong>

<strong><span style="color: #000000;font-family: Calibri">Load Balancing -</span></strong> <a href="https://msdn.microsoft.com/en-us/library/ms730128(v=vs.110).aspx"><span style="color: #0563c1;font-family: Calibri">h</span><span style="color: #0563c1;font-family: Calibri">ttps://msdn.microsoft.com/en-us/library/ms730128(v=vs.110).aspx</span></a>

&nbsp;

</div>]]></content:encoded>
    </item>
    <item>
      <title>How to retrieve Job action settings of Scheduler Job using Powershell</title>
      <link>https://docs.microsoft.com/archive/blogs/cie/how-to-retrieve-job-action-settings-of-scheduler-job-using-powershell</link>
      <pubDate>Tue, 21 Feb 2017 17:39:41 GMT</pubDate>
      <dc:creator><![CDATA[VinothMariKumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cie/?p=3405</guid>
      <description><![CDATA[Sometimes, we may have a requirement to retrieve the job action details of your scheduled job in the...]]></description>
      <content:encoded><![CDATA[<span><span style="color: #000000;font-family: Calibri">Sometimes, we may have a requirement to retrieve the job action details of your scheduled job in the Scheduler job collections using Powershell. </span></span><span><span style="color: #000000;font-family: Calibri"> </span></span>

<span><span style="color: #000000;font-family: Calibri">There are no direct options available in PowerShell to retrieve the job action details. You need to cast the jobAction to appropriate derived class of the Action settings to retrieve the details of the action like like Uri, Storage Account,Service Bus Queue etc.,</span></span><span><span style="color: #000000;font-family: Calibri"> </span></span>

<span><span style="color: #000000;font-family: Calibri">Here is the sample PowerShell script which retrieves the details like Job Uri, Storage Account, Service Bus Queue etc.,</span></span>

<strong> PS Script: </strong>
<pre class="brush:Csharp">$schedulerJobs= Get-AzureRmSchedulerJobCollection -ResourceGroupName SchedulerIbiza -JobCollectionName testscheduler | Get-AzureRmSchedulerJob
foreach($job in $schedulerJobs) 
{
if($job.JobAction.JobActionType -eq "StorageQueue")
 {
     $jobAction = [Microsoft.Azure.Commands.Scheduler.Models.PSStorageJobActionDetails]$job.JobAction; 
     Write-Output 'Storage Account ' 
     Write-Output '----------------' 
     Write-Output  $jobAction.StorageAccount;
 }
elseif(($job.JobAction.JobActionType -eq "ServiceBusQueue") -or ($job.JobAction.JobActionType -eq "ServiceBusTopic"))
 {
     $jobActionSB = [Microsoft.Azure.Commands.Scheduler.Models.PSServiceBusJobActionDetails]$job.JobAction; 
     Write-Output 'Service Bus Queue ' 
     Write-Output '----------------  ' 
     Write-Output $jobActionSB.ServiceBusQueueName;
 }
 else
 {
    $jobActionHttp = [Microsoft.Azure.Commands.Scheduler.Models.PSHttpJobActionDetails]$job.JobAction; 
    Write-Output 'Job Name ' 
    Write-Output '-------- ' 
    Write-Output $jobActionHttp.Uri;
  }
}
</pre>
<strong><span style="color: #000000;font-family: Calibri">Below is the sample screenshot with the result:</span></strong><strong><span style="color: #000000;font-family: Calibri"><a href="https://msdnshared.blob.core.windows.net/media/2017/02/portalimages.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/02/portalimages-1024x582.png" alt="portalimages" width="1024" height="582" class="alignleft size-large wp-image-3625" /></a>
</span></strong>]]></content:encoded>
    </item>
    <item>
      <title>How to reclaim your recently deleted ServiceBus namespace “name” instead 7 days wait time</title>
      <link>https://docs.microsoft.com/archive/blogs/cie/how-to-fix-the-namespace-name-is-previously-used-in-another-project-and-has-been-deleted-less-than-one-week</link>
      <pubDate>Wed, 11 Jan 2017 13:51:31 GMT</pubDate>
      <dc:creator><![CDATA[Abhinav Ranjan Sinha MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cie/?p=3097</guid>
      <description><![CDATA[When you have multiple subscriptions, sometimes you create namespace in some another subscription...]]></description>
      <content:encoded><![CDATA[When you have multiple subscriptions, sometimes you create namespace in some another subscription rather than the one in which you exactly wanted to create. Some of the customers delete the namespace and try to create the namespace in correct subscription by same name, however creating namespace it gives error saying, the namespace name is previously used in another project and has been deleted less than one week.

This is due to 7-day grace period when a namespace is deleted. Service Bus doesn't allow someone to claim the namespace before 7 days from any other subscription.

This will get re-created immediately if it’s being created in the same subscription. If the deletion and re-creation is being done in two distinct subscription, then there is blocking period of 7 days and you need to wait for that.

<strong>To overcome this issue, you can follow the steps mentioned below:</strong>

You can move the Service Bus namespace from one subscription to another subscription.

Just make sure that the user is admin/owner for both source and destination subscriptions.

To move the resources from one subscription to another go to new Azure Portal(Ibiza) and re-create the namespace in the same subscription from which you have deleted it

Once Service bus namespace is created, select your Service Bus namespace, and go to Overview section, there under Essentials you will find an option of Subscription name (change) as shown in below image.

<img src="https://abhinavblogimages.blob.core.windows.net/blogimagecontainer/1.png" alt="change subscription" />

&nbsp;

<img src="https://abhinavblogimages.blob.core.windows.net/blogimagecontainer/2.png" alt="move resource" />

&nbsp;

It will take some time to complete the move resource operation, finally it will show notification once it gets completed as shown below.

&nbsp;

<img src="https://abhinavblogimages.blob.core.windows.net/blogimagecontainer/3.png" alt="notification" />

Note: Once you moved the resource to another subscription, please check in the destination Subscription and confirm if the resource is moved, as sometimes it ends up with failure error.

Hope it helps...]]></content:encoded>
    </item>
    <item>
      <title>How to add missing resource types in azure</title>
      <link>https://docs.microsoft.com/archive/blogs/cie/how-to-add-missing-resource-types-in-azure</link>
      <pubDate>Wed, 11 Jan 2017 13:50:44 GMT</pubDate>
      <dc:creator><![CDATA[mabira]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cie/?p=3316</guid>
      <description><![CDATA[Some of you may get this error "Handling the error 'The subscription ‘xxxxxx’ is not registered for...]]></description>
      <content:encoded><![CDATA[<span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt">Some of you may get this error </span><i><span style="margin: 0px;color: #993300;font-family: 'Georgia',serif;font-size: 12pt">"Handling the error 'The subscription ‘xxxxxx’ is not registered for resource types 'Microsoft.ServiceBus/namespaces'. (Code: MissingRegistrationsForTypes)"</span></i><span style="margin: 0px;color: #993300;font-family: 'Georgia',serif;font-size: 12pt"> </span><span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt">when trying to move resource from one subscription to another subscription.</span>

<span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt">This error is expected if our destination subscription is not registered with the required types beforehand.</span>

<span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt">To overcome, it is suggested to first register the destination subscription with the required type for this movement. It is nothing but preparing the destination subscription for this movement, failing would through this error </span><i><span style="margin: 0px;color: #993300;font-family: 'Georgia',serif;font-size: 12pt">"The subscription ‘xxxxxx’ is not registered for resource types 'Microsoft.xxxxx/namespaces'. (Code: MissingRegistrationsForTypes)" </span></i>

<b><span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt">Resolution: </span></b>

<span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt"><span>1.<span style="font: 7pt 'Times New Roman';margin: 0px">  </span></span></span><span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt">Login to our new portal(portal.azure.com) with the destination subscription login credentials</span>

<span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt"><span>2.<span style="font: 7pt 'Times New Roman';margin: 0px"> </span></span></span><span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt">As in the below image, click on "My permissions" under the user Id(top most right)</span>

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2017/01/portal_permission.jpg"><span><span style="color: #000000;font-family: Times New Roman"><img width="1044" height="37" alt="portal_permission" src="https://msdnshared.blob.core.windows.net/media/2017/01/portal_permission.jpg" border="0" /></span></span></a>

<span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt"><span>3.<span style="font: 7pt 'Times New Roman';margin: 0px">  </span></span></span><span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt">Click on Resources provider, it will list the complete “Resources Provider Status” which one is registered and not.</span>

<span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt"><span>4.<span style="font: 7pt 'Times New Roman';margin: 0px"> </span></span></span><span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt">Select the type which is required at the destination side and register.</span>

<span style="margin: 0px;color: black;font-family: 'Georgia',serif;font-size: 12pt">Let's say, for an example, if we require having  'Microsoft.Eventhub' at destination side, then click on the "register" link to get this registered which is of one time process. </span>

<span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt"><a href="https://msdnshared.blob.core.windows.net/media/2017/01/rp_type.jpg"><span><span style="color: #000000;font-family: Times New Roman"><img width="791" height="243" alt="rp_type" src="https://msdnshared.blob.core.windows.net/media/2017/01/rp_type.jpg" border="0" /></span></span><span>
</span></a></span>

<span style="margin: 0px;color: black;font-family: 'Georgia',serif;font-size: 12pt">5. Once the registration is successful, we can move this resources between subscription. </span>

<span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt">Alternatively, we could also register this type through PowerShell.</span>

<span lang="EN-IN" style="margin: 0px;color: #1f497d;font-family: 'Georgia',serif">Add-AzureRmAccount
Register-AzureRmResourceProvider -ProviderNamespace Microsoft.EventHub</span>

<span style="margin: 0px;color: #333333;font-family: 'Georgia',serif;font-size: 12pt">For more information about the command you can find in this link:</span><span lang="EN-IN">
</span><span style="margin: 0px;color: #333333;font-family: 'Georgia',serif"><a href="https://msdn.microsoft.com/en-us/library/mt603685.aspx/"><span lang="EN-IN">https://msdn.microsoft.com/en-us/library/mt603685.aspx/</span></a></span><span style="margin: 0px;color: black;font-family: 'Georgia',serif"> </span>

<span><span style="color: #000000;font-family: Calibri">              </span></span>]]></content:encoded>
    </item>
    <item>
      <title>Troubleshooting: Azure Auto-scale profile does not change</title>
      <link>https://docs.microsoft.com/archive/blogs/cie/troubleshooting-azure-auto-scale-profile-does-not-change</link>
      <pubDate>Tue, 03 Jan 2017 12:52:14 GMT</pubDate>
      <dc:creator><![CDATA[Souvik Das(Black Knight)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cie/?p=2995</guid>
      <description><![CDATA[Sometimes customers are faced with situation with Auto Scale, where they try to update or delete the...]]></description>
      <content:encoded><![CDATA[Sometimes customers are faced with situation with Auto Scale, where they try to update or delete the Auto Scale Profile but the previous Profile keeps coming back.

&nbsp;

Generally, this occurs due to duplicate profiles getting created for Auto Scaling. So, deleting the duplicate profile should help to mitigate the issue. Here’re steps to delete auto scale profile through <a href="https://resources.azure.com/">https://resources.azure.com/</a>:

&nbsp;
<ul>
 	<li>Navigate to <a href="https://resources.azure.com/">https://resources.azure.com/</a></li>
 	<li>On the left-hand side panel expand the subscriptions tab as shown below
<img width="281" height="66" class="alignnone size-full wp-image-3715" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/01/img1.png" /></li>
</ul>
<ul>
 	<li>Under the subscriptions, expand the subscription under which Cloud service is created, and then Expand the resourceGroups tab as below
<img width="254" height="56" class="alignnone size-medium wp-image-3725" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/01/img2.png" /></li>
</ul>
<ul>
 	<li>Select and expand the Cloud Service that you are facing the Issue with.</li>
 	<li>Expand the provider’s tab and then the Microsoft.insights tab under provider’s tab as below, to list autoscale profiles created under cloud service
<img width="300" height="200" class="alignnone size-medium wp-image-3735" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/01/Img3-300x200.png" /></li>
</ul>
<ul>
 	<li>Select the obsolete profile and delete it using the tab on the main panel as shown below
<img width="300" height="93" class="alignnone size-medium wp-image-3745" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/01/Img4-300x93.png" /><strong></strong></li>
</ul>
&nbsp;

<strong>NOTE: Deleting the profile will permanently remove the Auto-Scale profile. Please make sure that you have selected the correct Cloud service and the correct profile in it and then go for deletion.</strong><strong> </strong>

Following the above steps should resolve the Issue that you were facing. If the issue persists, you may want to open a support ticket with Microsoft Azure support team.]]></content:encoded>
    </item>
    <item>
      <title>Can we use set-query-parameter policy inside send-request policy?  -No</title>
      <link>https://docs.microsoft.com/archive/blogs/cie/can-we-use-set-query-parameter-policy-inside-send-request-policy-no</link>
      <pubDate>Mon, 02 Jan 2017 13:21:03 GMT</pubDate>
      <dc:creator><![CDATA[Kalpit Singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cie/?p=3015</guid>
      <description><![CDATA[Several times you come across a situation where you should use send-request policy to make use of an...]]></description>
      <content:encoded><![CDATA[Several times you come across a situation where you should use send-request policy to make use of an external service to perform complex processing functions and return data to the API management service that can be used for further policy processing.

The send-request policy looks like this:

<code>
&lt;send-request mode="new" response-variable-name="tokenstate" timeout="20" ignore-error="true"&gt;
&lt;set-url&gt;https://microsoft-apiappec990ad4c76641c6aea22f566efc5a4e.azurewebsites.net/introspection&lt;/set-url&gt;
&lt;set-method&gt;POST&lt;/set-method&gt;
&lt;set-header name="Authorization" exists-action="override"&gt;
&lt;value&gt;basic dXNlcm5hbWU6cGFzc3dvcmQ=&lt;/value&gt;
&lt;/set-header&gt;
&lt;set-header name="Content-Type" exists-action="override"&gt;
&lt;value&gt;application/x-www-form-urlencoded&lt;/value&gt;
&lt;/set-header&gt;
&lt;set-body&gt;@($"token={(string)context.Variables["token"]}")&lt;/set-body&gt;
&lt;/send-request&gt;
</code>

Now if you want to use query string parameters in the URL under set-url policy used above using set-query-parameter <span>policy then it is not allowed and you will not be able to even save your configured policy. Generally, we get confused and try to make use of this policy inside send-request policy but </span>set-query-parameter policy is used to add, replace value of, or deletes request query string parameter. It Can be used to pass query parameters expected by the <strong>backend service</strong> which are optional or never present in the request according to this link <a href="https://msdn.microsoft.com/library/azure/7406a8ce-5f9c-4fae-9b0f-e574befb2ee9#SetQueryStringParameter">https://msdn.microsoft.com/library/azure/7406a8ce-5f9c-4fae-9b0f-e574befb2ee9#SetQueryStringParameter</a>
Now the question is how to pass query string parameters? It’s very simple and logical, we can make use of APIM variables in this scenario.

Firstly, setting the variables with some values:

<code>&lt;set-variable name="fromDate" value="@(context.Request.Url.Query["fromDate"].Last())"&gt;
&lt;set-variable name="toDate" value="@(context.Request.Url.Query["toDate"].Last())"&gt;</code>

And secondly making use of these variables inside send-request policy:

<code>&lt;send-request mode="new" response-variable-name="revenuedata" timeout="20" ignore-error="true"&gt;
&lt;set-url&gt;@($"<a href="https://accounting.acme.com/salesdata?from=%7b(string)context.Variables%5b">https://accounting.acme.com/salesdata?from={(string)context.Variables[</a>"fromDate"]}&amp;to={(string)context.Variables["fromDate"]}")"&lt;/set-url&gt;
&lt;set-method&gt;GET&lt;/set-method&gt;&lt;/send-request&gt;</code>

Refer this link for more details <a href="https://github.com/Microsoft/azure-docs/blob/master/articles/api-management/api-management-sample-send-request.md">https://github.com/Microsoft/azure-docs/blob/master/articles/api-management/api-management-sample-send-request.md</a>

Please let me know your queries.

Happy Coding!]]></content:encoded>
    </item>
    <item>
      <title>How to protect an API in Azure APIM using Azure Active Directory.</title>
      <link>https://docs.microsoft.com/archive/blogs/cie/how-to-protect-an-api-in-azure-apim-using-azure-active-directory</link>
      <pubDate>Wed, 14 Dec 2016 14:37:18 GMT</pubDate>
      <dc:creator><![CDATA[Kalpit Singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cie/?p=2825</guid>
      <description><![CDATA[This article is intended to summarize a very common scenario where we would like to authenticate an...]]></description>
      <content:encoded><![CDATA[This article is intended to summarize a very common scenario where we would like to authenticate an API using OAuth2.0 authentication using azure AD and Azure API Management. There exist a simple and easy way to do the same. Here’re the steps,

We need to make two applications inside Azure Active Directory. In this case I am naming these as EchoBackend (your Backend API which is a web application) and Testclientapp(The Client API which is a native app). I am mentioning the steps assuming you are familiar in making applications in azure AD and with the Publisher and Developer portal of azure APIM.

&nbsp;
<ol>
 	<li>Make <strong>EchoBackend</strong> application with the help of following information: [Type: <strong>Web Application</strong>]
<ol>
 	<li>Name: EchoBackend</li>
 	<li>Sign-On-Url: <a href="https://NormalAuthAD.onmicrosoft.com/echo">https://NormalAuth.onmicrosoft.com/echo</a></li>
 	<li>Client ID: xxxxxxxx-50ad-4a34-a4ed-63f7ff4ae762 (assuming)</li>
 	<li>App Id Uri: <a href="https://kalpitsinghtest.azure-api.net/">https://kalpitsinghtest.azure-api.net/</a></li>
 	<li>Add permissions: 1- read directory data 2- sign in and read user profile.</li>
</ol>
</li>
</ol>
&nbsp;
<ol start="2">
 	<li>Make <strong>Testclientapp</strong> application with following parameters: [Type: <strong>Native App</strong>]
<ol>
 	<li>Name: Testclientapp</li>
 	<li>Client ID: yyyyyyyy-5659-4cf6-87bd-ad8d176521d2 (assuming)</li>
 	<li>redirectURI: <a href="https://kalpitsinghtest.portal.azure-api.net/docs/services/57d0xxxxxxxxx208bce4386c/console/oauth2/authorizationcode/callback">https://kalpitsinghtest.portal.azure-api.net/docs/services/57d0xxxxxxxxx208bce4386c/console/oauth2/authorizationcode/callback</a> (can be taken from the publisher portal with respect to your API or for time being it can be anything)</li>
 	<li>Add Permission: 1- Access echo backend 2-Check the last permission.</li>
</ol>
</li>
</ol>
&nbsp;
<ol start="3">
 	<li>Change the security to OAuth2.0 in developer portal:
<ol>
 	<li>Make Authorization end point url: <a href="https://login.microsoftonline.com/374bxxxxxxx-4b92-a9c9-8bea4b16f35a/oauth2/authorize">https://login.microsoftonline.com/374bxxxxxxx-4b92-a9c9-8bea4b16f35a/oauth2/authorize</a></li>
 	<li>Add one Additional body parameters named resource with value web app Uri-  <strong>resource</strong> : <a href="https://kalpitsinghtest.azure-api.net/">https://kalpitsinghtest.azure-api.net/</a></li>
 	<li>Client authentication method: basic</li>
 	<li>Clinet ID: yyyyyyyy-5659-4cf6-87bd-ad8d176521d2</li>
 	<li>Authorization endpoint url and Token endpoint URL: as per AD tenant.</li>
 	<li>Use the redirect_uri as testclientapp.</li>
</ol>
</li>
</ol>
<em>                           </em>

Please refer following article documenting more details: <a href="https://azure.microsoft.com/en-in/documentation/articles/api-management-howto-protect-backend-with-aad/#configure-an-api-management-oauth-20-authorization-server">https://azure.microsoft.com/en-in/documentation/articles/api-management-howto-protect-backend-with-aad/#configure-an-api-management-oauth-20-authorization-server</a>

&nbsp;

Hope this simplifies the understanding.

Happy Coding!]]></content:encoded>
    </item>
    <item>
      <title>Detect backend api response latency using APIM policy</title>
      <link>https://docs.microsoft.com/archive/blogs/cie/detect-backend-api-response-latency-using-apim-policy</link>
      <pubDate>Thu, 01 Dec 2016 05:35:19 GMT</pubDate>
      <dc:creator><![CDATA[Kalpit Singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cie/?p=2795</guid>
      <description><![CDATA[Recently I had a query from a developer asking is there a way to identify response time by backend...]]></description>
      <content:encoded><![CDATA[Recently I had a query from a developer asking is there a way to identify response time by backend API by using Azure API management policy expression.
There is no direct policy expression which tracks the response time by backend API. However, we can use few policy expressions in Inbound and outbound to achieve the same.
For example, I used the set-variable policy expression to store current DateTime, one in inbound (i.e. request received time) and another in outbound (i.e. response received time) and then subtracted request received time from response received time to find the difference between the two which will be the time taken by the backend APIs.

Here's how the policy configuration looks like:
<pre class="brush:Csharp" id="code">&lt;policies&gt;
 &lt;inbound&gt;
 &lt;set-variable name="Time1" value="@(DateTime.Now)" /&gt;
 &lt;base /&gt;
 &lt;/inbound&gt;
 &lt;backend&gt;
 &lt;base /&gt;
 &lt;/backend&gt;
 &lt;outbound&gt;
 <strong>&lt;set-variable name="Time2" value="@(DateTime.Now-context.Variables.GetValueOrDefault&lt;DateTime&gt;("Time1"))" /&gt;
</strong> &lt;log-to-eventhub logger-id="neweventlogger"&gt;
 @( string.Join(",", DateTime.UtcNow, context.Deployment.ServiceName, context.RequestId, context.Request.IpAddress, context.Operation.Name,context.User.Email,<strong>context.Variables.GetValueOrDefault&lt;TimeSpan&gt;("Time2")</strong>) ) 
 &lt;/log-to-eventhub&gt;
 &lt;base /&gt;
 &lt;/outbound&gt;
&lt;/policies&gt;            
</pre>
This policy return string as:
'11/25/2016 12:31:39 PM,kalpitsinghtest.azure-api.net,bc9f3ace-39dd-43ba-a1c0-d65176210ce1,52.187.51.17,Create resource,user@domain.com,<strong>00:00:00.4233085</strong>'

Let me know how it goes.

Happy Coding!]]></content:encoded>
    </item>
  </channel>
</rss>