<?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 IT's Cloud Management Services Playbook</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/msitcloudmsplaybook/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/msitcloudmsplaybook/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:11:48 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Monitoring Runbooks / Azure Automation + Log Analytics</title>
      <link>https://docs.microsoft.com/archive/blogs/msitcloudmsplaybook/monitoring-runbooks-azure-automation-log-analytics</link>
      <pubDate>Fri, 05 Aug 2016 09:45:13 GMT</pubDate>
      <dc:creator><![CDATA[Matthew Raffaele]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/msitcloudmsplaybook/?p=175</guid>
      <description><![CDATA[A while ago, I wrote a couple of posts showing how we are collecting and storing Azure Automation...]]></description>
      <content:encoded><![CDATA[A while ago, I wrote a<a href="https://blogs.technet.microsoft.com/msitcloudmsplaybook/2016/06/06/running-a-busy-azure-automation-infrastructure-part-1/"> couple of posts </a>showing how we are collecting and storing Azure Automation runbook job history for monitoring and support using a custom runbook and Azure SQL database.

Since then I have learned that Log Analytics for Azure Automation is in available in preview.  After setting it up and taking it for a quick spin around the block I've found it to be a fantastic resource for proactive monitoring of the workflows we have running in Azure Automation.

We have been using <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-alerts/">OMS alerting </a>for a couple of weeks now to alert us when certain workflows have failed with great success.  Operations teams are notified when there are problems and fix them before customers have to escalate.

In addition to alerting, Log Analytics also allows an alternative for getting counts and amounts of job history - it's really pretty neat.

Below are details on setup - it is pretty simple,  the tricky part is learning to <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-search-reference/">create the queries</a> you will need to use for monitoring and alert rules.

Below is an example of a view on the OMS portal which shows counts of failures for a couple of important runbooks we have made available to customers to enable self-service jobs we call: Snooze (shutdown and deallocate an Azure VM or bring it back online) and Resize (Change the SKU of an Azure VM.):

[caption id="attachment_185" align="alignnone" width="612"]<a href="https://msdnshared.blob.core.windows.net/media/2016/08/fails-by-runbook.jpg"><img width="612" height="542" class="size-full wp-image-185" alt="Failures by runbook" src="https://msdnshared.blob.core.windows.net/media/2016/08/fails-by-runbook.jpg" /></a> Failures by runbook[/caption]

<strong>Setting up Log Analytics</strong>

Setup is pretty straight forward, below is an example of how we got everything up and running:

# Connect to Azure
<em>Login-AzureRmAccount</em>

# Configure storage account for logs and set up diagnostics on your Automation Account
#   assumes ARM storage account in the same regions as the automation account

<em>$AA = Find-AzureRmResource -ResourceNameContains "MyAutomationAccount" -ResourceType Microsoft.Automation/AutomationAccounts</em>
<em>$SA = Find-AzureRmResource -ResourceNameContains "MyStorageAccount" </em>
<em>Set-AzureRmDiagnosticSetting -ResourceId $AA.ResourceId -StorageAccountId $SA.ResourceId</em>

# Enable logs in Log Analytics following these instructions
#   <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-powershell-azure-diagnostics-json">https://azure.microsoft.com/en-us/documentation/articles/log-analytics-powershell-azure-diagnostics-json</a>

# storage account that logs will be written to...

<em>$storageAccountId = "/subscriptions/1aba1abc-1234-5678-acb1-234567def1234/resourceGroups/automation_analytics/providers/Microsoft.Storage/storageAccounts/MyStorageAccount"</em>
<em>$supportedResourceTypes = ("Microsoft.Automation/AutomationAccounts")</em>

# location to match your storage account location
<em>$resources = (Get-AzureRmResource).Where({$_.ResourceType -in $supportedResourceTypes -and $_.Location -eq "eastus2"})</em>

<em>foreach ($resource in $resources) {</em>
<em>    Set-AzureRmDiagnosticSetting -ResourceId $resource.ResourceId -StorageAccountId $storageAccountId -Enabled $true -RetentionEnabled $true -RetentionInDays 1</em>
<em>}</em>

# Import the log analytics module
<em>Install-Module -Name AzureDiagnosticsAndLogAnalytics</em>

# Run the UI configuration script
#   -guides you through configuring Log Analytics to collect logs from Azure diagnostics storage

<em>Add-AzureDiagnosticsToLogAnalyticsUI</em>

# Open your OMS workspace and search Log Analytics for Type=AutomationAccounts
#   https://mysuite.portal.mms.microsoft.com/]]></content:encoded>
    </item>
    <item>
      <title>SQL Server Database migration to Azure SQL DB – using SSMS. Comparison of SSMS, SSDT, SAMW, SQL Server 2016 Upgrade Advisor.</title>
      <link>https://docs.microsoft.com/archive/blogs/msitcloudmsplaybook/sql-server-database-migration-to-azure-sql-db-using-ssms-comparison-of-ssms-ssdt-samw-sql-server-2016-upgrade-advisor</link>
      <pubDate>Tue, 02 Aug 2016 23:46:42 GMT</pubDate>
      <dc:creator><![CDATA[joe.mazzotta]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/msitcloudmsplaybook/?p=165</guid>
      <description><![CDATA[If you are planning to migrate an on-prem SQL Server to Azure, there are a few key...]]></description>
      <content:encoded><![CDATA[If you are planning to migrate an on-prem SQL Server to Azure, there are a few key considerations:
<ul>
 	<li>Understand the <a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-general-limitations/">Azure SQL Database General Limitations and Guidelines</a></li>
 	<li>Review the <a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-transact-sql-information/">Azure SQL Database Transact-SQL differences</a></li>
 	<li>Review the <a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-resource-limits/">Azure SQL Database resource limits</a></li>
</ul>
&nbsp;

Migration will involve both migration of the schema and data from your source SQL DB to Azure SQL DB (PaaS). There may be some re-engineering required if your workload is not compatible with Azure SQL DB. See guidelines and limitations above.

&nbsp;

Below are details on use of SQL Server Management Studio 2016 Migration Wizard. <strong>This approach is best used for SQL DB migration where the DB is less than 1TB in size and where there is persistent (good) connectivity between your source and Azure SQL DB. </strong>Alternate approaches such as BCP, SQL Server replication, manually migrating SQL DB or any other means will be covered in future posts.

&nbsp;

Pre-reqs:
<ul>
 	<li>SSMS 2016</li>
 	<li>If needed, ensure SQL Server DB has SQL auth enabled (including create SQL login to enable migration of DBs)</li>
 	<li>Open inbound/outbound ports 1433 to SQL Server DB</li>
</ul>
&nbsp;

Migration Steps:
<ol>
 	<li>In my example, I’ll migrate my Azure IaaS VM SQL Server Database to Azure SQL Database. The same steps apply if you migrate an on-prem SQL Server DB to Azure SQL DB.</li>
 	<li>I’ll need to prepare my IaaS VM SQL Server for migration</li>
 	<li>Ensure inbound and outbound network firewall rules enable port 1433. You need to enable this so that SSMS can access and process migration.</li>
</ol>
<img class="alignnone  wp-image-2046" src="https://msitwiki/wp-content/uploads/2016/08/sql1-300x78.jpg" alt="sql1" width="631" height="164" />

3a. Go to Azure Portal and select the IaaS VM running SQL Server you wish to migrate * (only required if you are migrating an IaaS VM running SQL Server DB; if its an on-prem VM, log in to the Windows Server and open firewall rules enabling inbound/outbound ports 1433)

3b. From settings, click on Network Interfaces

3c. Next click on Network Security Groups

3d. Select the security group that applied to the IaaS VM with SQL Server to be migrated

<img class="alignnone  wp-image-2047" src="https://msitwiki/wp-content/uploads/2016/08/sql2-300x88.jpg" alt="sql2" width="597" height="175" />

3e. Set both the Inbound and Outbound security rules to enable port 1433

<img class="alignnone  wp-image-2048" src="https://msitwiki/wp-content/uploads/2016/08/sql3-300x98.jpg" alt="sql3" width="612" height="200" />

&nbsp;

4. Next we’ll log in to SQL Server to begin migration process through SSMS 2016:

<img class="alignnone  wp-image-2049" src="https://msitwiki/wp-content/uploads/2016/08/sql4-300x143.jpg" alt="sql4" width="451" height="215" />

5. To begin the migration process, Select the DB you wish to migrate to Azure SQL DB by right clicking then selecting Tasks -&gt; Deploy Database to Microsoft Azure SQL Database. Note you can also migrate an on-prem SQL Server to an IaaS VM SQL Server however consider benefits of Azure SQL vs managing your own VM.

<img class="alignnone  wp-image-2052" src="https://msitwiki/wp-content/uploads/2016/08/sql6-300x259.jpg" alt="sql6" width="436" height="376" />

6. This will open the Deploy Database wizard. The first step of the migration wizard will be to connect to your Azure subscription (Azure SQL DB) destination where you’re migrating your on-prem SQL DB to

6a. SSMS deployment database wizard will then validate and perform both the schema and data migration from your source and migrate your database to Azure SQL SB.

<img class="alignnone size-medium wp-image-2054" src="https://msitwiki/wp-content/uploads/2016/08/sql8-300x284.jpg" alt="sql8" width="300" height="284" />

<img class="alignnone size-medium wp-image-2056" src="https://msitwiki/wp-content/uploads/2016/08/sql9-300x280.jpg" alt="sql9" width="300" height="280" />
<ol start="7">
 	<li>You are notified once the operation is complete.</li>
</ol>
<img class="alignnone size-medium wp-image-2057" src="https://msitwiki/wp-content/uploads/2016/08/sql10-300x284.jpg" alt="sql10" width="300" height="284" />

Here we have completed the migration of an SQL Server 2008 R2 database from an VM to Azure SQL DB.

SQL Server Management Studio is a very easy tool to perform simple migrations of SQL Server DB to Azure SQL DB if you do not require schema changes and your source DB is compatible with Azure SQL DB.

In summary some tools allow edit of schema to correct any incompatibilities, tools vary between developer audience vs SA audience, and finally some tools provide compatibility analysis vs some tools just to BCP/migration of schema and/or data.

<img class="alignnone size-full wp-image-2060" src="https://msitwiki/wp-content/uploads/2016/08/SQL-migration-tools-comparison.png" alt="SQL migration tools comparison" width="1337" height="510" />

cheers

Joe]]></content:encoded>
    </item>
    <item>
      <title>WinRM | It's kind of a like / hate thing...</title>
      <link>https://docs.microsoft.com/archive/blogs/msitcloudmsplaybook/winrm-its-kind-of-a-like-hate-thing</link>
      <pubDate>Thu, 16 Jun 2016 15:46:59 GMT</pubDate>
      <dc:creator><![CDATA[Matthew Raffaele]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/msitcloudmsplaybook/?p=125</guid>
      <description><![CDATA[Sure, I like WinRM.

It enables remote management of Windows over HTTP and it is at the core of...]]></description>
      <content:encoded><![CDATA[Sure, I like WinRM.

It enables remote management of Windows over HTTP and it is at the core of how we perform configuration and change automation here in MSIT.  When configured properly it makes execution of tasks on remote machines insanely simple and without it I don't think we'd be able to perform half of the activities we have automated in SMA and Azure Automation Workflow runbooks.

The problem is that it has to be enabled and properly configured - out of the box you aren't going to find it very useful unless you've already configured via custom images, group policy or the like.  This is where the side of the equation opposite to like comes into play.

Even if you are enabling WinRM at build time, at data center scale you are bound to come across machines that are not going to play nice and will break your automation and bring dishonor to your family.  So lets look at what to configure and how we can test for and remediate problem at runtime.

<strong>Enable WinRM and configure it to allow remote access:</strong>
1.) I'm sure we all know this already: On the remote machine, execute the following from an elevated cmd prompt:   '<em>winrm quickconfig /force'.  </em>This will enable the service and create an http listener endpoint for you.

^ <em>But what if you cannot run the command on the machine w/o if WinRM isn't enabled?</em>  No need to hate - there's a simple trick we use in our automation that includes psexec and a new scheduled task that I'll write up in a separate post real soon.

<strong>Need to access network resources from within your WinRM session? </strong>
Lets say that in your SMA or Azure Automation runbooks you need to install or execute software from the network within a remote session or PowerShell Workflow InlineScript.
You'll need to enable CredSSP on your runbook workers so that the remote machine can act as a credential delegate and pass specified creds along to anything on the network you need to authenticate against.

To allow the use of CredSSP perform the following on the client (the machine you are remoting from:)
1.) Execute the following from an elevated PS cmd prompt:  <em>'Enable-WSManCredSSP -DelegateComputer localhost -Role client -Force'</em>
2.) Use gpedit.msc and look at the following policy: Computer Configuration -&gt; Administrative Templates -&gt; System -&gt; Credentials Delegation -&gt; Allow Delegating Fresh Credentials. Verify that it is enabled and configured with a 'wsman/*' SPN.

&nbsp;

[caption id="attachment_135" align="alignnone" width="672"]<a href="https://msdnshared.blob.core.windows.net/media/2016/06/delegatecreds.jpg"><img class="size-full wp-image-135" src="https://msdnshared.blob.core.windows.net/media/2016/06/delegatecreds.jpg" alt="Delegate Fresh Creds" width="672" height="620" /></a> Delegate Fresh Creds[/caption]

&nbsp;

Cool, now you'll be able to authenticate against and access resources on the network over a 'third hop' from the machine you are remoting into.

To force the use of CredSSP in your connections, simply use the authentication and credential parameters with your InlineScript block or new PoSh session:

&nbsp;

[caption id="attachment_145" align="alignnone" width="654"]<a href="https://msdnshared.blob.core.windows.net/media/2016/06/delegatecreds2.jpg"><img class="size-full wp-image-145" src="https://msdnshared.blob.core.windows.net/media/2016/06/delegatecreds2.jpg" alt="Demo InlineScript with CredSSP" width="654" height="305" /></a> Demo InlineScript with CredSSP[/caption]

or....

[caption id="attachment_155" align="alignnone" width="884"]<a href="https://msdnshared.blob.core.windows.net/media/2016/06/delegatecreds3.jpg"><img class="size-full wp-image-155" src="https://msdnshared.blob.core.windows.net/media/2016/06/delegatecreds3.jpg" alt="PS Session with CredSSP" width="884" height="330" /></a> PS Session with CredSSP[/caption]]]></content:encoded>
    </item>
    <item>
      <title>Monitoring a Busy Azure Automation Infrastructure (Part 2)</title>
      <link>https://docs.microsoft.com/archive/blogs/msitcloudmsplaybook/running-a-busy-azure-automation-infrastructure-part-2</link>
      <pubDate>Mon, 06 Jun 2016 21:34:38 GMT</pubDate>
      <dc:creator><![CDATA[Matthew Raffaele]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/msitcloudmsplaybook/?p=66</guid>
      <description><![CDATA[Keeping Operations and our customers happy with telemetry

OK, so as we established in part one of...]]></description>
      <content:encoded><![CDATA[<b><span style="color: #000000;font-family: Calibri">Keeping Operations and our customers happy with telemetry</span></b>

<span style="color: #000000;font-family: Calibri">OK, so as we established in <a href="https://blogs.technet.microsoft.com/msitcloudmsplaybook/2016/06/06/running-a-busy-azure-automation-infrastructure-part-1/">part one of this subject</a> we’ve got a ton of Azure Automation (AA) runbook job history stored in Azure, and we need to begin collecting it and storing somewhere that is quick and easy to access and can serve as a feed for an AA jobs dashboard.  Here in part two, I'll provide an overview of how I went about getting this done.</span>

<span style="color: #000000;font-family: Calibri">The first order of business for me was to provision a Azure SQL DB instance.  This was a bit of a no-brainer decision.  It is super simple to setup and aside from managing logins, there is little to no maintenance overhead to bother us in the future.   If you aren’t familiar with the process of setting up Azure SQL, there is a ton of helpful information available online including a video hosted </span><a href="https://azure.microsoft.com/en-us/documentation/services/sql-database/"><span style="color: #0563c1;font-family: Calibri">here</span></a><span style="color: #000000;font-family: Calibri"> to guide you through the process to ‘</span><a href="https://azure.microsoft.com/en-us/documentation/videos/azure-sql-database-create-dbs-in-seconds/"><span style="color: #0563c1;font-family: Calibri">create DBs in seconds</span></a><span style="color: #000000;font-family: Calibri"><a href="https://azure.microsoft.com/en-us/documentation/videos/azure-sql-database-create-dbs-in-seconds/">.</a>’  One detail I will mention here is that once your DB is provisioned, you can access the connection string from the portal which will be needed in just a bit.</span>

[caption id="attachment_45" align="alignnone" width="1158"]<a href="https://msdnshared.blob.core.windows.net/media/2016/06/31.jpg"><img class="size-full wp-image-45" src="https://msdnshared.blob.core.windows.net/media/2016/06/31.jpg" alt="Connection String" width="1158" height="350" /></a> Connection String[/caption]

<span style="font-family: Calibri"><span style="color: #000000">OK, great!  So now we’ve got an Azure SQL DB stood up named </span><b>runbookjobs</b><span style="color: #000000">.  We’ll connect to it through the SQL Server Management Studio using the login specified when we provisioned it and create a single table called </span><b>jobs</b> <span style="color: #000000">with columns for each of the data points we want to store about runbook job history for future reference.  I’m a huge fan of simplicity so (for now at least) this simple schema will suffice.</span></span>

[caption id="attachment_55" align="alignnone" width="373"]<a href="https://msdnshared.blob.core.windows.net/media/2016/06/4.jpg"><img class="size-full wp-image-55" src="https://msdnshared.blob.core.windows.net/media/2016/06/4.jpg" alt="Jobs Table" width="373" height="388" /></a> Jobs Table[/caption]

<span style="font-family: Calibri"><span style="color: #000000">Right on, now we’ve got a home for our job history data.  Next we’ve got to get it populated.  What better way to do that then to create a PowerShell runbook in AA to do the work?  What I did was to create a runbook with the hugely imaginative name of </span><b>Get-RunbookJobHistory</b> <span style="color: #000000">and started writing the script to pull runbook job history stored in Azure and stuff it into our shiny, new </span><b>runbookjobs</b><span style="color: #000000"> DB.</span></span>

<span style="color: #000000;font-family: Calibri">Getting a the runbook job history is not too difficult, especially if you’ve previously done it in SMA to monitor child runbook status from a parent runbook or other process.  The concept is pretty much the same, except that only a summary of the job output is available in the output stream of you are not referencing them directly with a JobId.  To get the complete job output, you need find your job using the <a href="https://msdn.microsoft.com/en-us/library/mt619440.aspx"><strong>Get-AzureRmAutomationJob</strong></a> and then reference the job by JobId with the <a href="https://msdn.microsoft.com/en-us/library/mt603476.aspx"><b>Get-AzureRmAutomationJobOutput</b></a> cmdlet.</span>

<span style="color: #000000;font-family: Calibri">So, let’s go ahead and get the Jobs we care about along with the properties of each we can get now for storing in SQL.  After logging into Azure using a credential asset stored in AA we can iterate through our list of jobs.  Here, I’m going to collect all of the jobs that have been created since the last time my history collection ran:</span>

[caption id="attachment_75" align="alignnone" width="743"]<a href="https://msdnshared.blob.core.windows.net/media/2016/06/111.jpg"><img class="size-full wp-image-75" src="https://msdnshared.blob.core.windows.net/media/2016/06/111.jpg" alt="Get Jobs" width="743" height="537" /></a> Get Jobs[/caption]

<span style="color: #000000;font-family: Calibri">You can see above that we are simply walking the list of jobs run in the Azure Automation Account we are interested in and then for each, if it is newer than the last one we collected during the last cycle, we use the JobId we found for it to reference it again directly so we will have access to the full job output stream. For each job then, getting 10 of the 11 values we want for each job is readily available and we pluck them right out and stuff them into a custom object.</span>

<span style="color: #000000;font-family: Calibri"> </span><span style="color: #000000;font-family: Calibri">For the all important output stream, there is one more step we need to take.  We'll stuff the following snippet into the foreach loop to get the output details:</span>

[caption id="attachment_85" align="alignnone" width="709"]<a href="https://msdnshared.blob.core.windows.net/media/2016/06/12.jpg"><img class="size-full wp-image-85" src="https://msdnshared.blob.core.windows.net/media/2016/06/12.jpg" alt="Get Job Output" width="709" height="176" /></a> Get Job Output[/caption]

<span style="color: #000000;font-family: Calibri"> </span><span style="color: #000000;font-family: Calibri">Here we have to make a 3<sup><span style="font-size: small">rd</span></sup> call to Azure using the previously mentioned <a href="https://Get-AzureRmAutomationJobOutput"><b>Get-AzureRmAutomationJobOutput</b></a> cmdlet to get the complete job output. Then, we pipe that to the <b><a href="https://msdn.microsoft.com/en-us/library/mt643911.aspx">Get-AzureRmAutomationJobOutputRecord</a></b> cmdlet which finally gets us access to the full output stream.  You may also notice above that as I’m grabbing the output, I am replacing single quotes with double quotes so that when we insert the data into SQL, we don’t goof up our query string.  </span>

<span style="color: #000000;font-family: Calibri"> </span><span style="color: #000000;font-family: Calibri">Having to make so many calls out to Azure slows down the how fast we can walk through all of our jobs, but hey, that’s one of the points of using AA in the first place - let it handle those tedious, long running tasks for you silently in the background while you are getting real work done, right?  I have this runbook running on a 4 hour schedule with a Webhook enabled to kick it off with a couple of lines of PoSh anytime the Operations team needs closer to real time data.</span>

<span style="color: #000000;font-family: Calibri">So this is pretty much it – all we need to do now is store the data in SQL and we are off to the races!  </span>

<span style="color: #000000;font-family: Calibri">Below is the entire contents of the PowerShell runbook as it exists today, it isn’t terribly complex, but I hope it helps someone out.</span>

<em><span style="color: #000000;font-family: Calibri">FWIW, I desperately want to be able to place code here that you could copy and paste, but it is near impossible with the WordPress tools available for me here.  If you want the actual PS1 file, hit me up  at mattraff@msn.com and I'll get it to you.</span></em>

&nbsp;

[caption id="attachment_95" align="alignnone" width="998"]<a href="https://msdnshared.blob.core.windows.net/media/2016/06/40.jpg"><img class="size-full wp-image-95" src="https://msdnshared.blob.core.windows.net/media/2016/06/40.jpg" alt="Full Runbook" width="998" height="1902" /></a> Full Runbook[/caption]

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Monitoring a Busy Azure Automation Infrastructure (Part 1)</title>
      <link>https://docs.microsoft.com/archive/blogs/msitcloudmsplaybook/running-a-busy-azure-automation-infrastructure-part-1</link>
      <pubDate>Mon, 06 Jun 2016 11:55:43 GMT</pubDate>
      <dc:creator><![CDATA[Matthew Raffaele]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/msitcloudmsplaybook/?p=15</guid>
      <description><![CDATA[*Update - Here is a better, supported way to monitor Automation... Since this blog was written,...]]></description>
      <content:encoded><![CDATA[<span style="color: #000000;font-family: Calibri"><em>*Update - <a href="https://blogs.technet.microsoft.com/msitcloudmsplaybook/2016/08/05/monitoring-runbooks-azure-automation-log-analytics/">Here is a better, supported</a> way to monitor Automation...</em> <em>Since this blog was written, Microsoft has released Log Analytics for Azure Automation.</em></span>

<b><span style="color: #000000;font-family: Calibri">Keeping Operations and our customers happy with telemetry</span></b>

<span style="color: #000000;font-family: Calibri">After finally making forward progress in the push to migrate our automation workflows from SMA to Azure Automation (AA) we’ve got several thousand jobs running every week in AA including our heavy hitter, an MSIT tool called Snooze.</span>

<span style="color: #000000;font-family: Calibri">Although there are a lot of big advantages of AA over SMA such as the ability to run native PowerShell, integration with DSC and the new availability of Webhooks, there are two problems that existed in SMA and are still around in AA:   1.) Detailed runbook telemetry and 2.) Ops support for monitoring and troubleshooting busy systems.  First, telemetry – we got a bit of an upgrade with SMA, we now have the ability to filter through job history by state such as Success, Failed, Suspended, etc.  The second bonus is that the high level dashboard view of job history comes in a pie chart which looks much prettier than that ugly old line graph we had in SMA.  </span>

<span style="color: #000000;font-family: Calibri">The problem though, is that getting any meaningful data such as counts and amounts per runbook or the ability to search job history by runbook input parameters or their actual output is still missing.   Using real data from our production environment as an example I see that there are 98 failed jobs of the 5,433 total.  </span>

<a href="https://msdnshared.blob.core.windows.net/media/2016/06/11.jpg"><img width="595" height="417" class="alignnone size-full wp-image-25" alt="1" src="https://msdnshared.blob.core.windows.net/media/2016/06/11.jpg" /></a>

<span style="color: #000000;font-family: Calibri">Not perfect, but that’s still less than a 2% failure rate.  However, these 98 failures may have come from a particular workflow which was only run 100 times - then we’d have a 98% failure rate of a particular automation operation – not so great :/</span>

<span style="color: #000000;font-family: Calibri">I can easily filter my job history in the portal to focus on the failures.  When I do that, I see that the failures were almost all from the Snooze runbook and they happened prior to our production switchover from SMA to AA – these failures occurred in test, whew!</span>

<a href="https://msdnshared.blob.core.windows.net/media/2016/06/21.jpg"><img width="632" height="735" class="alignnone size-full wp-image-35" alt="2" src="https://msdnshared.blob.core.windows.net/media/2016/06/21.jpg" /></a>

<span style="color: #000000;font-family: Calibri">That is nice to know, but we aren’t completely out of the woods yet…</span>

<span style="color: #000000;font-family: Calibri">You see, these runbooks are called from a service sitting behind a web front-end and we do our best to make sure that they always return a result back to that front-end (FE) to let our customers know what the status of their request is. In order to make the best attempt to get these details to the FE, we need to ensure that any errors encountered are caught and handled properly before they can result in a state that puts the runbook in a Failed or Suspended state.  We want to make sure that we never let the runbook die even if we hit an error that ultimately results in the failure of the end user’s request.  The actual customer request results are formatted as json object and piped through the runbook job output where they can be retrieved by the FE. </span>

<span style="color: #000000;font-family: Calibri">This behavior hides the actual success/fail rates from AA so we cannot get a dashboard view of the customer’s experience.  </span><u><span style="color: #000000;font-family: Calibri">If we ran the service like this for any length of time, we’d only have customer escalations (or hopefully a lack there of) to gauge the health of our automation system</span></u><span style="color: #000000;font-family: Calibri">.  This certainly isn’t the way to drive customer satisfaction in a positive direction.</span>

<span style="color: #000000;font-family: Calibri">We also need to keep Operations happy and efficient for when the (hopefully trickle) of escalations come in, they are able to quickly identify the problems so they can be resolved.  AA provides no mechanism to search historical job data for input parameters and job output.  Let’s say that one of the 5,400 jobs submitted was for a server named </span><a href="//guacamole/"><span style="color: #0563c1;font-family: Calibri">\\guacamole</span></a><span style="color: #000000;font-family: Calibri"> on Monday evening and it failed.  If Operations just started working on the issue today four days later on a Friday, they would have to manually flip through the hundreds of jobs that ran Monday evening looking through the job input and output properties of each until they found the one that referenced </span><a href="//guacamole/"><span style="color: #0563c1;font-family: Calibri">\\guacamole</span></a><span style="color: #000000;font-family: Calibri">.  In the Azure Portal, this is a mind-blowingly tedious process and chore that could take 30 minutes or more – just to find one failure.  It’s the needle in a haystack of suck!</span>

<span style="color: #000000;font-family: Calibri"> </span><span style="color: #000000;font-family: Calibri">We simply could not run and manage a service this way, so we created a simple way to collect and store runbook job history in Microsoft SQL Azure.  From this store of job history, engineers and Operations have quick access to details which would otherwise been hidden away and all but inaccessible – these are details which let us see the communication between our FE applications and AA such as runbook input parameters and output streams.  We also collect start and stop dates and times, end runbook status, the credentials of who started each job and more.   Now we are getting somewhere – we have a single location of data upon which we can enable Operations to work efficiently and upon which can build a great dashboard for truly accurate monitoring.</span>

<span style="color: #000000;font-family: Calibri">Next, I’ll go into details about how the solution to build the AA runbook job history data store was created in PowerShell and runs in AA itself with a Webbook also available to trigger a collection cycle to get up-to the minute information as needed.  </span><span style="color: #000000;font-family: Calibri">See Part 2 here:  <a href="https://blogs.technet.microsoft.com/msitcloudmsplaybook/2016/06/06/running-a-busy-azure-automation-infrastructure-part-2/">Monitoring a Busy Azure Automation Infrastructure (Part 2)</a></span>]]></content:encoded>
    </item>
    <item>
      <title>Already using Azure and curious which services are enabled in Resource Manager mode</title>
      <link>https://docs.microsoft.com/archive/blogs/msitcloudmsplaybook/already-using-azure-and-curious-which-services-are-enabled-in-resource-manager-mode</link>
      <pubDate>Tue, 26 Apr 2016 09:34:13 GMT</pubDate>
      <dc:creator><![CDATA[joe.mazzotta]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/msitcloudmsplaybook/?p=5</guid>
      <description><![CDATA[I work with many IT teams and often get get questions from external customers at EBC on what is ARM,...]]></description>
      <content:encoded><![CDATA[<p>I work with many IT teams and often get get questions from external customers at EBC on what is ARM, why leverage ARM, and whether all existing Azure services are ARM enabled?</p>
<p>Azure has provided<span class="Apple-converted-space"> </span><a href="https://azure.microsoft.com/en-us/documentation/articles/resource-manager-supported-services/">documentation</a> ARM:</p>
<p>​Azure Resource Manager mode provide many advantages to enterprise IT including:</p>
<p>1. ability to tag resources which aid in classification for undiscoverable data (eg billing individual resources to team, type of environment, type of IT services dependent upon Azure resource, etc).</p>
<p>2. ability to set granual role access through RBAC - roles based access controls</p>
<p>3. ability to group resources for lifecycle management</p>
<p>4. decoupling network model which allows separation of compute from networking - this enables enterprise IT to gain better scale of networking in Azure to IaaS VMs</p>
<p>During Q4 FY16, MSIT is driving requests for new internal subscriptions towards ARM and enabling ARM templates to achieve benefits described above.</p>
<p>While Azure continues to actively enable all existing Azure services on ARM, below is a list of Azure services/resources which currently are not enabled for ARM or enabled in a limited way:</p>

<ol>
	<li>Virtual Machines (classic)</li>
	<li>Remote Apps</li>
	<li>Cloud Service (classic)</li>
	<li>StorSimple</li>
	<li>Machine Learning</li>
	<li>Data Catalog</li>
	<li>Media Services</li>
	<li>Backup</li>
	<li>Site Recovery</li>
</ol>
<div>In the near-term, continue to monitor the Azure <a href="https://azure.microsoft.com/en-us/documentation/articles/resource-manager-supported-services/">documentation</a> on ARM for updates.</div>
<div></div>
<div>For teams who are interested in proceeding and determining ability to co-exist with classic Azure resources and ARM enabled services and resources, we recommend you contact MSIT ARM Champions &lt;msitarmchamps@microsoft.com&gt; who can help define architectures in Azure which may enable your specific ARM scenario(s).</div>
<div></div>
<div>cheers</div>
<div>Joe​</div>
&nbsp;]]></content:encoded>
    </item>
  </channel>
</rss>