<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Jeff Gilbert’s TechNet blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/jeffgilb/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/jeffgilb/feed.xml</link>
    <description>EMS, Azure AD, Intune, Configuration Manager, and more!</description>
    <lastBuildDate>Wed, 27 Jun 2018 18:27:00 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>New to Azure AD or have getting started questions?</title>
      <link>https://docs.microsoft.com/archive/blogs/jeffgilb/new-to-azure-ad-or-have-getting-started-questions</link>
      <pubDate>Thu, 06 Jul 2017 12:41:47 GMT</pubDate>
      <dc:creator><![CDATA[Jeff Gilbert [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jeffgilb/?p=1375</guid>
      <description><![CDATA[Hi everyone, it's been a while since I've posted anything so I figured I'd do some catching up with...]]></description>
      <content:encoded><![CDATA[Hi everyone, it's been a while since I've posted anything so I figured I'd do some catching up with you today. I've been busy getting settled in with my recent move from enterprise client management (Intune and SCCM) to the Azure AD team. After being focused on client management for so long (since 1999!), the move to Azure AD was a good one for me and I'm having a blast learning the ins-and-outs of Azure AD. Of course, in the beginning, I had a few questions and, while the documentation is great overall, I did find myself looking for something to help me connect the dots a little better. So, I wrote it.

I'm betting that, as someone new to Azure AD, you probably have a lot of the same questions that I did so I'm sharing these articles in the hopes they help you gain a better understanding of Azure AD and help you make the best Azure identity and access solution decision for your organizations. I call these my "<em>getting started trilogy</em>" of Azure AD articles, but if you let me know something is missing, I'm not averse to adding a 4th, or 5th, or 6th, or more! article. Check them out, let me know if they help, you have questions, or you see gaps. Just comment right on the docs.microsoft.com article page and I'll get back to you.

Here's how it breaks down:
<ol>
 	<li><a href="https://docs.microsoft.com/en-us/azure/active-directory/identity-fundamentals">About Azure identity management</a>. This is a super high-level fundamentals article meant to help decision makers and architects understand what Azure AD is and what’s it’s good for.</li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/active-directory/understand-azure-identity-solutions">Understand Azure identity solutions</a>. This next step is a drill-down into more technical terminology and concepts that implementers need to understand along with the different ways Azure AD does identity to help you make the right choice.</li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/active-directory/choose-hybrid-identity-solution">Choose a hybrid identity solution</a>. Because I know a lot of you are going to choose hybrid identity, I figured this last article should focus on that path and guide you through the different hybrid identity options and when to use them.</li>
</ol>
Taken together, these three articles are meant to help orient you to what Azure AD does and how to make the best Azure AD identity solution decision based on Microsoft recommendations. Hopefully these articles connect the dots for you with best practice recommendations backed up by links into the technical documentation for more information about specific actions.

I hope these help, let me know!

~Jeff

<hr />

You’ve seen my blog; want to follow me on Twitter too? <a href="http://twitter.com/jeffgilb">@JeffGilb</a>.]]></content:encoded>
    </item>
    <item>
      <title>Your first DevTest Labs artifact – PowerShell scripts</title>
      <link>https://docs.microsoft.com/archive/blogs/jeffgilb/your-first-devtest-labs-artifact-powershell-scripts</link>
      <pubDate>Thu, 13 Apr 2017 15:21:00 GMT</pubDate>
      <dc:creator><![CDATA[Jeff Gilbert [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jeffgilb/?p=1255</guid>
      <description><![CDATA[In my last post, I talked about how to create a custom Azure DevTest Labs artifact JSON file, but I...]]></description>
      <content:encoded><![CDATA[In <a href="https://blogs.technet.microsoft.com/jeffgilb/2017/04/07/your-first-devtest-labs-artifact-json-file/">my last post</a>, I talked about how to create a custom Azure DevTest Labs artifact JSON file, but I also said you’ll probably need some kind of script to go along with it. In this post, I’ll show you some tricks and tips I’ve discovered (and been shown) to help make creating your own, custom artifacts a breeze. If you missed my last post, you might want to go catch up. If you have no idea what I’m talking about here, you might want to go back to <a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/10/getting-to-know-azure-devtest-labs/">the very beginning</a>.

To quickly recap, the JSON file is necessary for a multitude of reasons including it’s how DevTest Labs knows anything about your artifact, but also because it’s what triggers the script to be run and provides any necessary pipeline inputs needed to make your script “go” if you need to prompt for information.

Let’s get started. I’m going to use a super basic PowerShell command example because the point of this post is not to each you PowerShell, but to show you how to quickly, and easily, create a PowerShell script-based artifact. In fact, here’s the PowerShell command we’re going to run:
<pre>start-sleep</pre>
That’s right. We’re just going to pause the action. Bear with me, we’ll do some other cool things too.

So, that’s it. Create a PowerShell script file named sleep.ps1, tell the corresponding JSON file’s runCommand section to run the sleep.ps1 script with no parameters, upload and sync your artifact folder from your GitHub repo to DevTest Labs, and you’re done. Seriously, that’s it. Unless it isn’t.
<p style="padding-left: 60px"><strong>Bonus tip:</strong> if you do all that and your custom artifact never shows up in DevTest Labs, it’s most likely your JSON file’s fault and not your shiny new script’s. Go check your syntax and try sync’ing again.</p>
Assuming your custom artifact has safely arrived in DevTest Labs, it’s time to go apply it to a running VM and see what happens:

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/sleep.png"><img width="750" height="246" class="aligncenter size-full wp-image-1365" alt="sleep" src="https://msdnshared.blob.core.windows.net/media/2017/04/sleep.png" /></a>

Hopefully everything runs smoothly and the artifact returns success:

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/no-err.png"><img width="750" height="258" class="aligncenter size-full wp-image-1345" alt="no-err" src="https://msdnshared.blob.core.windows.net/media/2017/04/no-err.png" /></a>

Now, sadly, anyone who knows me knows that I’m no PowerShell guru, but I do know enough to be dangerous to my VMs. What this means is that sometimes I learn by simply pushing buttons to see what happens…and then generally spend a lot of time perusing log files and deciphering error messages. Unfortunately, if you don’t build in some error checking in your scripts, you’ll never have anything to troubleshoot. In the end, you also usually spend more time trying to figure out what went wrong than it takes to fix the issue. This can be frustrating when you’ve told a computer to do something ill-advised and it dutifully complies. Case in point, the artifact history below shows that it ran successfully by dutifully running the script, but there’s something amiss (the big red arrow is a hint):

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/err-no-catch.png"><img width="750" height="365" class="aligncenter size-full wp-image-1335" alt="err-no-catch" src="https://msdnshared.blob.core.windows.net/media/2017/04/err-no-catch.png" /></a>

Oops. Typo. It’s supposed to be start-sleep, not start-sleeps. The artifact ran the script successfully so its status shows succeeded, but that doesn’t help us much because it successfully executed a flawed script. Maybe we should do something to stop that from happening and point out our scripting deficiencies more clearly at the same time.

Like I said, I’m no PowerShell guru so adding error logging to scripts is not something I do every day. Luckily, it’s easy to figure out how to do: just go look at some of the artifacts already existing in the Azure DevTest Labs artifact repos and see what they did. You’ll probably notice that a lot of those artifacts contain pretty much the same kind of error catching wrapper for script commands. This is something I didn’t notice at first, but a very kind, <em>very exasperated</em> Azure DevTest Labs developer, who was probably tired of responding to my troubleshooting questions, pointed it out to me. So, I’ll now I'll pay it forward and show you the easy way to add error logging to your script.

Unless you’re a PowerShell guru who’d rather code error catching yourself, I’d suggest starting off by copying the code below as the first step in writing a PowerShell script that wants to grow up to be part of an Azure DevTest Labs artifact:
<p style="padding-left: 60px"><strong>Note:</strong> When you tell a VM to pause (sleep), it’s helpful to tell it how long you’d like that pause to be. So, I’ve added a prompted parameter value in my JSON file to ask the user how long they’d like to pause the computer in seconds ($Seconds). When you have prompted values like that, you need to let the script know the value is coming and I do that in a top section (param) that you’ll see in the example. If you don’t have prompted values, then you don’t need that param section, just delete it.</p>

<pre>param(
     [Parameter(Mandatory = $true,valueFromPipeline=$true)]
            [String] $Seconds
)
###################################################################################################
# PowerShell configurations
# NOTE: Because the $ErrorActionPreference is "Stop", this script will stop on first failure.
#      This is necessary to ensure we capture errors inside the try-catch-finally block.
$ErrorActionPreference = "Stop"

# Ensure we set the working directory to that of the script.
pushd $PSScriptRoot
###################################################################################################
# Functions used in this script.
function Handle-LastError
{
   [CmdletBinding()]
   param(
   )

   $message = $error[0].Exception.Message
   if ($message)
   {
       Write-Host -Object "ERROR: $message" -ForegroundColor Red
   }

   # IMPORTANT NOTE: Throwing a terminating error (using $ErrorActionPreference = "Stop") still
   # returns exit code zero from the PowerShell script when using -File. The workaround is to
   # NOT use -File when calling this script and leverage the try-catch-finally block and return
   # a non-zero exit code from the catch block.

   exit -1
}
###################################################################################################
# Handle all errors in this script.
trap
{
   # NOTE: This trap will handle all errors. There should be no need to use a catch below in this
   #       script, unless you want to ignore a specific error.
   Handle-LastError
}
###################################################################################################
# Main execution block.

try
{
     Start-Sleep -s "$Seconds"
}
finally
{
   popd
}</pre>
I am not going to go through each section of this example or discuss try/catch/finally blocks here because it’s all fairly self-explanatory. However, one thing you might want to look into is the <a href="https://msdn.microsoft.com/en-us/library/system.management.automation.actionpreference(v=vs.85).aspx">$ErrorActionPreference value</a>. When an error is encountered, and that value is set to stop, the script…stops—even if it normally would have continued if you ran it manually. If you set that preference to something like <em>continue</em> instead of <em>stop</em>, you’ll get a different experience. I do that sometimes when I have a nagging error that isn’t very impactful to my script execution and I don’t have the time or inclination to fix it properly (plus, I get lazy sometimes). Moving on.

You’ll spend most of your time with this code in the <em>try</em> block. All the action goes down between those <strong>{}</strong>’s in the try block (unless you’ve broken something). In this super simple example, the start-sleep PowerShell command is being told to run and execute for $Seconds long. So, if someone entered 5 for the $Seconds value when prompted by the artifact JSON file (DevTest Labs artifact UI), it would pause the VM for five seconds when executed. Easy enough, right?

Now, with error catching, let’s see what happens when the artifact is applied to a VM:

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/pause-catch-err.png"><img width="750" height="286" class="aligncenter size-full wp-image-1355" alt="pause-catch-err" src="https://msdnshared.blob.core.windows.net/media/2017/04/pause-catch-err.png" /></a>

That’s better, sort of. The artifact now knows it has failed (because the script’s -1 returned error code tells it so) and we can also clearly see the syntax error that made things go wonky.

It’s nice to know when and why things go wrong, but wouldn’t it still be nice to know when things go right too? Sometimes just having a record of what an artifact does (some can get complicated) is pretty handy. Maybe it’s just because I’m an old SMS/SCCM guy, but isn’t everything better with a bunch of logging? I think so. So, after many minutes spent pondering the mysteries of PowerShell scripting and trying to come up with an overly-complicated logging option…I finally decided to just use <em>write-host</em>. See, the cool thing about running artifacts is that the logging basically just shows you what you’d see if you ran the script interactively. So, write-host does the job with no muss and no fuss. That’s me. Master of the simple.

What might be interesting about watching a VM pause itself in this example you might ask. A harder question to answer than you might think since I’ve picked such a simple PowerShell command, but I finally decided that I’d have the artifact record the start and stop times for when it was paused. Again, super simple example, but hopefully you get the idea behind finagling some custom logging out of your artifact. My try block now looks like this:
<pre>try
{
     $currentTime = Get-Date
     Write-Host "Started pause at $currentTime."
     Start-Sleep -s "$Seconds"
     $currentTime = Get-Date
     Write-Host "Pause completed at $currentTime."
}</pre>
And the resulting artifact history, after I fixed the typo and added the write-host lines, looks like this:

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/success-log.png"><img width="750" height="243" class="aligncenter size-full wp-image-1366" alt="success-log" src="https://msdnshared.blob.core.windows.net/media/2017/04/success-log.png" /></a>

Whether you noticed this or not, if you’re new to PowerShell you now have a few interesting tidbits of know-how that can be applied with or without Azure DevTest Labs artifacts running your script for you. You can prompt for pipeline input, you can catch errors, and you can write out some basic logging information. Not a bad day’s work, but making DevTest Labs do all the work, including running the script, is much more satisfying. Go see for yourself.

&nbsp;

<hr />

You’ve seen my blog; want to follow me on Twitter too? <a href="http://twitter.com/jeffgilb">@JeffGilb</a>.]]></content:encoded>
    </item>
    <item>
      <title>Your first DevTest Labs artifact – JSON file</title>
      <link>https://docs.microsoft.com/archive/blogs/jeffgilb/your-first-devtest-labs-artifact-json-file</link>
      <pubDate>Fri, 07 Apr 2017 12:19:02 GMT</pubDate>
      <dc:creator><![CDATA[Jeff Gilbert [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jeffgilb/?p=1205</guid>
      <description><![CDATA[At this point in my Azure DevTest Labs blog post series, I’ve covered just about everything you need...]]></description>
      <content:encoded><![CDATA[At this point in my Azure DevTest Labs blog post series, I’ve covered just about everything you need to know to start using DevTest Labs and even how to customize the available artifacts you can use by supplying your own from a personal GitHub repo. What I haven’t shown you how to do yet is how to create one of those custom artifacts. So, you guessed, it, that’s what I’ll do in this post. If you’re just joining the party late, you should probably <a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/10/getting-to-know-azure-devtest-labs/">start at the first post in this series</a> to get caught up.

<strong>What is a DevTest Labs artifact anyway?</strong>

Artifacts are what you use to customize Azure VMs and apps during or after you deploy them in your DevTest Labs setup. There are a ton of default artifacts available from the <a href="https://github.com/Azure/azure-devtestlab">DevTest Labs public GitHub repo</a> (automatically sync’d with your lab) and you can also <a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/20/connect-your-github-repo-to-azure-devtest-labs/">add your own personal GitHub repo</a> if you have specialized requirements not met from the publicly available artifacts.

So, you’re probably thinking something like, “sounds like some kind of script”. Yep. At a bare minimum, almost all artifacts contain these two files: a script and a JSON file that describes the artifact and tells DevTest Labs what to do with your script. These are required along with any other files you need to make the script go. For example, you might need source .csv data files or, if you want to use a custom icon for your artifact, a picture file to add some shiny.

<strong>Get started making an artifact</strong>

Now that you know what an artifact is, it’s time to make one. You don’t need to start from scratch. The easiest way to get started quickly is to simply copy and paste an existing artifact from the <a href="https://github.com/Azure/azure-devtestlab">public Azure DevTest Labs GitHub repo</a>. Either fork the repo for yourself or grab an artifact straight from the site—just be sure you pick the correct type, either Linux or Windows. You’ll see what I mean when you look in <a href="https://github.com/Azure/azure-devtestlab/tree/master/Artifacts">the Artifacts folder on Github</a>, the files for each artifact are kept in a separate folder and named for whether they are targeted for Linux or Windows VMs, but we’re getting ahead of ourselves there. Just go grab an artifact folder and check out the files you find.

Next, copy the artifact folder that you downloaded into your local GitHub repo artifacts directory and rename it something more appropriate (windows-<em>&lt;something&gt;</em> or linux-<em>&lt;something&gt;</em>). To make this artifact your own, you’ll need to tweak the copied JSON file to do your bidding using an editor like the free <a href="http://code.visualstudio.com/download">Visual Studio Code</a> that I use. When you open up the JSON, you’ll see something like this below.

Yes. Yes, I know this screen shot looks like a picture for ants. You can click on it to make it larger, but I wanted you to see the whole thing without line wrapping and I’ll blow it up a piece at a time for you:

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/json-lg.png"><img width="900" height="336" class="aligncenter wp-image-1215 size-full" alt="json-md" src="https://msdnshared.blob.core.windows.net/media/2017/04/json-md.png" /></a>

I know this looks like a lot of code, but have no fear, even if you aren’t a developer you’re going to be a pro at these by the end of the blog. Technically, only the title, description, target OS type, and the command to run are required. I’ll show you some tips and tricks for the other parts as we go along too.
<p style="padding-left: 60px"><strong>Note:</strong> I’m using one of my own custom artifacts for this example. If you’re really curious about what it does, check out <a href="http://github.jeffgilb.com/">my GitHub repo docs</a> on the subject. How I made that documentation page for my repo might be the subject of a later blog post if anyone is interested.</p>
So, here we go section by section and I’ll tell you what each attribute (element) of the JSON file does. <em>PAY ATTENTION</em> to the syntax and mind your <span style="color: #ff0000"><strong>}</strong></span>’s, <span style="color: #ff0000"><strong>,</strong></span>’s, and <span style="color: #ff0000"><strong>“</strong></span>’s. JSON validation is very picky. Also, beware of line wrap in these examples. If in doubt, refer to the picture for ants.

The <strong>schema</strong> line is used to help validate your JSON file. Technically not required, but it never changes so I just leave it as is and move on:
<pre>"$schema": "https://raw.githubusercontent.com/Azure/azure-devtestlab/master/schemas/2015-01-01/dtlArtifacts.json",</pre>
The <strong>title </strong>element (required) provides the name for the artifact and is also what will show up in DevTest Labs when you go to add an artifact:
<pre>"title": "Enable directory integration in Azure AD",</pre>
Publisher is next. This is optional and can be left blank, but putting in your name will tell DevTest Labs, and the world, who is responsible for creating this artifact. It’s also displayed in DevTest Labs when you go to apply an artifact:
<pre>"publisher": "JeffGilb",</pre>
Next, <strong>description</strong> (required) is, well obviously, words that describe what the artifact does:
<pre>"description": "Uses global admin credentials to enable directory sync integration in Azure AD in preparation for running Azure AD Connect.",</pre>
The <strong>iconUri</strong> element value is what tells DevTest Labs what image file to associate with your shiny, new artifact. Give a link to it directly like in the example below:
<pre>"iconUri": "https://raw.githubusercontent.com/jeffgilb/devtestlabs/master/artifacts/azure-enable-directory-sync/azure.png",</pre>
<p style="padding-left: 60px"><strong>Tip:</strong> If you don’t include this line, a standard DevTest Labs icon will be used for your artifact.</p>
Following the icon to use, <strong>targetOSType</strong> (required) tells DevTest Labs whether this artifact is for Linux or Windows VMs:
<pre>"targetOsType": "Windows",</pre>
Adding <strong>tags</strong> helps people filter through the list of artifacts from within the DevTest Labs interface:
<pre>"tags": [
  "Azure"
],</pre>
Now, this whole <strong>parameters</strong> section is only necessary if your script requires user input. Otherwise, it's completely unnecessary to include in your JSON file. However, if you do require user input at script runtime (aka <em>valueFromPipeline=$true</em> in PowerShell speak), this is how you get it. This is also where those text input boxes on artifacts come from that ask you to fill in the script's blanks:
<pre>"parameters": {
  "User": {
    "type": "string",
    "displayName": "Global admin name.",
    "description": "Azure AD tenant global administrator name."
  },
  "Password": {
    "type": "securestring",
    "displayName": "Global admin password.",
    "description": "Azure AD tenant global administrator password."
  }
},</pre>
There’s a couple of things to take note of here after you give your parameter a name--the name that your script is expecting to come from user input. First, notice the <strong>type</strong> line. That can be string, securestring (which is obfuscated and/or allows you to choose from a saved secret from your DevTest Labs’ Azure Key Vault), int, bool, or array. Personally, I’ve never used anything besides string and securestring here, but your mileage may vary.

The next element, <strong>displayName</strong>, is the text displayed next to the data entry text box to tell you what kind of information is expected to be entered there.

Finally, the <strong>description</strong> line of a prompt section is the information that pops-up when the cursor is hovered over the little information icon at the end of the display name.
<p style="padding-left: 60px"><strong>TIP</strong>: Because we’re saying this artifact requires user input (parameters) to run, all the fields that you define here will be <span style="color: #ff0000"><em>*</em></span><em> Required</em>. To make a prompted value optional for whatever reason (maybe an If/Else statement in PowerShell doesn’t need all values or something) just provide an empty default value for the item on the next line like <strong>“default”: “”</strong> or you can add an allow empty line like <strong>"allowEmpty": true </strong>if you want to display a default value, but also allow someone to blank it out when the artifact is run.</p>
Finally, it’s time to tell the JSON which script to kick off with the <strong>runCommand</strong> element (notice how the prompts, and their syntax, are listed after the script name and beware of line wrap. The commandToExecute should be one line, see: picture for ants):
<pre>"runCommand": {
  "commandToExecute": "[concat('powershell.exe -ExecutionPolicy bypass \"&amp; ./enableSync.ps1 -User ''', parameters('User'), ''' -Password ''', parameters('Password'), '''')]"
 }</pre>
If you didn’t have any prompts for your script, you obviously wouldn't need that parameters section above and the runCommand line would look more like this to simply run the script:
<pre>"commandToExecute": "[concat('powershell.exe -ExecutionPolicy bypass \"&amp; ./enableSync.ps1')]"</pre>
And that’s it for the JSON file. Save your artifact files (JSON, script file, and/or image file), commit your local repo changes with GitHub, create and merge a pull request, and then go look in DevTest Labs for your shiny new artifact. In case you're wondering what this particular artifact looks like in DevTest Labs:

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/addArtifact.png"><img width="900" height="461" class="aligncenter size-full wp-image-1236" alt="addartifact" src="https://msdnshared.blob.core.windows.net/media/2017/04/addArtifact.png" /></a>

There you go! Hopefully, if you were following along with me, and you've got your personal GitHub repo integrated with DevTest Labs, your first custom artifact quickly appeared in DevTest Labs. If not, stick around, I’ll show you some handy artifact troubleshooting tips after we cover some things to know about the script part of the artifact. That's next.

&nbsp;

<hr />

You’ve seen my blog; want to follow me on Twitter too? <a href="http://twitter.com/jeffgilb">@JeffGilb</a>.]]></content:encoded>
    </item>
    <item>
      <title>Getting to work with GitHub and Azure DevTest Labs</title>
      <link>https://docs.microsoft.com/archive/blogs/jeffgilb/getting-to-work-with-github-and-azure-devtest-labs</link>
      <pubDate>Fri, 31 Mar 2017 10:15:04 GMT</pubDate>
      <dc:creator><![CDATA[Jeff Gilbert [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jeffgilb/?p=1165</guid>
      <description><![CDATA[In my last blog post I showed you how to add a custom GitHub repo to your Azure DevTest Labs setup....]]></description>
      <content:encoded><![CDATA[In <a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/20/connect-your-github-repo-to-azure-devtest-labs/">my last blog post</a> I showed you how to add a custom GitHub repo to your Azure DevTest Labs setup. I gave a few hints about folder structure and links to the great <a href="https://help.github.com/categories/bootcamp/">GitHub bootcamp documentation</a>, but if you’re new to GitHub you might still be a little confused about just exactly how you’re supposed to interact with these repo things. I know the first time someone sent me a link to a GitHub repo I spent the better part of an hour trying to figure out how to push its buttons. Nowadays, I use GitHub and interact with various repos all day long. And, after you too get comfortable with GitHub you'll be able to easily add custom artifacts to your Azure DevTest Lab setup customized to your specific needs. It’s easy once you learn the ropes—and so that’s what I’m going to show you now.
<h3><strong>Using GitHub from the command line</strong></h3>
If you’re creating custom Azure DevTest Labs artifacts then you’re probably fairly familiar with scripting and comfortable working from the command line. To interact with GitHub repos via the beloved command window, go install GitBash, you can download it from here: <a href="https://git-for-windows.github.io/">https://git-for-windows.github.io/</a>. Once installed, use it to clone your favorite GitHub repo locally and then tell it who you are (you’ll need a GitHub repo access token like I showed you how to get <a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/20/connect-your-github-repo-to-azure-devtest-labs/">in my last blog post </a>so hopefully you saved token that to a text file somewhere safe. Otherwise you’ll need to go regenerate a new one):

Clone the repo (use the little green box from your repo on github.com to grab the clone url):
<pre style="padding-left: 30px"><strong><span style="color: #000000">git clone <em>&lt;url to your repo including the .git part&gt;</em></span></strong></pre>
Change the GitBash working directory (the default location will clone a repo to the <em>C:\Users\&lt;you&gt;\&lt;repo name&gt;</em> folder):
<pre style="padding-left: 30px"><strong>cd <em>&lt;repo-name&gt;</em></strong></pre>
Set up a remote (alias to tell Git who you are so you don’t have to do this every time you change something). The commands will show you what’s going:
<pre style="padding-left: 30px"><strong>git remote remove origin</strong></pre>
<pre style="padding-left: 30px"><strong>git remote add origin http://<em>&lt;your GitHub username&gt;</em>:<em>&lt;your GitHub access token&gt;@github.com/&lt;your full repo name&gt;</em></strong></pre>
<pre style="padding-left: 30px"><strong>git remote -v</strong></pre>
<a href="https://msdnshared.blob.core.windows.net/media/2017/03/cloneRepo.png"><img width="915" height="377" class="aligncenter size-full wp-image-1115" alt="clonerepo" src="https://msdnshared.blob.core.windows.net/media/2017/03/cloneRepo.png" /></a>

Once those commands have completed successfully, you’ll never have to do them again unless you delete your local repo clone and start over.

Now it's time to create a new branch, which is just a different version of the same project. There’s a <em>master</em> branch by default and that is basically the fruit of all your collective labors. You’ll need to use a separate code branch for your development, testing, and whatnot before you’re ready to commit your final changes to the master branch. Branches are meant to help keep your sanity when multiple people are working on files from the same repo.
<p style="padding-left: 60px"><strong>Tip:</strong> This is also what Azure DevTest Labs is talking about when it asks what branch in your repo to grab artifacts from (see last post). I generally make a branch called <em>dev</em> to use in my development environment and just use the master (default) branch for my production DevTest labs artifact location.</p>
To create a new branch, make sure GitBash is operating in the right directory location (<em>cd &lt;repo-name&gt;</em> again if necessary) and then pull down a copy of the master branch. You get to name your new branch after the : in the following command:
<pre style="padding-left: 30px"><strong>git pull origin master:<em>&lt;branch name&gt;</em></strong></pre>
Now, before you do anything to the files stored in your local clone of the GitHub repo you must first use GitBash to checkout your shiny new branch. This will organize all your changes that you can push up to the master branch later.
<p style="padding-left: 60px"><strong>Important:</strong> <em>here me now, believe me later</em>: if you forget to do this before modifying your local files and then sync with the master branch you will lose everything you’ve done since creating the local branch. Make sure you checkout the working branch!</p>

<pre style="padding-left: 30px"><strong>git checkout <em>&lt;branch name you made earlier&gt;</em></strong></pre>
Now you’re free to make changes to your heart’s content working within your local branch. When you’ve made the changes you want to make, and are ready to upload (commit) them to your repo’s master branch, you’ll need to run the following commands:

Tell GitBash to find all the files you’ve modified that haven’t been committed to GitHub yet:
<pre style="padding-left: 30px"><strong>git add -A</strong></pre>
Bundle all those changes up into a commit along with a comment that tells everyone what you have done. Sometimes these comments are to let pull request reviewers see what you’ve been up to, but for private repos it’s mostly just for your own sanity.
<pre style="padding-left: 30px"><strong>git commit -m "<em>&lt;comment&gt;</em>"</strong></pre>
Lastly, tell GitBash to push your commit up to GitHub:
<pre style="padding-left: 30px"><strong>git push origin <em>&lt;branchname&gt;</em></strong></pre>
<a href="https://msdnshared.blob.core.windows.net/media/2017/03/pushOrigin.png"><img width="915" height="641" class="aligncenter size-full wp-image-1096" alt="pushorigin" src="https://msdnshared.blob.core.windows.net/media/2017/03/pushOrigin.png" /></a>

This is why you always hear people say you only have to memorize a few commands to work with GitHub: those commands we just talked about (in the screenshot above) encompass about 99.999% of everything you’ll ever need to do on a regular basis with GitBash.

Are there more commands? You bet. Do I ever really use them? No.

When things get weird with GitBash (conflicts, merge failures, etc.), I just take a deep breath, close GitBash, copy out the files I’ve changed recently from my local repo clone before deleting it and then start all over. Once my repo has been re-cloned and I'm working in a proper branch, I just paste back in my backed-up files. Probably not the best troubleshooting advice you’ll ever hear, but I’ve found that I can do all that in less time than it takes me to figure out how to undo whatever I did to make Git unhappy otherwise using GitBash commands. That’s it. That’s all the troubleshooting information I can or will give you, you’re on your own now—especially if you clone <em>my</em> repo and start meddling around with the files.

OK, so now your modified files are well on their way to joining the master branch club. All you have left to do is create a pull request and merge your local branch changes into the master branch up on GitHub. Let’s go do that now.

Go to your repo’s home on GitHub and you’ll probably notice that GitHub already knows you recently pushed a branch upstream (see the part in yellow below?). Now, click the <strong>Compare &amp; pull request</strong> button:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/createPullRequest.png"><img width="956" height="359" class="aligncenter size-full wp-image-1116" alt="createpullrequest" src="https://msdnshared.blob.core.windows.net/media/2017/03/createPullRequest.png" /></a>

On the resulting page, click <strong>Create pull request</strong>. That will open a screen that allows you to send a message to the pull request reviewer (the person(s) with rights to merge files to master). Generally, with private repos you have that ability so there’s no need to communicate anything to anyone else. Just click <strong>Create pull request</strong> to get the ball rolling.

At this point if you have permissions to merge pull requests, which you most probably do for your own repo, you’ll see an option to merge the newly created pull request by clicking <strong>Merge pull request</strong> and then confirming your decision via <strong>Confirm merge</strong>.

And you’re done. Your changes have been successfully merged into the master branch. At this point you can delete the branch, but remember to keep it there if you are accessing it from DevTest Labs! If you’ve made a temporary branch for some reason and no longer need it, feel free to click the <strong>Delete branch</strong> button. You’ll just have to create a new branch in GitBash the next time you start tinkering around with your repo’s files.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/deleteBranch.png"><img width="996" height="761" class="aligncenter size-full wp-image-1125" alt="deletebranch" src="https://msdnshared.blob.core.windows.net/media/2017/03/deleteBranch.png" /></a>

So, there you have everything you need to know to get started with GitBash and working with GitHub repositories from the command line.

&nbsp;
<h3><strong>GitHub Desktop for the GUI lovers out there</strong></h3>
Have no fear those of you who would rather use a GUI to work with GitHub repos. GitHub has you covered with their <a href="https://desktop.github.com/">GitHub Desktop</a> app. I’m not going to go into great detail in using the app because it’s right there for you to see and should also be pretty self-explanatory now that you know the ins and outs of how to clone a repo, work with branches, and create/merge pull requests.

The first thing you need to do is install <a href="https://desktop.github.com/">GitHub Desktop</a>. Once that’s done, go to your repo’s home on <a href="https://github.com">GitHub</a>, click <strong>Clone or download</strong>, and then <strong>Open in Desktop</strong>.
<p style="padding-left: 60px"><strong>Tip:</strong> If you don’t have GitHub Desktop installed before you hit that option, nothing is going to happen so don’t let that confuse you if you start clicking around ahead of time.</p>
<a href="https://msdnshared.blob.core.windows.net/media/2017/03/cloneDesktop.png"><img width="724" height="284" class="aligncenter size-full wp-image-1105" alt="clonedesktop" src="https://msdnshared.blob.core.windows.net/media/2017/03/cloneDesktop.png" /></a>

Pick the spot on your local machine where you want GitHub Desktop to clone your repo and it will do the rest. Once your repo has been added you can get to work.

At the top of the GitHub Desktop screen, towards the left, use the drop-down to select the branch you want to work in or create a new one. Go edit the files from where you cloned them in the previous step and then come back here. Compare your working branch to the master branch to see what changes have been made, add a commit title and comment, and then commit the changes:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/githubDesktopCommit.png"><img width="1024" height="600" class="aligncenter size-large wp-image-1145" alt="githubdesktopcommit" src="https://msdnshared.blob.core.windows.net/media/2017/03/githubDesktopCommit-1024x600.png" /></a>

After that, you just need to create a pull request to get your committed changes where they can be merged with the master branch by clicking <strong>Send pull request</strong> up towards the top right:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/githubDesktopPull.png"><img width="1024" height="600" class="aligncenter size-large wp-image-1155" alt="githubdesktoppull" src="https://msdnshared.blob.core.windows.net/media/2017/03/githubDesktopPull-1024x600.png" /></a>

Once the pull request has been created, you’ll get a message telling you so along with an offer for you to view the newly created pull request on GitHub. From there, you follow the same steps you saw earlier to merge the pull request into the master branch.

&nbsp;

So, there you go, that's two ways to interact with GitHub. Choose the one that works for you and get cracking on some custom Azure DevTest Lab artifacts of your own! I’ll show you how make them in my next post.

&nbsp;

<hr />

You’ve seen my blog; want to follow me on Twitter too? <a href="http://twitter.com/jeffgilb">@JeffGilb</a>.

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Connect your GitHub repo to Azure DevTest Labs</title>
      <link>https://docs.microsoft.com/archive/blogs/jeffgilb/connect-your-github-repo-to-azure-devtest-labs</link>
      <pubDate>Mon, 20 Mar 2017 17:39:29 GMT</pubDate>
      <dc:creator><![CDATA[Jeff Gilbert [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jeffgilb/?p=1085</guid>
      <description><![CDATA[If you’ve been following along with this Azure DevTest Labs blog series, then you know how to do the...]]></description>
      <content:encoded><![CDATA[If you’ve been following along with this <a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/10/getting-to-know-azure-devtest-labs/">Azure DevTest Labs blog series</a>, then you know how to do the basics to get a dev/test lab set up using what you get by default from the service. <a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/16/creating-your-first-vms-with-azure-devtest-labs/">Virtual machines are easily created</a> and there’s a large number of artifacts (scripted actions) available in the <a href="https://github.com/Azure/azure-devtestlab">public Azure DevTest Labs GitHub repository </a>for you to leverage when customizing your VMs.

Ready to take the next step and link your personal GitHub repo to your DevTest Labs setup? Good.

First, a little background for those of you not familiar with GitHub. GitHub is basically a code repository hosting service used by developers with some additional collaboration capabilities. While it’s mostly accessed as a command line tool, you manage GitHub repos at <a href="https://github.com/">https://github.com/</a>. If you’re still reading this paragraph then chances are you don’t have a personal GitHub repo yet. It’s easy to do, so let's go get that out of the way now. Go to <a href="https://github.com/">github.com</a>, create an account, and then <a href="https://help.github.com/articles/create-a-repo/">create a public (or private) repo</a>. Once you’ve done that, create a folder called artifacts (or whatever name you want for your artifacts folder).
<p style="padding-left: 30px"><strong>Tip</strong>: You can get up to speed on GitHub even faster if you review the full <a href="https://help.github.com/categories/bootcamp/">bootcamp help documentation</a>.</p>
Back in DevTest Labs, you’re going to need a few pieces of information before adding your GitHub repo. You can get this information on the fly while adding your repo, but I always use trusty old notepad.exe to take a few notes so I’ll have this information handy all at once when I need it.

To get started, click into the DevTest Lab that you want to add your repo to, then <strong>Configuration and policies</strong> &gt; <strong>Repositories </strong>&gt; <strong>+Add</strong>. You should now see something like this:

<a href="https://msdnshared.blob.core.windows.net/media//2017/03/add-repo.png"><img width="642" height="522" class="aligncenter size-large wp-image-1055" alt="add-repo" src="https://msdnshared.blob.core.windows.net/media/2017/03/add-repo.png" /></a>

The <strong>Name</strong> for the custom repo is pretty straightforward. It’s also what will be displayed in the REPOSITORY column when adding an artifact to a formula or VM later on.

Next, DevTest Labs needs to know where your personal repo is located. In other words, you need to know what’s called the <strong>Git clone URI</strong>. Sounds complicated, but it’s easy to get from your <a href="https://github.com/">GitHub</a> repo. Just click the big green <strong>Clone or download</strong> button like this and then copy the clone URL to clipboard:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/clone-URL.png"><img width="431" height="212" class="aligncenter size-full wp-image-1065" alt="clone-url" src="https://msdnshared.blob.core.windows.net/media/2017/03/clone-URL.png" /></a>

The <strong>Branch</strong> value is the GitHub branch that you want DevTest Labs to stay in sync with. To keep things easy, you can always enter <em>master</em> here (that’s the default branch in GitHub). I usually create and use a <em>dev </em>branch to keep my under-development artifacts separate from my production artifacts over in master. Plus, if someone stumbles upon your GitHub repo you don’t want them cloning it and then getting upset when things go wonky using half-baked artifacts.
<p style="padding-left: 30px"><strong>Disclaimer: </strong>if you stumble upon my public GitHub repo, and clone the artifacts that I use while playing around in my personal lab, you’ll be using them at your own risk. They might not work or could disappear or change tomorrow. So, YMMV, no warranties, etc…</p>
The <strong>Personal access token</strong> is what DevTest Labs uses to authenticate with your GitHub repo. You get this from your personal GitHub settings by clicking the drop-drop-down by your avatar in the top-right corner, select Settings, and then Security. All the way at the bottom of the list under Developer settings you’ll see an option for <strong>Personal access tokens</strong>. You guessed it, click that. Now click <strong>Generate new token</strong> at the top right (you might get prompted for your password at this point), then enter a description, select the appropriate security scope (I just select everything here for my lab), and then click <strong>Generate token</strong>. Done. Now just copy the personal access token:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/access-token.png"><img width="642" height="192" class="aligncenter size-full wp-image-1045" alt="access-token" src="https://msdnshared.blob.core.windows.net/media/2017/03/access-token.png" /></a>

The <strong>Artifact folder path</strong> is the last piece of information you need to add your repo. That’s the folder you made earlier when you first created your GitHub repo remember? We’ll skip how to add the ARM templates folder path for now as you only need one folder path to add a repo.  ARM templates are beyond the scope of this post, but I’m sure you can figure that one out anyway if you know what an ARM template is.

Finally, just hit <strong>Save</strong> and DevTest Labs will verify and save the settings you entered. Your custom repo will now be available to use and grab artifacts from at your leisure. Too easy right?

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/repo-added1.png"><img width="642" height="542" class="aligncenter size-full wp-image-1086" alt="repo-added" src="https://msdnshared.blob.core.windows.net/media/2017/03/repo-added1.png" /></a>
<p style="padding-left: 30px"><strong>Tip</strong>: if you’d rather use a VSTS Git repository or are looking for more information about how to add a repo to DevTest Labs, check out <a href="https://docs.microsoft.com/azure/devtest-lab/devtest-lab-add-artifact-repo">the official content on docs.microsoft.com</a>.</p>
At this point, you’ll be able to add custom artifacts that you create to your personal repo and apply them to VMs in your lab. You can also clone some other artifact repo, modify the artifacts as you see fit, and then add those to your personal repo too, but that's a different blog post.

Next up, <a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/31/getting-to-work-with-github-and-azure-devtest-labs/">in my next blog post</a> I'll show you how to interact with the files in your personal GitHub artifact repo..

&nbsp;

<hr />

You’ve seen my blog; want to follow me on Twitter too? <a href="http://twitter.com/jeffgilb">@JeffGilb</a>.]]></content:encoded>
    </item>
    <item>
      <title>Creating your first VMs with Azure DevTest Labs</title>
      <link>https://docs.microsoft.com/archive/blogs/jeffgilb/creating-your-first-vms-with-azure-devtest-labs</link>
      <pubDate>Thu, 16 Mar 2017 11:16:04 GMT</pubDate>
      <dc:creator><![CDATA[Jeff Gilbert [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jeffgilb/?p=935</guid>
      <description><![CDATA[If you read my last post then you already know how to get an Azure DevTest Lab setup using your...]]></description>
      <content:encoded><![CDATA[If you read <a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/10/getting-to-know-azure-devtest-labs/">my last</a> post then you already know how to get an Azure DevTest Lab setup using your Azure subscription. Next, I’ll introduce you to some concepts and get you started creating your very first virtual machines and really kick the lab's tires.

Now, before you get all excited and jump straight to that shiny <strong>Add</strong> button to create a VM, there’s something I recommend you do first:<em> save your secrets</em>. When your DevTest Labs instance is created in Azure, it creates a few other things like virtual networks, storage containers, and other interesting things (more on that later). And among those things is an Azure KeyVault dedicated to saving secrets (passwords) for the DevTest environment. Help yourself avoid future headaches from troubleshooting incorrectly entered passwords and go save some passwords there before you start cranking out VMs. For example, I start out by saving an AD DS password that I use for logging into my <em>"on-premises"</em>, domain-based Azure VMs and an AAD password used for my Azure subscription’s global admin account for when I'm feeling cloudy. As you get deeper into DevTest Labs you'll be able to find all kinds of ways to leverage this functionality. Please do so here:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/keyVault.png"><img width="800" height="324" class="aligncenter size-full wp-image-995" alt="keyvault" src="https://msdnshared.blob.core.windows.net/media/2017/03/keyVault.png" /></a><a href="https://msdnshared.blob.core.windows.net/media/2017/03/keyVault.png"></a>

OK, that’s out of the way. Now we can get busy clicking the fun buttons.

When you first start up your DevTest lab in Azure and take a look at the Overview blade you won’t see any virtual machines present. They’re easy enough to create though, at the top of the screen just click <strong>+Add</strong>:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/add.png"><img width="800" height="214" class="aligncenter size-full wp-image-985" alt="add" src="https://msdnshared.blob.core.windows.net/media/2017/03/add.png" /></a><a href="https://msdnshared.blob.core.windows.net/media/2017/03/add.png"></a>

Your VM will likely need an operating system, and lucky for us, these are made available via the Azure subscription. Most times I pick a Server OS when starting from scratch, but you might prefer Linux or a flavor of Windows Client OS. It really depends on what your Azure subscription entitles you to create and is out of the hands of DevTest Labs.
<p style="padding-left: 30px"><strong>Tip:</strong> to create VMs running the client OS’s you’ll need an Azure subscription that include MSDN or Enterprise Dev/Test for EA.</p>
OK, time for a quick overview and vocabulary lesson on creating a VM using the following graphic (you’ll get to this view by selecting an OS, and then clicking on Artifacts under More options in the middle blade):

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/overview.png"><img width="900" height="492" class="aligncenter size-full wp-image-975" alt="overview" src="https://msdnshared.blob.core.windows.net/media/2017/03/overview.png" /></a>
<ol>
 	<li><strong>Choose a base</strong>. This is where you pick an operating system. Self-explanatory.</li>
 	<li><strong>Use a saved secret</strong>. The first pieces of information in this blade that you need to provide for the VM are hopefully obvious to you: the name for the VM and the user name that will be used to access it. You can manually type in a password for that user, but what is this “<strong>Use a saved secret</strong>”checkbox stuff all about? C’mon, you know, we already talked about this. Select the option to use a saved secret and then select the secret (password) that you want to use. Now you won’t have to risk entering the password incorrectly every time you create a VM—and you can use those secrets in other interesting ways with artifacts later on too.</li>
 	<li><strong>Artifacts</strong>. You’re going to love these. Artifacts are basically configuration commands/scripts that you can use to customize your VM and do…well, just about anything. I’m not going to go through each of these public artifacts, check them out and select the ones you think are interesting. Don’t worry about trying to get it 100% right the first time, you can always apply artifacts to running VMs later. Also, the list of artifacts is constantly growing as people add them to the DevTest Labs GitHub repo (more on that later) and you can also use your own personal artifacts that you create—which leads us to #4.</li>
 	<li><strong>Artifact Repo</strong>. Notice in the picture above that some of the available artifacts are from “My Repo” and others are from “Public Repo”. That’s because I’ve added my very own personal GitHub repo to this DevTest Labs instance so that I can use custom artifacts. For now, we’ll just focus on using the default public repo artifacts and I’ll show you how add your own GitHub repo and make custom artifacts in subsequent blog posts.</li>
</ol>
<p style="padding-left: 30px"><strong>Tip:</strong> there are also some advanced options available that are out of scope for this blog post unless you have nothing else to do today, but check them out when you get comfortable with the basics. These allow you to do things like create more than one VM at a time and other cool stuff.</p>
OK, everything sorted, just click <strong>Create</strong> and DevTest Labs will take care of the VM creation and customization heavy lifting for you. You’ll see the VM name appear in the Overview blade under <strong>My virtual machines </strong>in a<em> Creating </em>status. In just a few minutes (these usually install <em>very</em> quickly) the status will change to <em>Running</em> and you’re in business. Click on the VM name and you’ll be able to see a few interesting things:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/running-vm.png"><img width="800" height="470" class="aligncenter size-full wp-image-1025" alt="running-vm" src="https://msdnshared.blob.core.windows.net/media/2017/03/running-vm.png" /></a>

On the VM overview blade you can review basic information about your new VM and also see if it is configured to auto-start or auto-shutdown. By default, your VM will be opted in to auto-shutdown, but you’ll have to manually configure auto-start if you want to use that. Pretty handy eh? Speaking as someone who has left VMs running on accident (including while writing this blog post!) the auto-shutdown is one of my favorite features and has saved me from losing more than a little of my monthly Azure allowance!
<p style="padding-left: 30px"><strong>Tip:</strong> Using Azure VMs without DevTest Labs? That’s OK, <a href="https://blogs.technet.microsoft.com/tip_of_the_day/2017/03/02/cloud-tip-of-the-day-announcing-auto-shutdown-for-vms-using-azure-resource-manager/">you can auto-shutdown those now</a> too.</p>
At the top of the pane you can see the options available for interacting with the VM. The <strong>Connect</strong> option triggers an RDP connection for you to log into your VM using the credentials that you supplied when you created it, the <strong>Start</strong>, <strong>Stop</strong>, and <strong>Delete</strong> buttons allow you to do those things to the VM, and <strong>Apply artifacts</strong> is where you go to further customize your running VM. That’s covered in the next blog post.

&nbsp;

So, at this point in the blog series, you should have a fairly basic understanding of Azure DevTest Labs and how to create a pretty standard Azure virtual machine with it. I’d be remiss if I didn’t point you to <a href="https://docs.microsoft.com/azure/devtest-lab/devtest-lab-overview">the official Azure DevTest Labs documentation </a>up on docs.microsoft.com for more information. And, if you get stuck and can’t find an answer in the docs, or just looking for others to talk to about DevTest Labs, you can also <a href="https://social.msdn.microsoft.com/Forums/home?forum=AzureDevTestLabs">visit the Azure DevTest forum </a>by clicking the MSDN forum link in the console itself.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/forum.png"><img width="804" height="116" class="aligncenter size-full wp-image-955" alt="forum" src="https://msdnshared.blob.core.windows.net/media/2017/03/forum.png" /></a>

&nbsp;

Next up, <a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/20/connect-your-github-repo-to-azure-devtest-labs/">connecting your personal GitHub repository</a> to your DevTest Labs setup.

&nbsp;

<hr />

You’ve seen my blog; want to follow me on Twitter too? <a href="http://twitter.com/jeffgilb">@JeffGilb</a>.]]></content:encoded>
    </item>
    <item>
      <title>Getting to know Azure DevTest Labs</title>
      <link>https://docs.microsoft.com/archive/blogs/jeffgilb/getting-to-know-azure-devtest-labs</link>
      <pubDate>Fri, 10 Mar 2017 19:48:34 GMT</pubDate>
      <dc:creator><![CDATA[Jeff Gilbert [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jeffgilb/?p=885</guid>
      <description><![CDATA[A (very) long time ago, I was one of the first people to obtain a Windows 2000 Microsoft Certified...]]></description>
      <content:encoded><![CDATA[A (very) long time ago, I was one of the first people to obtain a Windows 2000 Microsoft Certified Systems Engineer (MSCE) certification. Back then, just as now, I liked to test things out in a lab before introducing my latest technical interests into production—or these days, publishing what I learn to <a href="https://docs.microsoft.com/">https://docs.microsoft.com</a>. Of course, in the old days, the only way to test anything having to do with computers or Active Directory functionality was to have a room full of PCs along with their assorted cables and peripherals. In my case, I had all that crammed onto storage shelves in a small closet under the stairs at my house. “<em>My office</em>” quickly became an impromptu sauna from the heat given off by running all the hardware necessary to try out this new Active Directory stuff. I spent many sleepless nights in there studying and learning…sweating, and wishing there was an easier way to build a lab.

Fast forward a year or two and I’m working as an SMS 2.0 (now System Center Configuration Manager) administrator managing and pushing software and Windows updates out to thousands of computers. Doing that without first testing to ensure havoc didn’t ensue seemed like career suicide to me so, you guessed it, I had another wall of computers in my office representing each of the various operating systems and configurations that I was responsible for keeping up-to-date. And again, my office stayed pretty hot most days.

Then one fine day, I discovered Microsoft Virtual PC 2004. Woah, I could emulate multiple PCs on one desktop computer?! Nirvana.

I know, it sounds silly now, but back then this discovery was a life-changing event for me. With that in mind, you can probably imagine how giddy I became when I later discovered Hyper-V and hydration kits that I could use to build out on-demand labs. And later when scalable Azure virtual machines replaced Hyper-V as my virtualization technology of choice. However, nothing that has happened during my long saga of lab computer trials and tribulations can compare to the paradigm shift my test lab setups are currently undergoing with <a href="https://azure.microsoft.com/en-us/services/devtest-lab/">Azure DevTest Labs</a>.

This Azure service automates creating, configuring, and managing developer and test environments in the cloud. For those enterprise client management folks in the audience—this is like <em>cloud-based <a href="https://technet.microsoft.com/en-us/itpro/windows/deploy/windows-10-poc-mdt#about-mdt">MDT</a></em> leveraging Azure virtual machines with an easy to use management interface standing by to answer all of your lab needs [<em>head exploding</em>]. Needless to say, it’s my new favorite Azure thing and I want to share it with you.
<p style="padding-left: 30px"><strong>Note:</strong> Of course, you’ll need an Azure subscription to use Azure DevTest Labs on a regular basis, but even if you don’t have a paid Azure subscription you can still take DevTest Labs on a test drive using a <a href="https://azure.microsoft.com/en-us/free/">free, 30 day trial Azure account</a>.</p>
Azure DevTest Labs can be used for a lot of much more complicated scenarios than I use it for, and there’s some great documentation to get you started at <a href="https://docs.microsoft.com/azure/devtest-lab/devtest-lab-overview">https://docs.microsoft.com/azure/devtest-lab/devtest-lab-overview</a>, but for now I’m going to show you how to use it for a personal test lab similar to what I use for my own personal testing and learning or for creating conference demo environments. That will provide you with the basics and hopefully get you as excited as me about its possibilities.

<strong>Have Azure credits?</strong>

You'll need a subscription that provides you monthly Azure credits to use DevTest labs and use client OS images (Windows 7 and later). If you don't have that right now, here's some information to get you pointed in the right direction:
<ul>
 	<li>Overview of subscriptions that give you Azure credits<strong>: </strong><a href="https://www.visualstudio.com/vs/pricing/">https://www.visualstudio.com/vs/pricing/</a></li>
 	<li>Azure credits by subscription type:<strong> </strong><a href="https://azure.microsoft.com/en-us/pricing/member-offers/msdn-benefits-details/">https://azure.microsoft.com/en-us/pricing/member-offers/msdn-benefits-details/</a></li>
</ul>
Quick details:
<ul>
 	<li>A <a href="https://www.microsoftstore.com/store?Action=DisplayPage&amp;Locale=en_US&amp;SiteID=msusa&amp;id=ThreePgCheckoutShoppingCartPage&amp;WT.mc_id=VScom_VSProMSDNN_Cart">new <strong>Visual Studio Professional</strong> subscription</a> is $1,199 ($50 Azure credits per month), but only $799 for renewals. $50 monthly Azure credit means it’s basically only $200 a year (from the 2nd year on if you use all the credits each month anyway...and you will).</li>
 	<li>A new <a href="https://www.microsoftstore.com/store/msusa/en_US/pdp/Visual-Studio-Enterprise-Subscription/productID.5093239100"><strong>Visual Studio Enterprise</strong> subscription</a> ($150 Azure credits per month) is $5,999, renew at $2,569.00.</li>
 	<li>New <a href="https://www.microsoftstore.com/store/msusa/en_US/pdp/Visual-Studio-Test-Professional-Subscription/productID.5093239400"><strong>Visual Studio Test Professional</strong> Ssbscription</a> ($50 Azure credits per month) is $2,169, renew at $899.</li>
 	<li><a href="https://www.visualstudio.com/msdn-platforms/"><strong>MSDN Platforms</strong> subscription</a> ($100 Azure credits) <strong>*</strong></li>
</ul>
<p style="padding-left: 60px"><strong>*</strong> MSDN Platforms is available exclusively through Microsoft Volume Licensing. For pricing and purchase details, contact your Microsoft account representative, Microsoft Partner, or an authorized volume licensing reseller.</p>
<strong>Ready to get started?</strong>

To get your first Azure DevTest Lab set up, just log into your Azure subscription, search the available Azure services for DevTest and select <strong>DevTest Labs</strong>:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/AzureDTL.png"><img width="685" height="299" class="aligncenter wp-image-895" alt="azuredtl" src="https://msdnshared.blob.core.windows.net/media/2017/03/AzureDTL-1024x447.png" /></a><a href="https://msdnshared.blob.core.windows.net/media/2017/03/AzureDTL.png"></a>

Once you’ve opened the DevTest service blade, just click Add and fill out the required metadata to establish your first DevTest labs instance. You can have as many labs as you’d like, and it’s recommended that at a minimum you have a development lab and a production lab. For now, it’s OK to have just one while you’re learning the ropes, but it’s probably obvious to many of you why you’d want to keep those two environments separate. You’ll thank yourself for setting up both a Dev and Prod environment if you start creating your own custom artifacts later…and you will. Also notice the nifty auto-shutdown feature that helps protect you from leaving an Azure VM running all weekend for no reason and burning through your Azure subscription credits…not that that’s ever happened to me or anything [<em>shrug</em>]:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/newDTL.png"><img width="1024" height="403" class="aligncenter size-large wp-image-905" alt="newdtl" src="https://msdnshared.blob.core.windows.net/media/2017/03/newDTL-1024x403.png" /></a>

Now you know how to create your first Azure DevTest Lab setup(s) to get started. I’m planning on writing a fairly long blog post series on the ins and outs of DevTest Labs to share what I’ve learned about it so stay tuned to learn how to:
<ul>
 	<li><a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/16/creating-your-first-vms-with-azure-devtest-labs/">Creating your first VMs using formulas</a> (templates) and publicly available artifacts (scripts)</li>
 	<li><a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/20/connect-your-github-repo-to-azure-devtest-labs/">Connect your personal GitHub repo to your lab</a> so you can use your own artifacts</li>
 	<li><a href="https://blogs.technet.microsoft.com/jeffgilb/2017/03/31/getting-to-work-with-github-and-azure-devtest-labs/">How to modify and interact with GitHub</a> repo files to create artifacts</li>
 	<li><a href="https://blogs.technet.microsoft.com/jeffgilb/2017/04/07/your-first-devtest-labs-artifact-json-file/">How to create and modify artifact JSON files</a> to control artifact behavior</li>
 	<li><a href="https://blogs.technet.microsoft.com/jeffgilb/2017/04/13/your-first-devtest-labs-artifact-powershell-scripts/">How to create and catch errors in artifact PowerShell files</a> that interact with your VMs.</li>
</ul>
<p style="padding-left: 30px">…and more on the way!</p>


<hr />

You’ve seen my blog; want to follow me on Twitter too? <a href="http://twitter.com/jeffgilb">@JeffGilb</a>.]]></content:encoded>
    </item>
    <item>
      <title>Deleting Azure Active Directory</title>
      <link>https://docs.microsoft.com/archive/blogs/jeffgilb/deleting-azure-active-directory</link>
      <pubDate>Thu, 09 Mar 2017 17:50:38 GMT</pubDate>
      <dc:creator><![CDATA[Jeff Gilbert [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jeffgilb/?p=865</guid>
      <description><![CDATA[If you’re like me, and I know I am, you have probably signed up for several Microsoft Online...]]></description>
      <content:encoded><![CDATA[If you’re like me, and I know I am, you have probably signed up for several Microsoft Online Services trials or just somehow ended up with multiple Azure AD instances associated with your Microsoft Azure subscription. Turns out they’re kind of hard to delete, but it’s not impossible. Here’s how.

Just because you don’t want the Azure AD instance around anymore doesn’t necessarily mean that your Azure subscription hasn’t become attached. If you try to just hit the delete button on your Azure AD instance, you’ll probably get something like this in return:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/delete-1.png"><img width="500" height="406" class="aligncenter size-full wp-image-785" alt="delete-1" src="https://msdnshared.blob.core.windows.net/media/2017/03/delete-1.png" /></a>

So, as you can see, there’s some work to be done. Here’s how to kill off each of those without getting carpal tunnel syndrome deleting hundreds of user accounts and applications one at a time.

The first thing you need to do is connect to your Azure subscription using PowerShell. That might sound scary to some, but it’s pretty simple to do. There are two ways to do it depending on whether you want to automate the connection or log in interactively (and not type your password in a plain text script).

Either way, if you haven’t done this before you will want to install the Microsoft Online Services Sign-In Assistant from (<a href="http://go.microsoft.com/fwlink/?LinkID=286152">http://go.microsoft.com/fwlink/?LinkID=286152</a>) and the Azure AD PowerShell module (<a href="http://go.microsoft.com/fwlink/p/?linkid=236297">http://go.microsoft.com/fwlink/p/?linkid=236297</a>) before continuing.

Ready to go? OK, if you want to automate all of this as much as possible, you can authenticate to Azure like this below (the admin account is probably the <em>&lt;name&gt;</em>@mydomain.onmicrosoft.com account that you used when you first created your AAD):
<pre style="padding-left: 60px">$User="&lt;admin account for the AAD you want to delete&gt;"
$Password="&lt;Password&gt;"
$SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force
$msolcred = New-Object –TypeName System.Management.Automation.PSCredential ($User,$SecurePassword)
connect-msolservice -credential $msolcred</pre>
<strong>OR</strong>, if you don’t want someone to see your password and want to log in interactively, do this instead:
<pre style="padding-left: 60px">$msolcred = get-credential
connect-msolservice -credential $msolcred</pre>
Freshly authenticated, at the top of the list of offending items stopping you from deleting your Azure AD is users.

Yep, there they are. Hundreds of them. Let’s delete them.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/users-1.png"><img width="624" height="387" class="aligncenter size-full wp-image-845" alt="users-1" src="https://msdnshared.blob.core.windows.net/media/2017/03/users-1.png" /></a>

You can only delete an Azure AD directory if you, the AAD admin, are the only user associated with it. After connecting to Azure with PowerShell, you can get a list of all users by running this command (choose the path and file name of your liking):
<pre style="padding-left: 60px">Get-MsolUser –All | Export-CSV C:\temp\users.csv</pre>
<p style="padding-left: 30px"><strong>Bonus Tip:</strong> you can get groups like this too, but technically you don’t have to delete them to delete your Azure AD: <em>Get-MsolGroup –All | Export-CSV C:\temp\groups.csv</em>.</p>
Open the recently exported users.csv file and look in the <strong>SignInName</strong> column (column AO in my exported .csv) to find the AAD admin account you're logged in as (probably something like <em>admin@mydomainname.onmicrosoft.com</em>). Delete that row to remove the user account (you) from the file and save it. Now that every user (except you) is listed in that .csv file, it’s time to import the file and delete everyone.

Say any final words you feel are appropriate and then run this command to recycle user account electrons:
<pre style="padding-left: 60px">Import-CSV C:\temp\users.csv | Remove-MsOlUser –Force</pre>
<p style="padding-left: 30px"><strong>Bonus Tip #2:</strong> You can whack Azure AD groups like this too, but again, it’s not necessary to delete your AAD instance: <em>Import-CSV C:\groups.csv | Remove-MsOlGroup –Force</em>.</p>
Altogether, it looks something like this:

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/ps1.png"><img width="624" height="112" class="aligncenter size-full wp-image-815" alt="ps1" src="https://msdnshared.blob.core.windows.net/media/2017/03/ps1.png" /></a>

Go grab a snack because it might be a few minutes depending on how many users you need to send to oblivion. After a bit, only the admin account you’re using to delete the directory should be present.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/users-2.png"><img width="624" height="213" class="aligncenter size-full wp-image-855" alt="users-2" src="https://msdnshared.blob.core.windows.net/media/2017/03/users-2.png" /></a>

All users besides you gone? Check.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/delete-2.png"><img width="500" height="395" class="aligncenter size-full wp-image-795" alt="delete-2" src="https://msdnshared.blob.core.windows.net/media/2017/03/delete-2.png" /></a>

Next on my hit list are the enterprise applications. Back in PowerShell, you need to run a few different commands. To see the list of applications blocking you from deleting your AAD instance, run this command:
<pre style="padding-left: 60px">Get-MsolServicePrincipal | Select Displayname</pre>
Some of the returned app names are required and can stay, but others, the ones users have added, have to go. Time to say good-bye:
<pre style="padding-left: 60px">Get-MsolServicePrincipal | Remove-MsolServicePrincipal</pre>
Haha you say, my screen is full of red errors! I know, I know, just ignore those and run that first command again to see who’s left…those are the ones you don’t have to (read: can’t) delete this way. See?

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/ps2.png"><img width="624" height="245" class="aligncenter size-full wp-image-825" alt="ps2" src="https://msdnshared.blob.core.windows.net/media/2017/03/ps2.png" /></a>

With enterprise applications gone, there's just one last thing blocking us from deleting this Azure AD instance: active Microsoft Online Services subscriptions.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/delete-3.png"><img width="500" height="403" class="aligncenter size-full wp-image-805" alt="delete-3" src="https://msdnshared.blob.core.windows.net/media/2017/03/delete-3.png" /></a>

If you’ve only got Azure AD to delete, then you probably already have one of those coveted check marks and can just click <strong>Delete</strong> now and be done.

Me on the other hand, I’ve got this Azure AD instance intertwined with an Enterprise Mobility + Security E3 subscription…AKA another Microsoft Online Services subscription (could just as easily be Intune, Office 365, or Azure AD Premium). So, I can’t delete the Azure AD instance until the EMS subscription is taken care. Let’s go do that.

There are two ways to do delete a license-based subscription like Azure Active Directory Premium P1, P2, Office 365 Business, or Enterprise + Mobility Suite E3 and E5 (pay-as-you go subscriptions can only be deleted from the Azure portal). If you’re not in a hurry, or just want to learn more about what happens in the background when you delete a subscription, follow this next section to get your subscription deleted in about 90 days. If you’re in a rush, skip to the section at the bottom and say good-bye to your subscription in about 3 days.

<strong>Cancel and delete a subscription </strong>

If you have time on your hands and don't mind waiting 90 days to delete a license-based subscription, just sign in to the Office 365 portal (<a href="https://www.office.com/">portal.office.com</a>), and then go to Billing &gt; Subscriptions. Under the “More actions” drop-down, select Cancel (or cancel trial in my case):

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/cancel-subscription.png"><img width="793" height="336" class="aligncenter wp-image-775" alt="cancel-subscription" src="https://msdnshared.blob.core.windows.net/media/2017/03/cancel-subscription-1024x434.png" /></a>

This will set your subscription to <em>Disabled</em> not deleted. You can’t delete it because subscriptions have a life cycle of their own. That’s OK though as once you remove your Microsoft Account from the directory you won’t see it in your Azure subscription's Azure AD directories list again unless you log in with the admin account you deleted everything with within 90 days of disabling the subscription.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/subscription-lifecycle.png"><img width="520" height="375" class="aligncenter size-full wp-image-835" alt="subscription-lifecycle" src="https://msdnshared.blob.core.windows.net/media/2017/03/subscription-lifecycle.png" /></a>

When the subscription is deprovisioned (90 days from when you cancelled it), the Azure AD instance associated with it will also automatically be history.

<strong>Delete a subscription</strong>

Why do I have the feeling everyone jumped to here when I said you can delete a license-based subscription in only 3 days instead of 90? Anyway, for those of you in a hurry to delete a subscription, you can now use the <a href="https://businessstore.microsoft.com/manage/inventory/subscriptions/">Microsoft Store for Business portal</a> (this capability is also coming soon to Office 365 Admin center) to quickly deprovision a subscription so that you'll be able to delete your Azure AD from the Azure portal <em>about 72 hours later</em>. Three days instead of 90? Sign me up! How do you do that  you ask? Just follow these quick directions towards the bottom of this docs.microsoft.com article <a href="https://docs.microsoft.com/azure/active-directory/directory-delete-howto">Delete an Azure Active Directory tenant</a>.

Delete Azure AD. Done!

<hr />

You’ve seen my blog; want to follow me on Twitter too? <a href="http://twitter.com/jeffgilb">@JeffGilb</a>.]]></content:encoded>
    </item>
    <item>
      <title>Add a custom VM image to your Azure subscription</title>
      <link>https://docs.microsoft.com/archive/blogs/jeffgilb/add-a-custom-vm-image-to-your-azure-subscription</link>
      <pubDate>Wed, 02 Nov 2016 14:34:17 GMT</pubDate>
      <dc:creator><![CDATA[Jeff Gilbert [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jeffgilb/?p=465</guid>
      <description><![CDATA[It’s no secret that I like to use Azure virtual machines for my lab testing. In fact, as much as I...]]></description>
      <content:encoded><![CDATA[It’s no secret that I like to use Azure virtual machines for my lab testing. In fact, as much as I love it, it’s rare that I even use Hyper-V on my local machine anymore. From servers to client OS’s, Azure virtual machine images stand ready to provide the infrastructure for me to do almost all of my lab testing, but every now and then I need a little more. For example, once upon a time I needed to do some Windows Information Protection (WIP) testing to prep for a conference demo, but all the Windows 10 images in Azure at the time were Windows 10 version 1511—which isn’t supported for WIP. Despair.

Luckily for us, Azure makes it easy to upload your own virtual machine images. However, like most simple things, it’s not always easy to do. So, here’s how to do it.

<strong>Note:</strong> Windows 10 1607 is now available in the Azure VM gallery. So, if you’re reading this blog to get that version of Windows uploaded just go create a new VM from the gallery. And my job here is done.

<strong>Before you (can) get started</strong>

You’ll need to meet some basic prerequisites before you can upload a VM to Azure. Honestly, configuring the prerequisites is most likely the place where you’ll run into issues, but I can’t provide tech support here so I’ll just do my best to point you in the right directions to keep you out of trouble:
<ul>
 	<li><strong>Windows 10 .ISO file to create a VM</strong>. I can’t help you much with this, but I can tell you that I got mine through an MSDN subscription.</li>
 	<li><strong>Hyper-V</strong> to create the virtual machine image file to upload. I’m using the Hyper-V features installed on a Windows 10 laptop. No need for a server here.</li>
 	<li><strong>Azure AD subscription</strong>. Self-explanatory. If you’re trying to upload a VM to Azure then I’m guessing you already have one of these. If not, grab a trial. Save yourself some time and just get the entire <a href="http://www.microsoft.com/cloud-platform/enterprise-mobility-security-trial">Enterprise Mobility + Security trial</a>. Then you’ll have other toys to play with and be able to really put your Win10 image through its paces when we're done here.</li>
 	<li><strong>Azure AD cmdlets</strong> and <strong>connect PowerShell to your Azure AD service</strong>. You can see how to do all that here: <a href="https://msdn.microsoft.com/en-us/library/azure/jj151815(v=azure.98).aspx#bkmk_installmodule">https://msdn.microsoft.com/library/azure/jj151815(v=azure.98).aspx#bkmk_installmodule</a>. If you just want to grab the Azure AD cmdlets, you can do that from here: <a href="http://connect.microsoft.com/site1164/Downloads/DownloadDetails.aspx?DownloadID=59185">http://connect.microsoft.com/site1164/Downloads/DownloadDetails.aspx?DownloadID=59185</a>. Make sure you can access your Azure AD subscription using Azure PowerShell CmdLets (its Management certificate must be installed on your local machine and azure subscription should be set using set-azuresubscription).</li>
 	<li><strong>Azure blob storage container</strong> configured to receive the VM image you're trying to upload. Sounds scary, but it's pretty easy to do. Just do this to create a storage account and blob container (ignore the SQL parts and pieces, you don’t need those for this): <a href="https://msdn.microsoft.com/en-us/library/dn466439(v=sql.120).aspx">https://msdn.microsoft.com/library/dn466439(v=sql.120).aspx</a>. Make sure your Azure storage account is in the same subscription and region as the future VM(s).</li>
</ul>
<strong>Create the VM</strong>

Time to get to work. Create a virtual machine in Hyper-V just like you always do except:
<ul>
 	<li><strong>Do not connect it to the internet</strong> while customizing the VM. Windows 10 connects to the internet and starts running system updates and app installs when setup starts up. You don’t want that to happen while prepping the image.</li>
 	<li><strong>Make the hard drive file a .VHD </strong>and not a .VHDX. VHDX files are not supported in Azure.</li>
 	<li><strong>Try to keep the VM small</strong>, but not too small. You’ll be uploading this VM to Azure so unless you just like to watch the upload script run for a <em>very</em> long time, try to keep the .VHD as small as possible.
<strong>
Pro tip:</strong> Office 365 requires at least 3GB of free disk space to install. And it also turns out that 9GB is too small for both Windows 10 and Office 365...says the guy who uploaded a 9GB VHD. Argh. I'd recommend going for a minimum of at least 10GB for a standard Win10 machine and at least 15GB if you’ll use Office 365 too. You don't need to upload a 120GB+ VHD file, but you also don't want be this guy at the end of all this (*&amp;$*#&amp;!):<a href="https://msdnshared.blob.core.windows.net/media/2016/11/spaceError-e1478110670416.png"></a></li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2016/11/spaceError-e1478110670416.png"><img width="600" height="344" class="aligncenter wp-image-475 size-full" alt="Not enough disk space!" src="https://msdnshared.blob.core.windows.net/media/2016/11/spaceError-e1478110670416.png" /></a>

<strong>Prepare the VM (aka sysprep)</strong>

Now that you have a functioning Windows 10 VM running in Hyper-V, you can customize it to your heart’s content. Feel free to add files that you want present on all VMs you create in Azure and do whatever other settings customizations you feel compelled to do. When you’re finished, you need to use our old friend <a href="https://msdn.microsoft.com/windows/hardware/commercialize/manufacture/desktop/sysprep--system-preparation--overview">sysprep.exe</a> to generalize the image so that it can be uploaded.

It’s easy to do, just run this command when you’re ready to close shop on customizing the image:

<strong>          C:\Windows\system32\sysprep\sysprep.exe /generalize /oobe /shutdown</strong>

Sysprep will do its thing and shut down the VM. Don’t start the VM again as it’s now ready to be uploaded to Azure. Too easy right?

<strong>Get to work with PowerShell</strong>

As previously mentioned, you’ll need to meet the Azure PowerShell prerequisites so we’ll just assume you now have the Azure AD cmdlets installed and you’ve connected successfully to your Azure subscription. All that is left do now is to run two cmdlets and wait a while for the upload to finish. There are two things you’ll need to know before running the script though: where your .VHD file is and the URL to your storage container.
<ul>
 	<li>By default the .VHD will probably be somewhere like <em>C:\Users\Public\Documents\Hyper-V\Virtual hard disks\&lt;name of your VHD&gt;</em>. I usually copy that file to somewhere easier to find and also to be sure that I maintain a backup of the sysprepped image.</li>
 	<li>The url to your storage container…you did create one earlier while addressing the prereqs right?...is easy to figure out. Just log into Azure and navigate to the storage account and blob container that you want the VM to eventually end up in. Now, just copy the URL:<a href="https://msdnshared.blob.core.windows.net/media/2016/11/findURL1.png"><img width="600" height="214" class="aligncenter size-full wp-image-565" alt="findurl" src="https://msdnshared.blob.core.windows.net/media/2016/11/findURL1.png" /></a></li>
</ul>
Armed with these two pieces of information, you’re now ready to run the PowerShell cmdlets to upload your custom VM to Azure (Add-AzureVhd) and create a custom image to use when creating an Azure VM (Add-AsureVMImage). Open up PowerShell ISE and run these commands:

<span style="color: red">$src </span> = <span style="color: firebrick">&lt;path to your .VHD&gt;</span>
<span style="color: red">$dst </span> = <span style="color: firebrick">&lt;path to your blob storage container&gt;/&lt;.VHD file name&gt;</span>
<span style="color: red">$img </span> = <span style="color: firebrick">&lt;image name you want to use&gt;</span>
<span style="color: red">$dsc </span> = <span style="color: firebrick"> &lt;description for the image you are uploading&gt;</span>
<span style="color: blue">Add-AzureVhd -LocalFilePath</span> <span style="color: red">$src</span> <span style="color: blue"> -Destination</span><span style="color: red"> $dst</span> <span style="color: blue"> -NumberOfUploaderThreads</span> <span style="color: purple"> 10 </span>
<span style="color: blue">Add-AzureVMImage -ImageName</span> <span style="color: red">$img </span> <span style="color: blue">-MediaLocation </span><span style="color: red">$dst</span> <span style="color: blue">-Label </span><span style="color: red">$dsc </span> <span style="color: blue">-OS </span><span style="color: purple"> Windows </span><span style="color: blue">-Description </span><span style="color: red">$dsc</span>

It should look something like this when you run the script:

<a href="https://msdnshared.blob.core.windows.net/media/2016/11/ps1.png"><img width="600" height="335" class="aligncenter size-full wp-image-515" alt="ps1" src="https://msdnshared.blob.core.windows.net/media/2016/11/ps1.png" /></a>

Now just sit back to enjoy the show. Actually, now would be a good time to go grab a coffee and a snack. It’s going to be a while.  Go ahead, take an early lunch, you deserve it anyway.

OK, back to work. With the script finished doing its thing you can close PowerShell ISE and go check that your VM image VHD has been successfully uploaded to Azure storage like so:

<a href="https://msdnshared.blob.core.windows.net/media/2016/11/inStorage1.png"><img width="600" height="217" class="aligncenter size-full wp-image-585" alt="instorage1" src="https://msdnshared.blob.core.windows.net/media/2016/11/inStorage1.png" /></a>

<strong>Create a new Azure VM</strong>

All that’s left to do now is to create a VM like you always do in Azure—with one exception. When creating the VM, you will need to select an operating system from your “MY IMAGES” list, which should now contain your custom VHD image. Tada!

<a href="https://msdnshared.blob.core.windows.net/media/2016/11/galleryImage.png"><img width="600" height="380" class="aligncenter size-full wp-image-525" alt="galleryimage" src="https://msdnshared.blob.core.windows.net/media/2016/11/galleryImage.png" /></a>

Create the VM, log in and you might notice the VM completing Start Menu app installations and finishing setup. Done:

<a href="https://msdnshared.blob.core.windows.net/media/2016/11/startedVM.png"><img width="600" height="375" class="aligncenter size-full wp-image-545" alt="startedvm" src="https://msdnshared.blob.core.windows.net/media/2016/11/startedVM.png" /></a>

<strong>Where do you go from here?</strong>

Luckily (for you, not me who just discovered this as I was wrapping up the blog post!), Cynthia has done a great job documenting this process here: <a href="https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-classic-createupload-vhd/">https://azure.microsoft.com/documentation/articles/virtual-machines-windows-classic-createupload-vhd/</a> so there’s another reference for you if you get stuck.

I’ve blogged this process in the hopes that the information will help you to upload your own custom VM images to Azure, but unfortunately I can’t scale to provide tech support for everyone who reads this. So, I hope this information helps you, but use at your own risk, your mileage may vary, etc. etc. etc.

<hr />

You’ve seen my blog; want to follow me on Twitter too? <a href="http://twitter.com/jeffgilb">@JeffGilb</a>.]]></content:encoded>
    </item>
    <item>
      <title>Stay informed about Intune service updates</title>
      <link>https://docs.microsoft.com/archive/blogs/jeffgilb/stay-informed-about-intune-service-updates</link>
      <pubDate>Mon, 17 Oct 2016 09:59:37 GMT</pubDate>
      <dc:creator><![CDATA[Jeff Gilbert [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jeffgilb/?p=356</guid>
      <description><![CDATA[For a long time Intune admins have been logging into the Intune service dashboard at...]]></description>
      <content:encoded><![CDATA[For a long time Intune admins have been logging into the Intune service dashboard at <a href="https://status.manage.microsoft.com/">https://status.manage.microsoft.com/</a> to check on the status of their service. From there, you could easily review maintenance window timeframes and know when updates to the service are going to be applied. Of course doing this meant that you had to remember multiple portals and websites to help manage your Intune tenant along with all your other cloud services. In response to feedback to make getting to this information simpler, the Intune status information was moved to the Message Center of the <a href="https://portal.office.com/Admin/Default.aspx">Office 365 Admin portal</a> back in late April of this year. Now that the service updates have started showing up in this new location, the old Intune service dashboard is being retired. With these changes there are now a few ways to find information about the health of your Intune tenant and about when updates are going to be applied. I'll show you how in this post.

<strong>Service health</strong>

Having some issues with the Intune service and wondering if it’s something you are doing or if the service is has gone temporarily wonky? Just log into the Office 365 Admin Portal, expand the Health node, and select Service Health as shown below. If there is a known issue about the Intune service, you’ll be able to learn more about it from here.

<a href="https://msdnshared.blob.core.windows.net/media/2016/10/health.png"><img width="300" height="203" class="aligncenter size-medium wp-image-425" alt="health" src="https://msdnshared.blob.core.windows.net/media/2016/10/health-300x203.png" /></a>

<strong>Service updates</strong>

If you are wondering when your tenant will have the latest feature updates applied, just click down one level in the navigation pane to select Message center. Review the various messages here for Intune and look for the “Plan for change” or “Stay informed” messages for the Microsoft Intune service. These will keep you in the loop on upcoming changes that might affect you, such as updates to the Intune Company Portal app, and give you a maintenance window for when one of the regular service updates will be applied to your tenant. You can see what it looks like in this screen shot:

<a href="https://msdnshared.blob.core.windows.net/media/2016/10/messageCenter.png"><img width="300" height="204" class="aligncenter size-medium wp-image-405" alt="messageCenter" src="https://msdnshared.blob.core.windows.net/media/2016/10/messageCenter-300x204.png" /></a>

<strong>Tip:</strong> to learn about what feature updates are going to be applied, just click on the Additional information link from the message contents. That will take you to the Intune What’s New information to get a deeper understanding of the new capabilities soon to be at your fingertips. That article is updated each month so go ahead and bookmark it now for later reference: <a href="https://docs.microsoft.com/en-us/intune/whats-new/whats-new-in-microsoft-intune">https://docs.microsoft.com/intune/whats-new/whats-new-in-microsoft-intune</a>.

<strong>Other ways to stay informed</strong>

Now you know how to access the Office 365 Admin Portal’s message center to learn about service health or updates, but what if you aren’t near a computer? Just use the Office 365 Admin mobile app! Using that you can easily review messages that affect you:

<a href="https://msdnshared.blob.core.windows.net/media/2016/10/adminApp.png"><img width="300" height="267" class="aligncenter size-medium wp-image-415" alt="adminApp" src="https://msdnshared.blob.core.windows.net/media/2016/10/adminApp-300x267.png" /></a>

What makes this app even better is that in addition to reviewing service health and change notifications, you can also actually do some service management using it. You can add users, reset passwords, and even assign licenses. Having a problem and need to open or review an existing service ticket? You can do that on the go with the app too! You can learn more and <a href="https://support.office.com/en-us/article/Office-365-Admin-Mobile-App-e16f6421-2a1a-4142-bf9d-9846600a060a?ui=en-US&amp;rs=en-US&amp;ad=UShttps://support.office.com/en-us/article/Office-365-Admin-Mobile-App-e16f6421-2a1a-4142-bf9d-9846600a060a">download the app from here</a>.

Finally, you can take custom service notifications to the next level using the Office 365 Service Communications API. Leveraging this API enables you to develop your own internal dashboards and reports without the need to visit the actual Office 365 Admin Portal. You can <a href="https://msdn.microsoft.com/EN-US/library/office/dn707386.aspx">learn more about the Office 365 Service Communications API here</a>.

And now you know how to stay informed about Intune service updates.

I hope this helps! ~Jeff

<hr />

You’ve seen my blog; want to follow me on Twitter too? <a href="http://twitter.com/jeffgilb">@JeffGilb</a>.]]></content:encoded>
    </item>
  </channel>
</rss>