<?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>UK Hybrid Cloud Team</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ukhybridcloud/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ukhybridcloud/feed.xml</link>
    <description>Azure and Hybrid Cloud Technologies</description>
    <lastBuildDate>Thu, 28 Mar 2019 17:38:05 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Blog Migration</title>
      <link>https://docs.microsoft.com/archive/blogs/ukhybridcloud/blog-migration</link>
      <pubDate>Thu, 28 Mar 2019 17:15:03 GMT</pubDate>
      <dc:creator><![CDATA[CliveW]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ukhybridcloud/?p=4235</guid>
      <description><![CDATA[Hi all,

We have decided to move the Blog to a new...]]></description>
      <content:encoded><![CDATA[Hi all,

We have decided to move the Blog to a new location: <a href="https://cloudblogs.microsoft.com/industry-blog/en-gb/cross-industry/">https://cloudblogs.microsoft.com/industry-blog/en-gb/cross-industry/</a>

New posts will be going to this new location, and I will migrate the old posts over the next few weeks.  Look for Tags: <strong>Azure</strong> and <strong>Hybrid Cloud </strong>

&nbsp;

Example:

<a href="https://cloudblogs.microsoft.com/industry-blog/en-gb/tag/hybridcloud/">https://cloudblogs.microsoft.com/industry-blog/en-gb/tag/hybridcloud/ </a>

&nbsp;

Thanks,

Clive and the UK Hybrid Cloud Team

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Azure Log Analytics: Looking at data and costs</title>
      <link>https://docs.microsoft.com/archive/blogs/ukhybridcloud/azure-log-analytics-looking-at-data-and-costs</link>
      <pubDate>Fri, 08 Feb 2019 16:56:16 GMT</pubDate>
      <dc:creator><![CDATA[CliveW]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ukhybridcloud/?p=4195</guid>
      <description><![CDATA[At some stage, you either need to add a new set of data to Log Analytics or even look at your usage...]]></description>
      <content:encoded><![CDATA[<span style="font-size: medium">At some stage, you either need to add a new set of data to Log Analytics or even look at your usage and costs.</span>

<span style="font-size: medium">Originally you looked at the <strong>Usage</strong> table for this data. </span>

<span style="font-size: medium">Reference:
</span><a href="https://docs.microsoft.com/en-us/azure/azure-monitor/platform/log-standard-properties" title="https://docs.microsoft.com/en-us/azure/azure-monitor/platform/log-standard-properties"><span style="font-size: medium">https://docs.microsoft.com/en-us/azure/azure-monitor/platform/log-standard-properties</span></a><span style="font-size: medium"> </span>

<span style="font-size: medium">and </span>

<a href="https://docs.microsoft.com/en-us/azure/azure-monitor/platform/manage-cost-storage" title="https://docs.microsoft.com/en-us/azure/azure-monitor/platform/manage-cost-storage"><span style="font-size: medium">https://docs.microsoft.com/en-us/azure/azure-monitor/platform/manage-cost-storage</span></a>

&nbsp;

<span style="font-size: medium">As you can see from these docs (and please read them as I wont go over the content here), <strong>Usage</strong> and some of the queries have moved to a new method using <strong>Union</strong> .</span>

<span style="font-size: medium"> </span>

<span style="font-size: medium"><u>Here are a few of my own that use this new technique.</u></span>

<span style="font-size: medium"> </span>

<span style="font-size: medium">In this first example I take the sum of all bytes sent to all solutions.  I have commented out the <strong>_IsBillable</strong> line as I wanted to show both data types.  </span>

<span style="font-size: medium">A customer this week asked which solutions were free, this shows you that detail (after you have collected some data of course).  </span>

<span style="font-size: medium">However if you don't have the data, you can do a check within the public Demo Log Analytics workspace:  <a href="https://portal.loganalytics.io/demo#/" title="https://portal.loganalytics.io/demo#/">https://portal.loganalytics.io/demo#/</a> </span>

<span style="font-size: medium"><strong>TIP</strong>: <em>this can be a good place to check, if the solution is chargeable before you add it to your own!  or use this to guage the likely data quantity.  Also see <a href="https://blog.peterschen.de/data-volume-estimation-for-log-analytics/" title="https://blog.peterschen.de/data-volume-estimation-for-log-analytics/">https://blog.peterschen.de/data-volume-estimation-for-log-analytics/</a>  </em></span>Which I've now updated at the end of this post.

&nbsp;

<span style="font-size: small"><strong>//MBytes sent to Log Analytics by ALL solutions/Tables
<span style="font-size: small"><strong>union withsource = tt *
<span style="font-size: small"><strong>//| where _IsBillable == true
<span style="font-size: small"><strong>| summarize MBytes=round(sum(_BilledSize/1024/1024),2)  by  Solution=tt  , _IsBillable
<span style="font-size: small"><strong>| sort by MBytes nulls last</strong></span></strong></span></strong></span></strong></span></strong></span>

<a href="https://msdnshared.blob.core.windows.net/media/2019/02/image13.png"><img width="855" height="497" title="image" alt="image" src="https://msdnshared.blob.core.windows.net/media/2019/02/image_thumb11.png" border="0" /></a>

<span style="font-size: medium"> </span>

<span style="font-size: medium">You could then use this list to identify just one solution to drill into:</span>

<span style="font-size: small"><strong>let SolutionName= "AzureDiagnostics";
<span style="font-size: small"><strong>union withsource = tt *
<span style="font-size: small"><strong>| where TimeGenerated &gt; ago(1d)
<span style="font-size: small"><strong>| where _IsBillable == true
<span style="font-size: small"><strong>| where tt == SolutionName
<span style="font-size: small"><strong>| summarize MBytes=round(sum(_BilledSize/1024/1024),2) by Solution=tt , _IsBillable
<span style="font-size: small"><strong>| sort by MBytes nulls last</strong></span></strong></span></strong></span></strong></span></strong></span></strong></span></strong></span>

<span style="font-size: medium"> </span>

<span style="font-size: medium"></span>

<a href="https://msdnshared.blob.core.windows.net/media/2019/02/image14.png"><img width="855" height="252" title="image" alt="image" src="https://msdnshared.blob.core.windows.net/media/2019/02/image_thumb12.png" border="0" /></a>

&nbsp;

This last example, would build on the last query and look at just the <strong>NetworkSecurityGroup</strong> (NSG) resources.

&nbsp;

<strong><span style="font-size: small">union withsource = tt *
</span><strong><strong><span style="font-size: small">| where TimeGenerated &gt; ago(1d)
</span><strong><span style="font-size: small">| where _IsBillable == true
</span><strong><span style="font-size: small">| where tt == "AzureDiagnostics" and ResourceType=="NETWORKSECURITYGROUPS"
</span><strong><span style="font-size: small">| summarize MBytes=round(sum(_BilledSize/1024/1024),2) by Solution=tt , _IsBillable ,Resource
<strong>| sort by MBytes nulls last</strong></span></strong></strong></strong></strong></strong></strong>

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2019/02/image15.png"><img width="855" height="317" title="image" alt="image" src="https://msdnshared.blob.core.windows.net/media/2019/02/image_thumb13.png" border="0" /></a>

&nbsp;

Updated query from post  <a href="https://blog.peterschen.de/data-volume-estimation-for-log-analytics/">https://blog.peterschen.de/data-volume-estimation-for-log-analytics/ </a>

Example 1: This just shows you the data when its a <strong>billable</strong> equals <strong>True </strong> metric (See line 4)
<div>
<div><strong>let daystoSearch = 1d;</strong></div>
<div><strong>union withsource = tt * </strong></div>
<div><strong>| where TimeGenerated &gt; ago(daystoSearch)</strong></div>
<div><strong>| where _IsBillable == True</strong></div>
<div><strong>| summarize     </strong></div>
<div><strong>              RecordCount=count(),</strong></div>
<div><strong>              MbperRecord = round(sum(_BilledSize / 1024 / 1024) / count(), 4) ,</strong></div>
<div><strong>              TotalMBytes= round(sum(_BilledSize/1024/1024),4)  </strong></div>
<div><strong>              by SolutionName = tt</strong></div>
<div><strong>| sort by SolutionName asc</strong></div>
</div>
<div></div>
<div></div>
<div></div>
<div>or, in example 2 we look at all data and show the _IsBillable status in a column</div>
<div></div>
<div></div>
<div></div>
<div>
<div>
<div>
<div>
<div><strong>let daystoSearch = 1d;</strong></div>
<div><strong>union withsource = tt * </strong></div>
<div><strong>| where TimeGenerated &gt; ago(daystoSearch)</strong></div>
<div><strong>| summarize     </strong></div>
<div><strong>              RecordCount=count(),</strong></div>
<div><strong>              MbperRecord = round(sum(_BilledSize / 1024 / 1024) / count(), 4) ,</strong></div>
<div><strong>              TotalMBytes= round(sum(_BilledSize/1024/1024),4)  </strong></div>
<div><strong>              by SolutionName = tt, _IsBillable</strong></div>
<div><strong>| sort by SolutionName asc</strong></div>
</div>
</div>
<div></div>
<div></div>
<div><a href="https://msdnshared.blob.core.windows.net/media/2019/02/isbill.jpg"><img width="626" height="392" class="alignnone wp-image-4215" alt="" src="https://msdnshared.blob.core.windows.net/media/2019/02/isbill-300x188.jpg" /></a></div>
</div>
</div>
<div><strong>Updated</strong></div>
<div></div>
<div>Sometimes its also useful (thanks Jason Hall) to see the Azure Service and Resources that are emitting the data.  If you only want to look at one Solution please edit line 5.</div>
<div></div>
<div>
<div>
<div><strong>// Data Usage + identify the resources emitting data </strong></div>
<div><strong>let daystoSearch = 1d;</strong></div>
<div><strong>union withsource = tt * </strong></div>
<div><strong>| where TimeGenerated &gt; ago(daystoSearch)</strong></div>
<div><strong>//| where tt == "AzureDiagnostics"   // look for a specifc solution?</strong></div>
<div><strong>| summarize     </strong></div>
<div><strong>              RecordCount=count(),</strong></div>
<div><strong>              MbperRecord =  round(count() / sum(_BilledSize/1024/1024),2) ,</strong></div>
<div><strong>              TotalMBytes= round(sum(_BilledSize/1024/1024),2)  </strong></div>
<div><strong>              by SolutionName = tt,</strong></div>
<div><strong>                 _IsBillable,      // is this billable data?</strong></div>
<div><strong>                 ResourceProvider, // what Azure Service</strong></div>
<div><strong>                 Resource          // what entity in that service</strong></div>
<div>

<strong>| sort by SolutionName asc, TotalMBytes</strong>

&nbsp;

</div>
</div>
</div>
<div><a href="https://msdnshared.blob.core.windows.net/media/2019/02/serv.jpg"><img width="720" height="84" class="alignnone wp-image-4225" alt="" src="https://msdnshared.blob.core.windows.net/media/2019/02/serv-300x35.jpg" /></a></div>
<div></div>
<div>Add with ResourceGroup Info (for AzureDiagnostics):</div>
<div></div>
<div>
<div style="font-family: 'Segoe UI', 'Helvetica Neue', 'Apple Color Emoji', 'Segoe UI Emoji', Helvetica, Arial, sans-serif;font-size: 14px;font-style: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px">
<div><strong>// Data Usage + identify the resources emitting data </strong></div>
<div><strong>let daystoSearch = 1d;</strong></div>
<div><strong>union withsource = tt * </strong></div>
<div><strong>| where TimeGenerated &gt; ago(daystoSearch)</strong></div>
<div><strong>| where tt == "AzureDiagnostics" // look for a specifc solution?</strong></div>
<div><strong>| summarize </strong></div>
<div><strong> RecordCount=count(),</strong></div>
<div><strong> MbperRecord = round(count() / sum(_BilledSize/1024/1024),2) ,</strong></div>
<div><strong> TotalMBytes= round(sum(_BilledSize/1024/1024),2) </strong></div>
<div><strong> by SolutionName = tt,</strong></div>
<div><strong> _IsBillable, // is this billable data?</strong></div>
<div><strong> ResourceProvider, // what Azure Service</strong></div>
<div><strong> Resource , // what entity in that service</strong></div>
<div><strong> ResourceGroup</strong></div>
<div><strong>| sort by SolutionName asc, TotalMBytes</strong></div>
</div>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Azure Log Analytics: Disk Space Usage – Part 3</title>
      <link>https://docs.microsoft.com/archive/blogs/ukhybridcloud/azure-log-analytics-disk-space-usage-part-3-2</link>
      <pubDate>Wed, 06 Feb 2019 18:25:32 GMT</pubDate>
      <dc:creator><![CDATA[CliveW]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ukhybridcloud/?p=4125</guid>
      <description><![CDATA[This is a minor update I have been meaning to post for quite a few weeks now.Series Decompose...]]></description>
      <content:encoded><![CDATA[<p><br></p><p><font size="3">This is a minor update I have been meaning to post for quite a few weeks now.</font></p><p><font size="3">Series Decompose Forecast has been introduced and in my mind it makes the trend for disk (and other data points) easier to code and to view.</font></p><p><br></p><p><strong><font size="3">// Dec 2018 option, using Series_decompose_forecast </font></strong><p><strong><font size="3">//</font></strong><p><strong><font size="3">// Project disk capacity forward nn days</font></strong><p><strong><font size="3">let myComputer = "DC02";</font></strong><p><strong><font size="3">let myDriveLetter = "C:";</font></strong><p><strong><font size="3">let startDate = startofday(ago(60d)); // go back in time nn days</font></strong><p><strong><font size="3">let endDate = now(); // what is the date now</font></strong><p><strong><font size="3">let projectTo = now()+30d; // project forward nn days</font></strong><p><strong><font size="3">let projectForward = 30; // must be same as projectTo value </font></strong><p><strong><font size="3">Perf</font></strong><p><strong><font size="3">| where TimeGenerated between (startDate .. endDate )</font></strong><p><strong><font size="3">| where Computer startswith myComputer </font></strong><p><strong><font size="3">| where CounterName == "% Free Space" and InstanceName has myDriveLetter </font></strong><p><strong><font size="3">| make-series DiskFreeSpace = avg(CounterValue) default=0 on TimeGenerated in range(startDate, projectTo, 1h)</font></strong><p><strong><font size="3">| extend DiskFreeSpaceForecast = series_decompose_forecast(DiskFreeSpace, projectForward*24)</font></strong><p><strong><font size="3">| render timechart</font></strong> <p><br><p><font size="3">You can see, that the blue line is the past 60days (drops to zero for today) and the green line is the prediction from today onwards to 30days.&nbsp; You can edit the options for how many days to go back and how many to predict forward in the LET statements.</font>&nbsp;<p><a href="https://msdnshared.blob.core.windows.net/media/2019/02/series.jpg"><img width="855" height="569" title="series" alt="series" src="https://msdnshared.blob.core.windows.net/media/2019/02/series_thumb.jpg" border="0"></a>]]></content:encoded>
    </item>
    <item>
      <title>Azure Log Analytics: Service Level Agreement (SLA) part 2</title>
      <link>https://docs.microsoft.com/archive/blogs/ukhybridcloud/azure-log-analytics-service-level-agreement-part-2</link>
      <pubDate>Wed, 21 Nov 2018 16:08:41 GMT</pubDate>
      <dc:creator><![CDATA[CliveW]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ukhybridcloud/?p=4095</guid>
      <description><![CDATA[My post yesterday got a little long so, I’ve done a part2 to show how else you might group your...]]></description>
      <content:encoded><![CDATA[<p><br></p><p><font size="3">My post yesterday got a little long so, I’ve done a part2 to show how else you might group your solutions.</font></p><p><font size="3">Part1: <a title="https://blogs.msdn.microsoft.com/ukhybridcloud/2018/11/20/azure-log-analytics-service-level-agreement-sla-part-1/" href="https://blogs.msdn.microsoft.com/ukhybridcloud/2018/11/20/azure-log-analytics-service-level-agreement-sla-part-1/">https://blogs.msdn.microsoft.com/ukhybridcloud/2018/11/20/azure-log-analytics-service-level-agreement-sla-part-1/</a></font></p><p><font size="3"><br></font></p><p><font size="3">Here is the new query, I kept it simple so removed the JOIN and links to Perf and Memory that were shown in Part 1.</font></p><p><font size="3"><br></font></p><p><font size="3">let start_time =startofday(ago(7d));</font><p><font size="3">let end_time =startofday(now());</font><p><font size="3">// Lets define our groups of computers, using various search techniques</font><p><font size="3">let webServers = (Heartbeat </font><p><font size="3">| where Computer startswith "WEB"</font><p><font size="3">| distinct Computer</font><p><font size="3">| project Computer</font><p><font size="3">);</font><p><font size="3">let domainControllers = (Event</font><p><font size="3">| where EventLog == "Directory Service"</font><p><font size="3">| distinct Computer</font><p><font size="3">| project Computer</font><p><font size="3">); </font><p><font size="3">let aksServers = (Heartbeat </font><p><font size="3">| where Computer has "aks"</font><p><font size="3">| distinct Computer</font><p><font size="3">| project Computer</font><p><font size="3">); </font><p><font size="3">let subnetServers = (WireData</font><p><font size="3">| where LocalIP matches regex "10.118.51."</font><p><font size="3">| where Computer !startswith "D"</font><p><font size="3">| distinct Computer</font><p><font size="3">| project Computer</font><p><font size="3">);</font><p><font size="3">Heartbeat</font><p><font size="3">| where TimeGenerated &gt; start_time and TimeGenerated &lt; end_time </font><p><font size="3">// import generated computer list(s)</font><p><font size="3">| where Computer in (webServers, domainControllers, aksServers, subnetServers)</font><p><font size="3">// Main calculation </font><p><font size="3">| summarize heartbeat_per_hour=count() by bin_at(TimeGenerated, 1h, start_time), Computer</font><p><font size="3">| extend available_per_hour=iff(heartbeat_per_hour&gt;0, true, false)</font><p><font size="3">| summarize total_available_hours=countif(available_per_hour==true) by Computer</font><p><font size="3">| extend total_number_of_buckets=round((end_time-start_time)/1h)</font><p><font size="3">| extend availability_rate=total_available_hours*100/total_number_of_buckets</font><p><font size="3">// Create some readable groupnames </font><p><font size="3">| extend GroupName = </font><p><font size="3">case(</font><p><font size="3">Computer in (webServers), GroupName ="Web Servers",</font><p><font size="3">Computer in (domainControllers),GroupName ="Domain Controllers",</font><p><font size="3">Computer in (aksServers), GroupName ="AKS servers",</font><p><font size="3">Computer in (subnetServers), GroupName ="Subnet51",</font><p><font size="3">"Unknown"</font><p><font size="3">)</font><p><font size="3">// Show the results</font><p><font size="3">| summarize</font><p><font size="3">ServerCount=dcount(Computer),</font><p><font size="3">Availability=avg(availability_rate), </font><p><font size="3">AvailabilityFailedOn=countif(availability_rate &lt; 100)</font><p><font size="3">by GroupName</font><p><font size="3"><br></font></p><p><font size="3"><a href="https://msdnshared.blob.core.windows.net/media/2018/11/sla-p2.jpg"><img width="855" height="390" title="sla-p2" alt="sla-p2" src="https://msdnshared.blob.core.windows.net/media/2018/11/sla-p2_thumb.jpg" border="0"></a></font></p><p><font size="3"><br></font></p><p><font size="3">Essentially this query looks at 4 groups of servers:</font></p><p><font size="3">1. Web Servers</font></p><p><font size="3">2. AKS Servers (same as in part1)</font></p><p><font size="3">3. Domain Controllers</font></p><p><font size="3">4. A subnet</font></p><p><font size="3"><br></font></p><p><font size="3"><strong>Web Servers and AKS</strong>,&nbsp; I used the same technique as I did in part1.&nbsp; However there is a subtle use of the ‘has’ for the AKS servers to pick up the text “aks” anywhere in the computer name. </font></p><p><font size="3"><strong>Domain Controllers</strong>, with this group I used the <strong>Event</strong> table, and looked for the “Directory Service” log which should be on each DC.</font></p><p><font size="3"><strong>Subnet</strong>, this uses a regex to look for a specific subnet, I also excluded any Computers that had a name that started with “D”.</font></p><p><font size="3">These are few techniques you can use to group computers or services together.</font></p><p><font size="3"><br></font></p><p><font size="3">I also wanted a friendly name for each service, so used the <a href="https://docs.microsoft.com/en-us/azure/kusto/query/casefunction">Case</a> function for that:</font></p><p><font size="3"><br></font></p><p><font size="3">| extend GroupName = </font><p><font size="3">case(</font><p><font size="3">Computer in (webServers), GroupName ="Web Servers",</font><p><font size="3">Computer in (domainControllers),GroupName ="Domain Controllers",</font><p><font size="3">Computer in (aksServers), GroupName ="AKS servers",</font><p><font size="3">Computer in (subnetServers), GroupName ="Subnet51",</font><p><font size="3">"Unknown"</font><p><font size="3">)</font></p><p><font size="3"><br></font></p><p><font size="3"><br></font></p><p><br></p><p><br></p><p>&nbsp;</p><p><font size="3"><br></font></p>]]></content:encoded>
    </item>
    <item>
      <title>Azure Log Analytics: Service Level Agreement (SLA) part 1</title>
      <link>https://docs.microsoft.com/archive/blogs/ukhybridcloud/azure-log-analytics-service-level-agreement-sla-part-1</link>
      <pubDate>Tue, 20 Nov 2018 15:34:23 GMT</pubDate>
      <dc:creator><![CDATA[CliveW]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ukhybridcloud/?p=4055</guid>
      <description><![CDATA[This week there was a good discussion on how to show an SLA view in Log Analytics, which was similar...]]></description>
      <content:encoded><![CDATA[<p>This week there was a good discussion on how to show an SLA view in Log Analytics, which was similar to a feature in System Center Operations Manager, the output and query I’m sure will be useful for others. <p>Basically what was required was an SLA view of a service, where the service was made up of a few computers and multiple SLA thresholds were needed to be checked.<p>Credit to my colleague Christoph for a lot of the code used in this SLA example, his blog is here:<a href="https://blog.peterschen.de/">https://blog.peterschen.de/</a><p>The first part of the SLA solution was looking at the Heartbeat info<p>L<strong>et start_time=startofday(ago(30d));<br><strong>let end_time=startofday(now());</strong></strong><p><strong>Heartbeat</strong><p><strong>| where TimeGenerated &gt; start_time and TimeGenerated &lt; end_time</strong><p><strong>| summarize heartbeat_per_hour=count() by bin_at(TimeGenerated, 1h, start_time), Computer</strong><p><strong>| extend available_per_hour=iff(heartbeat_per_hour&gt;0, true, false)</strong><p><strong>| summarize total_available_hours=countif(available_per_hour==true) by Computer</strong><p><strong>| extend total_number_of_buckets=round((end_time-start_time)/1h)</strong><p><strong>| extend availability_rate=total_available_hours*100/total_number_of_buckets</strong><p><strong>| order by availability_rate desc</strong><p><a href="https://msdnshared.blob.core.windows.net/media/2018/11/avail-SLA.jpg"><img width="855" height="366" title="avail SLA" alt="avail SLA" src="https://msdnshared.blob.core.windows.net/media/2018/11/avail-SLA_thumb.jpg" border="0"></a><p>Basically this query looks back 30days, and checks the Heartbeat data for any missing info and calculates a % availability from it. for all Computers. <p><em>Please note using <strong>Heartbeat</strong> is only an SLA <u>indicator</u>, there is a potential for the server to still be up and working correctly but the Heartbeat not working, likewise Heartbeat can be sending data when the server workload might not be working correctly.</em><p><em><br></em><p><em></em><h5>Requirements</h5><p>In the case being discussed we had some other requirements to meet:<p>1. To show CPU data in the SLA<p>2. To show Memory data in the SLA<p>3. To alert on specific thresholds for CPU, Memory and availability<p>4. Only monitor a specific set of servers that made up a “service”<p>5. To also show an overall SLA health – good or bad<p>The final query ended up like this, I’ll break it down into sections afterwards:<p><strong>let start_time=startofday(ago(30d));</strong><p><strong>let end_time=startofday(now());</strong><p><strong>// Add my SLA values</strong><p><strong>let serviceName = "AKScluster";</strong><p><strong>let AVAILsla = 90;</strong><p><strong>let CPUsla = 50;</strong><p><strong>let MEMsla = 90;</strong><p><strong>// get server list from heartbeat</strong><p><strong>let hbav=Heartbeat</strong><p><strong>// find my 3 servers for my service, they happen to start with "AKS"</strong><p><strong>| where Computer startswith "aks"</strong><p><strong>| where TimeGenerated &gt; start_time and TimeGenerated &lt; end_time</strong><p><strong>| summarize heartbeat_per_hour=count() by bin_at(TimeGenerated, 1h, start_time), Computer</strong><p><strong>| extend available_per_hour=iff(heartbeat_per_hour&gt;0, true, false)</strong><p><strong>| summarize total_available_hours=countif(available_per_hour==true) by Computer</strong><p><strong>| extend total_number_of_buckets=round((end_time-start_time)/1h)</strong><p><strong>| extend availability_rate=total_available_hours*100/total_number_of_buckets</strong><p><strong>| order by availability_rate desc;</strong><p><strong>// CPU details</strong><p><strong>let cpuutil=Perf</strong><p><strong>| where TimeGenerated &gt; start_time and TimeGenerated &lt; end_time</strong><p><strong>| where ObjectName == "Processor"</strong><p><strong>| where CounterName == "% Processor Time"</strong><p><strong>| where InstanceName == "_Total"</strong><p><strong>| summarize CpuUtilization=avg(CounterValue) by Computer;</strong><p><strong>//MEMORY details</strong><p><strong>let memutil=Perf</strong><p><strong>| where TimeGenerated &gt; start_time and TimeGenerated &lt; end_time</strong><p><strong>| where ObjectName == "Memory"</strong><p><strong>| where CounterName == "% Used Memory"</strong><p><strong>| summarize MemUtilization=avg(CounterValue) by Computer;</strong><p><strong>hbav</strong><p><strong>| join kind= inner (cpuutil) on Computer</strong><p><strong>| join kind= inner (memutil) on Computer</strong><p><strong>// show the status of my service</strong><p><strong>| summarize</strong><p><strong>Name = serviceName,</strong><p><strong>avg(availability_rate),</strong><p><strong>availabilitySLA = iif(avg(availability_rate) &lt; AVAILsla, "Bad","Good"),</strong><p><strong>avg(CpuUtilization),</strong><p><strong>cpuSLA = iif(avg(CpuUtilization) &gt; CPUsla, "Bad","Good"),</strong><p><strong>avg(MemUtilization),</strong><p><strong>memSLA = iif(avg(MemUtilization) &gt; MEMsla, "Bad","Good"),</strong><p><strong>ComputerList = makeset(Computer),</strong><p><strong>dcount(Computer)</strong><p><em><br></em><h4>How did we achieve the SLA info</h4><p>At the top of the script I added some variables for the <strong>ServiceName</strong> and the defined <strong>SLA thresholds</strong>.<p>In this case we wanted alerts to show when:<ul><li>The overall SLA was <u>below</u> <strong>90%</strong>,<li>average CPU usage was <u>above</u> <strong>50%</strong><li>average Memory was <u>above</u> <strong>90%</strong>. </li></ul><p>I had 3 servers in an <strong>AKS</strong> cluster that I used, but you could amend the line to filter on your own service and list of computers.&nbsp; I used <strong>startswith</strong> “AKS”, please adapt for your own naming convention.<p><strong>// Add my SLA values</strong><p><strong>let serviceName = "AKScluster";</strong><p><strong>let AVAILsla = 90;</strong><p><strong>let CPUsla = 50;</strong><p><strong>let MEMsla = 90;</strong><p><strong>// get server list from heartbeat</strong><p><strong>let hbav=Heartbeat</strong><p><strong>// find my 3 servers for my service, they happen to start with "AKS"</strong><p><strong>| where Computer startswith "aks"</strong><p>We then added two sections to get the CPU and Memory info from the <strong>Perf</strong> Log Analytics table and Join those to the<strong>Heartbeat</strong> table. <br>Here are the lines for CPU, you can see it uses the same timespan set earlier and can easily be changed for any other relevant Perf counter.&nbsp; The Memory info was a copy of this with a few changed values.<p><strong>// CPU details</strong><p><strong>let cpuutil=Perf</strong><p><strong>| where TimeGenerated &gt; start_time and TimeGenerated &lt; end_time</strong><p><strong>| where ObjectName == "Processor"</strong><p><strong>| where CounterName == "% Processor Time"</strong><p><strong>| where InstanceName == "_Total"</strong><p><strong>| summarize CpuUtilization=avg(CounterValue) by Computer;</strong><p>The <a href="https://docs.microsoft.com/en-us/azure/kusto/query/joinoperator">JOIN</a> operator was used to link the data with the Heartbeat – again an amended line was repeated for memory join.<p><strong>| join kind= inner (cpuutil) on Computer</strong><p>All we needed then, was to display the data.&nbsp; You can do this in many ways but I chose the <a href="https://docs.microsoft.com/en-us/azure/kusto/query/summarizeoperator">Summarize</a> operator and some <a href="https://docs.microsoft.com/en-us/azure/kusto/query/iiffunction">IIF</a> functions.<p><strong>| summarize</strong><p><strong>Name = serviceName,</strong><p><strong>avg(availability_rate),</strong><p><strong>availabilitySLA = iif(avg(availability_rate) &lt; AVAILsla, "Bad","Good"),</strong><p><strong>avg(CpuUtilization),</strong><p><strong>cpuSLA = iif(avg(CpuUtilization) &gt; CPUsla, "Bad","Good"),</strong><p><strong>avg(MemUtilization),</strong><p><strong>memSLA = iif(avg(MemUtilization) &gt; MEMsla, "Bad","Good"),</strong><p><strong>ComputerList = makeset(Computer),</strong><p><strong>dcount(Computer)</strong><p>In this example I used words to denote when an SLA wasn’t reached i.e. <strong>Good</strong> or <strong>Bad</strong>.&nbsp; If you plan on raising an Alert from this you could change these to a <strong>0</strong> or <strong>1</strong> to enable an alert to trigger on a threshold change.<p>So in the above example I got the value of the SLA and used IIF to display the words “Bad” or “Good” depending on the value compared to the variables we defined at the beginning on the script with the LET operators.<p><a href="https://msdnshared.blob.core.windows.net/media/2018/11/txt-SLA.jpg"><img width="855" height="146" title="txt SLA" alt="txt SLA" src="https://msdnshared.blob.core.windows.net/media/2018/11/txt-SLA_thumb.jpg" border="0"></a><p><em>Note: there is also a count of the computers and a list of the computer names , but I haven't shown that in the above screen clip, to keep it readable on the page</em><p><em></em><p>For the final requirement of an overall SLA health<p><strong>| extend SLAobjectiveMet = iif( availabilitySLA == "Good" and cpuSLA == "Good" and memSLA == "Good" , "SLA ok","SLA Not Ok")</strong><p><strong>| project serviceName, SLAobjectiveMet</strong><p>I used an another IIF to link all three results, so if all 3 individual SLAs were ‘good’ - then the overall SLA was ‘<strong>SLA</strong> <strong>ok</strong>’. <br>Again you could use a 0 and 1 for generating Azure Alerts.<p><a href="https://msdnshared.blob.core.windows.net/media/2018/11/SLA-ok.jpg"><img width="801" height="343" title="SLA ok" alt="SLA ok" src="https://msdnshared.blob.core.windows.net/media/2018/11/SLA-ok_thumb.jpg" border="0"></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Azure Log Analytics: A little more on Parse and Print</title>
      <link>https://docs.microsoft.com/archive/blogs/ukhybridcloud/azure-log-analytics-a-little-more-on-parse-and-print</link>
      <pubDate>Tue, 20 Nov 2018 12:32:00 GMT</pubDate>
      <dc:creator><![CDATA[CliveW]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ukhybridcloud/?p=3815</guid>
      <description><![CDATA[**** this post was restored, as the original was deleted by mistake ****In my last post I wrote...]]></description>
      <content:encoded><![CDATA[<p><br></p><p>**** this post was restored, as the original was deleted by mistake ****<p><br><p>In my last post I wrote about <strong>Print</strong> and <strong>Let</strong> - which reminded me of some work I did to manipulate some text recently (it also used a <strong>Print</strong> operator, which was the thing that reminded me).<p>The raw data was this (it was from an event log but I don't recall which one):<p><em>"Device=\\.\\PHYSICALDRIVE; FirmwareRevision=AAA3; Interface=IDE; MediaType=\\HDD\\; Model=123456; SerialNumber=987654321"</em><p><em><br></em><p><em><br></em><p>So using <strong>Print</strong> I was able to manipulate the text, each part was needed in a column and some of the data was also needed to be formatted to removed unwanted text or characters.&nbsp; Ultimately this isn't a finished query rather an example of a few techniques that you may find useful to manipulate text.<p>Step1 – I used <strong>Print</strong> as per the last post, then on the next line create an array using the ";" as a character to <a href="https://docs.loganalytics.io/docs/Language-Reference/Scalar-functions/split()">split</a> the line at:<p><strong>print txt = "Device=\\.\\PHYSICALDRIVE; FirmwareRevision=AAA3; Interface=IDE; MediaType=\\HDD\\; Model=123456; SerialNumber=987654321"</strong><p><strong><strong>| extend txtArray = split(txt, ";")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong></strong><p><strong><strong></strong></strong><p><strong><strong><br></strong></strong><p><strong><strong></strong></strong></p><strong><strong><p><a href="https://msdnshared.blob.core.windows.net/media/2018/09/image28.png"><img width="855" height="356" title="image" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/09/image_thumb22.png" border="0"></a><p>As you can see by the above output we now have 6 rows of data returned in the array.</strong></strong><p><p><strong><strong></strong></strong><p>I wanted the data in a column so I used an <strong>Extend</strong>, which does that, adding these next two lines as an example<p><strong>| extend DeviceID = txtArray [0]</strong><p><strong>, Firmware = txtArray [1]</strong><p><a href="https://msdnshared.blob.core.windows.net/media/2018/09/image29.png"><img width="855" height="174" title="image" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/09/image_thumb23.png" border="0"></a><p>Again this gets us the information, but now we need to tidy it up a little.<p>I first added an extra line<p><strong>Interface = split(txtArray [2], "=",1)</strong><p>This line <a href="https://docs.loganalytics.io/docs/Language-Reference/Scalar-functions/split()">splits</a> the 2nd item [2] in the array, at the “=” character and then keeps only the txt <em>after</em> that character; change the 1 to 0 if you want the opposite.&nbsp; You can see below, the column is now named <strong>Interface</strong> and the result is “<strong>IDE</strong>”.<p><a href="https://msdnshared.blob.core.windows.net/media/2018/09/image30.png"><img width="780" height="127" title="image" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/09/image_thumb24.png" border="0"></a><p>The next line of syntax I added is the most complex<p><strong>MediaType = trim(@"[^\w]+", tostring(split(txtArray [3],"=",1)))</strong><p>We are doing a few things to the data here.<p>1. Using <a href="https://docs.loganalytics.io/docs/Language-Reference/Scalar-functions/trim()">Trim</a> and some regex to remove any non word characters from the beginning or end of the array item.&nbsp; See Trim for help on that.<p>2. Then I used Split again to get just the text after the “=”, and this time I added <a href="https://docs.loganalytics.io/docs/Language-Reference/Scalar-functions/tostring()">tostring</a> as well.&nbsp; So txtArray[3] went from <a href="https://hdd/">\\HDD\\</a> to HDD in the <strong>MediaType</strong> column:<p><a href="https://msdnshared.blob.core.windows.net/media/2018/09/image31.png"><img width="855" height="125" title="image" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/09/image_thumb25.png" border="0"></a><p>So the full script now looks like:<p><strong>print txt = "Device=\\.\\PHYSICALDRIVE; FirmwareRevision=AAA3; Interface=IDE; MediaType=\\HDD\\; Model=123456; SerialNumber=987654321"</strong><p><strong>| extend txtArray = split(txt, ";") // split on ";" char</strong><p><strong>| extend DeviceID = txtArray [0]</strong><p><strong>, Firmware = txtArray [1]</strong><p><strong>, Interface = split(txtArray [2], "=",1) // like the line above but use split to show just the result</strong><p><strong>, MediaType = trim(@"[^\w]+", tostring(split(txtArray [3],"=",1))) // again, split on "=" and then trim all non word chars</strong><p><strong>, Model = txtArray [4]</strong><p><strong>// etc...</strong><p><strong>| project DeviceID , Firmware , Interface , MediaType, Model</strong><p><a href="https://msdnshared.blob.core.windows.net/media/2018/09/image32.png"><img width="855" height="131" title="image" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/09/image_thumb26.png" border="0"></a><p>So in the above example Column 1 and 4 are essentially unformatted, but columns 2 and 3 have two different formats applied to make them more readable.</p><strong><p><font size="3"><br></font></p><p><font size="3"><br></font></p><p><font size="3"><br></font></p><p><font size="3"><br></font></p></strong><p><font size="3"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>Azure Log Analytics: A little more about Usage</title>
      <link>https://docs.microsoft.com/archive/blogs/ukhybridcloud/azure-log-analytics-a-little-more-about-usage</link>
      <pubDate>Tue, 30 Oct 2018 10:37:44 GMT</pubDate>
      <dc:creator><![CDATA[CliveW]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ukhybridcloud/?p=3985</guid>
      <description><![CDATA[&nbsp;

In post and post we’ve spoken about Usage but its a topic that comes up a lot.

I have a...]]></description>
      <content:encoded><![CDATA[&nbsp;

In <a href="https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fblogs.msdn.microsoft.com%2Fukhybridcloud%2F2018%2F04%2F03%2Flog-analytics-usage-and-estimated-costs%2F&amp;data=02%7C01%7C%7Cfd0fdd8b3f1f4edebfbc08d638fde481%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636759060441259540&amp;sdata=lKTP15kLPqzBpUTalQkl2VsLx9cZbvYAZi1gTXbJB2M%3D&amp;reserved=0">post</a> and <a href="https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fblogs.msdn.microsoft.com%2Fukhybridcloud%2F2018%2F04%2F11%2Flog-analytics-usage-and-estimated-costs-update%2F&amp;data=02%7C01%7C%7Cfd0fdd8b3f1f4edebfbc08d638fde481%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636759060441269548&amp;sdata=rY6Ou%2FvkEEs2c0lVcPcYBA1AQKCyNbvnjCPFFzI8XJg%3D&amp;reserved=0">post</a> we’ve spoken about Usage but its a topic that comes up a lot.

I have a two step process, to identify the culprits if high usage is experienced.  I’ll also talk about planning later…and especially the recommendation to Alert on Usage!
<h3>Log Analytics shows Usage in two main places</h3>
<h4><strong>1.</strong> Azure Monitor</h4>
For a overview with meter selection.  You can also swap to the <a href="https://go.microsoft.com/fwlink/?linkid=867120">newer pricing</a> and get an estimate for that.

Open the <b>Azure Portal</b> – select <b>Azure Monitor</b> – select <b>Usage &amp; Estimated Costs </b>for<b> </b>their subscriptions.  This will break down the costs to each meter:

<a href="https://msdnshared.blob.core.windows.net/media/2018/10/clip_image0021.gif"><img title="clip_image002" style="margin: 0px" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/2018/10/clip_image002_thumb.gif" class="" width="690" height="472" border="0" /></a>
<h4><strong>2.</strong>  Log Analytics</h4>
Open the <b>Azure Portal</b> – select <b>Azure Log Analytics</b> – – select <b>Usage &amp; Estimated Costs </b>(a different one to the one above).

This first page is useful.

<a href="https://msdnshared.blob.core.windows.net/media/2018/10/clip_image0041.gif"><img title="clip_image004" style="margin: 0px" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/2018/10/clip_image004_thumb1.gif" class="" width="700" height="410" border="0" /></a>
<ol>
 	<li>On the left we can see the break down between Ingestion (data sent to Azure) and retention (if above the 31days default).</li>
 	<li>The top right chart shows the daily ingestion, useful to spot if we have a dramatic rise on a specific day.</li>
 	<li>The last report breaks the costs down by solution, what are the highest ones?</li>
 	<li>Then in the top left corner – you can get more details, press “<b>Usage Details</b>” – from the next screen I immediately toggle to <b>30days</b> to show a month.
<ol>
 	<li>We’d then look at the Data volume over time and Data by Solution details.</li>
 	<li>The Volume over time is good to spot a few servers that are sending lots of data – like my vCenter one (16GB) in the below example. The entry “-“ is also of interest as that is PaaS or SaaS data.</li>
</ol>
</li>
</ol>
<a href="https://msdnshared.blob.core.windows.net/media/2018/10/clip_image005.gif"><img title="clip_image005" style="border: 0px currentcolor" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/2018/10/clip_image005_thumb.gif" class="" width="627" height="614" border="0" /></a>

Main docs page for Usage: <a href="https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Flog-analytics%2Flog-analytics-usage&amp;data=02%7C01%7C%7Cfd0fdd8b3f1f4edebfbc08d638fde481%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636759060441279557&amp;sdata=y%2BbqCE9VDR7GIWwkpknvVJ7IC5Ya7MGfFeCuunK%2Bjg4%3D&amp;reserved=0">https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-usage</a>
<h4>Planning</h4>
In this <a href="https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fblogs.msdn.microsoft.com%2Fukhybridcloud%2F2018%2F04%2F11%2Flog-analytics-usage-and-estimated-costs-update%2F&amp;data=02%7C01%7C%7Cfd0fdd8b3f1f4edebfbc08d638fde481%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636759060441279557&amp;sdata=FIBwRBV2GhhzTQxxH0MCvesBsNRaOYmlVG63DqsRd70%3D&amp;reserved=0">post</a> the retention cap was mentioned.  This is a great feature for a workspace that you are using to test things in.  However if you place a cap on your production workspace you may miss some important data.  You need to decide on criticality vs cost.  If you have a legacy free workspace that is a good playground, if not create a new workspace and remember to cap it at 5GB.  However in both cases <u>you should ALERT before you reach a threshold</u>.  This is one mistake that I see most often.  Without a consumption alert its hard to tell when you are approaching your thresholds, it also could mean a bill you were not expecting!

Articles to help you are: <a href="https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fblogs.technet.microsoft.com%2Fmsoms%2F2016%2F11%2F21%2Fget-notified-if-oms-log-analytics-usage-is-higher-than-expected%2F&amp;data=02%7C01%7C%7Cfd0fdd8b3f1f4edebfbc08d638fde481%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636759060441289565&amp;sdata=sTNQiEoAsb6OY9DTln%2BnuUn2Lrc4Qhbx0N9QfC2J%2FrI%3D&amp;reserved=0">https://blogs.technet.microsoft.com/msoms/2016/11/21/get-notified-if-oms-log-analytics-usage-is-higher-than-expected/</a>

and

<a href="https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Flog-analytics%2Flog-analytics-usage%23create-an-alert-when-data-collection-is-higher-than-expected&amp;data=02%7C01%7C%7Cfd0fdd8b3f1f4edebfbc08d638fde481%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636759060441299573&amp;sdata=9rV7J2bTtez1gAPAYZ52289TupeUzgiMLvFDm8yfAN0%3D&amp;reserved=0">https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-usage#create-an-alert-when-data-collection-is-higher-than-expected</a>]]></content:encoded>
    </item>
    <item>
      <title>Azure Log Analytics: Do you need some demo data?</title>
      <link>https://docs.microsoft.com/archive/blogs/ukhybridcloud/azure-log-analytics-do-you-need-some-demo-data</link>
      <pubDate>Wed, 12 Sep 2018 15:31:20 GMT</pubDate>
      <dc:creator><![CDATA[CliveW]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ukhybridcloud/?p=3805</guid>
      <description><![CDATA[This article (as a test) was also published to my LinkedIn feed

&nbsp;

Sometimes you need some...]]></description>
      <content:encoded><![CDATA[This article (as a test) was also published to <a href="https://uk.linkedin.com/in/clive-watson-3008734">my LinkedIn</a> feed

&nbsp;

Sometimes you need some demo data to work with, here are two methods:
<h2>Use the <a target="_blank" href="https://docs.loganalytics.io/docs/Language-Reference/Tabular-operators/print-operator" rel="noopener">Print </a>operator to create some</h2>
In its basic use, you can use Print to display some text e.g.

<strong>print "this is a test" </strong> - which looks like:
<div class="slate-resizable-image-embed slate-image-embed__resize-full-width">

<img class="slate-image-embed__resize-full-width" src="https://media.licdn.com/dms/image/C4E12AQFq7CcXrSizJQ/article-inline_image-shrink_1000_1488/0?e=1542240000&amp;v=beta&amp;t=Tlm9cGT_K9kILFkpa93WKl8jwr5wGzU-YsU1_4ir0P0" /><button class="slate-image-embed__link-button"> </button>

</div>
You can also use it with a column name e.g. "<strong>t</strong>" in this example

<strong>print t = "this is another test"</strong>

This helps as we can then look or use the data, in this simple example we can look into "t" and see if the word "another" is found, if it is TRUE is returned (we use <em>extend </em>to write the result into a column called 'found').
<div class="slate-resizable-image-embed slate-image-embed__resize-full-width">

<img class="slate-image-embed__resize-full-width" src="https://media.licdn.com/dms/image/C4E12AQEg8Ds5naaNsA/article-inline_image-shrink_1500_2232/0?e=1542240000&amp;v=beta&amp;t=vSLnIPy23FdJS5fJSropgwRWUJMHjuIbmhdKhhE_ZFs" /><button class="slate-image-embed__link-button"> </button>

</div>
<h2>Use the <a target="_blank" href="https://docs.loganalytics.io/docs/Language-Reference/Query-statements/Let-statement" rel="noopener">Let </a>statement with <a target="_blank" href="https://docs.loganalytics.io/docs/Language-Reference/Tabular-operators/datatable-operator" rel="noopener">datatable </a></h2>
This works in a way more similar to how you would write a Query in Log analytics. i.e. A simple <strong>Event </strong>query like:
<pre class="ql-syntax"><span class="hljs-type">Event</span>
| <span class="hljs-keyword">where</span> <span class="hljs-type">EventID</span> &gt; <span class="hljs-number">7600</span>
| <span class="hljs-built_in">count</span>
</pre>
a example would be:
<div class="slate-resizable-image-embed slate-image-embed__resize-full-width">

&nbsp;

</div>
<pre class="ql-syntax"><span class="hljs-keyword">let</span> dummyData = datatable(dummyTxt:<span class="hljs-keyword">string</span>)
[
    <span class="hljs-string">"This is yet another test"</span>
];
dummyData
| <span class="hljs-keyword">where</span> dummyTxt has <span class="hljs-string">"yet"</span> 
</pre>
What is nice with <em>datatable </em>is that you can imitate a line of example log file (or whatever), that you might want to work on without actually having a copy of it.
<pre class="ql-syntax"><span class="hljs-keyword">let</span> dummyData = datatable(Date:datetime, dummyTxt:<span class="hljs-keyword">string</span>)
[
    datetime(now) , <span class="hljs-string">"This is yet another test"</span> ,
    datetime(now) , <span class="hljs-string">"This is yet another test string"</span> 
];
dummyData
| <span class="hljs-keyword">where</span> dummyTxt == <span class="hljs-string">"This is yet another test string"</span> 

</pre>
<div class="slate-resizable-image-embed slate-image-embed__resize-full-width">

<img class="slate-image-embed__resize-full-width" src="https://media.licdn.com/dms/image/C4E12AQFc1XNU2uFp1Q/article-inline_image-shrink_400_744/0?e=1542240000&amp;v=beta&amp;t=nJ3CQKlW-Xx0FmgDFMe2WXLoxorfhZ5_yHA6L58uTBs" /><button class="slate-image-embed__link-button"> </button>

</div>]]></content:encoded>
    </item>
    <item>
      <title>A decision tree for Azure Networking</title>
      <link>https://docs.microsoft.com/archive/blogs/ukhybridcloud/a-decision-tree-for-azure-networking</link>
      <pubDate>Wed, 12 Sep 2018 11:37:48 GMT</pubDate>
      <dc:creator><![CDATA[David-Sanchez]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ukhybridcloud/?p=3785</guid>
      <description><![CDATA[Whether you are planning to use Express Route or VPN tunnels to connect your data centers to Azure,...]]></description>
      <content:encoded><![CDATA[Whether you are planning to use Express Route or VPN tunnels to connect your data centers to Azure, and you want to use a co-location provider in your region to reach Azure or extend your MPLS network to Microsoft. Are you also thinking what is the optimal route to connect your regions?

These are the 4 questions to start with:
<ol>
 	<li>Do you need dedicated, reliable connectivity and bandwidth?</li>
 	<li>Do you need more than 1.25Gbps of bandwidth?</li>
 	<li>Do you need to inspect outbound internet traffic using on-prem devices or cloud native?</li>
 	<li>Do you have shared services in central location or deploy a centralized security policy to control traffic flows from VNETs?</li>
</ol>
Use the following diagram to get some guidance and find answers to these questoins (start from the center or the orange boxes)

<a href="https://msdnshared.blob.core.windows.net/media/2018/09/Decision-tree-final-v1.png"><img width="1479" height="1007" class="alignnone size-full wp-image-3795" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/Decision-tree-final-v1.png" /></a>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Building an Azure Event Grid app. Part 5: CI and pushing to DockerHub with VSTS</title>
      <link>https://docs.microsoft.com/archive/blogs/ukhybridcloud/building-an-azure-event-grid-app-part-5-ci-and-pushing-to-dockerhub-with-vsts</link>
      <pubDate>Sat, 11 Aug 2018 12:17:57 GMT</pubDate>
      <dc:creator><![CDATA[gdavi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ukhybridcloud/?p=3775</guid>
      <description><![CDATA[In this part of the series I’d like to make sure that whenever I change the code for my Event Grid...]]></description>
      <content:encoded><![CDATA[In this part of the series I’d like to make sure that whenever I change the code for my Event Grid publishing app a new Docker image is built and then pushed to my container repository automatically.

My flow is therefore:
<ul>
 	<li>Edit code in Visual Studio Code</li>
 	<li>Commit and push the changes to GitHub</li>
 	<li>Trigger Continuous Integration (CI) build</li>
 	<li>Deploy resultant new container image to DockerHub</li>
</ul>
I’m going to use Visual Studio Team Services (VSTS) to do this, as I like it, it's easy and powerful and it will make any future Azure deployment even easier.
<h2>Create a new VSTS team project</h2>
I want a new VSTS team project within which I can add work items (user stories, bugs) and track work through various boards (Kanban, Task boards). Create the new project, selecting the most appropriate process template (I chose Scrum).

When the new project is created, by default it includes a new git repo. In this example it’s not needed as we’ll continue to keep the code in GitHub, but we’ll trigger a build in VSTS whenever a commit is pushed to the master branch in GitHub.
<h2>Create a new build pipeline</h2>
Add a new build pipeline and the first option is to set where the code repo is located. In this case it’s GitHub so select that:

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps1.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps1-1024x684.png" alt="" width="1024" height="684" class="alignnone size-large wp-image-3675" /></a>

Set up the connection by authenticating to GitHub, I chose to use OAuth:

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps2.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps2-1024x651.png" alt="" width="1024" height="651" class="alignnone size-large wp-image-3685" /></a>

Then continue to choose the most appropriate template. I selected the Docker container template:

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps3.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps3-1024x935.png" alt="" width="1024" height="935" class="alignnone size-large wp-image-3695" /></a>

In the resultant build pipeline definition in the <em>Build an Image</em> task, change the <em>Container Registry Type</em> to <em>Container Registry</em> (i.e. not Azure Container Registry, a good choice but for this I wanted a completely public repository):

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps31.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps31-1024x558.png" alt="" width="1024" height="558" class="alignnone size-large wp-image-3745" /></a>

Then create a <em>New Docker registry service connection</em>. Change the Repository to <em>DockerHub</em> and enter your credentials:

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps4.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps4-1024x837.png" alt="" width="1024" height="837" class="alignnone size-large wp-image-3705" /></a>

&nbsp;

I also wanted to set the image name to match the image I already had in DockerHub, and therefore changed the default image name from $(Build.Repository.Name):$(Build.BuildId):

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps5.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps5-1024x276.png" alt="" width="1024" height="276" class="alignnone size-large wp-image-3715" /></a>To a variable I created called image.name which I set to gdavi/alarms-iot-simulator:

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps6.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps6-1024x267.png" alt="" width="1024" height="267" class="alignnone size-large wp-image-3725" /></a>

I also checked the <em>Include latest tag</em> option so that the new version is always the latest.

For the <em>Push an Image</em> task, make sure the command is set to <em>Push</em> and update the image name:

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps61.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps61-1024x564.png" alt="" width="1024" height="564" class="alignnone size-large wp-image-3755" /></a>

Finally set the Trigger to Enable Continuous Integration:

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps62.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps62-1024x446.png" alt="" width="1024" height="446" class="alignnone size-large wp-image-3765" /></a>

Now you can test by either making a code change and committing and pushing, or save and queue the build:

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps7.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/08/GDAlarmsDevOps7-1024x451.png" alt="" width="1024" height="451" class="alignnone size-large wp-image-3735" /></a>

For now I don’t need to actually deploy the image beyond the container registry but if I wanted to I could add a Release pipeline to deploy to a container orchestrator such as Service Fabric or Azure Kubernetes Service.

Cheers,
Giles

<a href="https://blogs.msdn.microsoft.com/ukhybridcloud/2018/08/10/building-an-azure-event-grid-app-part1-event-grid-topic-and-a-net-core-custom-app-event-publisher/">Building an Azure Event Grid app. Part 1: Event Grid Topic and a .NET Core custom app event publisher</a>.

<a href="https://blogs.msdn.microsoft.com/ukhybridcloud/2018/08/10/building-an-azure-event-grid-app-part-2-adding-a-logic-app-subscriber-to-the-event-grid-topic/">Building an Azure Event Grid app. Part 2: Adding a Logic App subscriber to the Event Grid Topic</a>.

<a href="https://blogs.msdn.microsoft.com/ukhybridcloud/2018/08/10/building-an-azure-event-grid-app-part-3-turning-the-publisher-app-into-a-docker-image/">Building an Azure Event Grid app. Part 3: Turning the publisher app into a Docker image</a>.

<a href="https://blogs.msdn.microsoft.com/ukhybridcloud/2018/08/10/building-an-azure-event-grid-app-part-4-adding-a-service-principal-to-the-event-grid-topic/">Building an Azure Event Grid app. Part 4: Adding a Service Principal to the Event Grid Topic</a>.

<a href="https://blogs.msdn.microsoft.com/ukhybridcloud/2018/08/11/building-an-azure-event-grid-app-part-5-ci-and-pushing-to-dockerhub-with-vsts/">Building an Azure Event Grid app. Part 5: CI and pushing to DockerHub with VSTS</a>.]]></content:encoded>
    </item>
  </channel>
</rss>