A New Role with Microsoft Graph Team

For the past ~9 years I have had the personal and professional pleasure to be a Premier Field Engineer (PFE) with Microsoft. I love the passion and knowledge that my peers and I share on a daily basis with our customers and each other. Recently though an opportunity opened up that I couldn’t say no to.

Starting May 26th I am joining the Microsoft Graph team as a Sr. Customer & Partner Experience (CPX) PM. This is an entirely new role for the team and I will be the first member. I’m looking forward to the new opportunities and working with amazing teammates, many of whom I’ve worked with on side projects for the past 1-2 years.

I plan to continue writing content for my personal blog at least every other month, but you may see more Microsoft Graph related content or cross postings on the Microsoft Graph Blog. Considering that my highest viewed posts in the past few years have been Microsoft Graph related that may not be much of a change though ūüėČ. I’ll also be more active on the newly released Microsoft Q&A site as well as Stack Overflow under the “microsoft-graph” tag.

Thanks to everyone who has helped and encouraged me in my growth with Microsoft Graph. Special thanks to Jeremy Thake, Yina Arenas, Jason Johnston, Darrel Miller, Vincent Biret, Gavin Barron, Srinivas Varukala, and many more.

-Frog Out

How I Develop Locally With GitHub and Azure DevOps Repos

A peer of mine recently asked about how I manage local code (projects, solutions, Git repos, etc.) that may or may not be synced to a cloud repository (GitHub, Azure DevOps, etc.)¬† Since I previously blogged about How I Blog – Updated 2018 and I’m a fan of re-using how many keys I have left I thought I would share my personal local development process.

 

Disclaimer

I like to to tell people that “I play a developer on TV”, meaning it has been at least 10 years since I’ve written code as a consultant that was actually deployed to a production system.¬† Sure I’ve written (or collaborated on) many samples (ex. .Net Core console sample for Microsoft Graph) and proof of concepts for customers these past 10 years, but it wasn’t the primary focus of my job.¬† So balance everything that I share with what others such as my friend Steve Smith (@Ardalis) share on his Weekly Dev Tips blog and podcast.

 

Local Folder Structure

Currently I develop on Windows so folders and paths will reflect that.¬† I don’t use the default folder that any of the IDEs or tools below use (generally under my user profile folder such as “c:\Users\[username]\…”).¬† Instead I create a new folder called Projects at the root of my primary drive (i.e. “c:\Projects”).¬† Below that folder I then have the following:

  • c:\Projects\_DevOps
  • c:\Projects\_GitHub
  • (All other local-only projects, ex. c:\Projects\localProject1)

Using the underscore for _DevOps and _GitHub means that those folders should be easy to find at the top of this folder structure even if I happen to inadvertently sort the folder.

As for project folders, I’ve thought about subdividing based on topic (ex. SharePoint Online, Azure, Microsoft Graph, etc.) or technology (ex. ASP.NET Core, Blazor, Console, etc.) but since I rarely have a large number of folders I haven’t done anything yet.¬† I do name my folders and projects based on topic though (ex. BTJ.SPO.ProjectName, BTJ.AZ.ProjectName, BTJ.MG.ProjectName, etc.)¬† This helps at least group together similar projects.

 

Git / GitHub / Azure DevOps Tools

I use a mix of the following tools to sync my repos and monitor issues or pull requests.

  • Visual Studio Code (VS Code) – VS Code has integrated supported in-box for Git.¬† I use this for committing and pushing code to my GitHub repositories.
  • Azure Repos Extension for Visual Studio Code – There is an extension for VS Code that adds additional functionality (ex. monitor builds, pull requests, and more) directly into VS Code.

  • GitHub Desktop client – GitHub offers a desktop client that allows you to sync code, create branches, review commit history, and more.¬† When I’m not directly in VS Code working on a repo I generally use GitHub Desktop.
  • Visual Studio Team Explorer – In general I start most projects in VS Code these days.¬† For the projects I do work in Visual Studio 2019 (ex. Blazor and some ASP.NET Core) I use the Team Explorer functionality (now available out of the box) to sync repos.¬† The integration with Azure DevOps and GitHub is good as well.
  • GitHub mobile app – I do submit and review a GitHub issues or pull requests on an infrequent basis.¬† When I am not at my desk I tend to use the newly released mobile app for GitHub.
  • Browser based pull requests – Some repositories that I collaborate on are very large and not well suited to sync locally (ex. Azure docs, Microsoft Graph docs, etc.)¬† For these I prefer submitting a pull request directly in the browser.¬† I previously blogged about this at How to Edit Microsoft Documentation on GitHub.

 

Conclusion

I hope you have found something useful in this post.  Please share your own suggestions or recommended tools / processes in the comments below.  Happy coding!

-Frog Out

Find Azure AD Error Descriptions

 

Recently I was working with a customer to troubleshoot Azure AD authentication errors logging into a custom application.¬† I knew that there is a support page for Azure AD Authentication and authorization error codes, but as the article points out “[e]rror codes and messages are subject to change”.¬† More interestingly they also linked to a page where you can get current information on error codes: https://login.microsoftonline.com/error.

 

Sample response:

AADErrorCodes1

 

Programmatic Response

If you would like to programmatically retrieve the output you can pass in the code…:

  1. as a query string parameter
  2. as a form-data submission on the body of the request.

See the sample screenshot below.  Only one option is necessary.

AADErrorCodes2

As you may notice, the response after submission is an HTML response and not JSON, XML, or another text format.  If you would like to see alternate output formats please upvote this Azure feedback suggestion to add JSON support.

Error details website – JSON support
https://feedback.azure.com/forums/169401-azure-active-directory/suggestions/40310266-error-details-website-json-support

 

Conclusion

In this post I showed a quick tip on how to retrieve current information on Azure AD authentication / authorization error codes.  Additionally you can retrieve it programmatically if needed as well as a feedback suggestion to upvote for additional output formats.  Hopefully this can help save you time troubleshooting scenarios should you need it.

-Frog Out

Webcast for DeVry University: Careers in Technology – Jan 2020

During the current period of uncertainty (related to COVID-19) for students of all ages I wanted to share a webcast I recently presented on “Careers in Technology”.¬† In January 2020 my neighbor (and fellow board game enthusiast) Prof. Gina Cooper, PhD invited me to talk with one of her online classes she teaches at DeVry University.¬† She has been asking me to present for a few years now so this was long overdue.¬† The students are in her 100-level Python programming class so I this is tailored to college (university or higher education if you are outside the US) students but the topics could apply to any level of school.

Below is the recording of this webcast.¬† Note that there are covered up portions of the screen recording to protect the privacy / faces of any students.¬† Thanks to the DeVry staff for providing this recording and the opportunity to present.¬† If you have any additional tips for students entering into their careers please share in the comments and I’ll incorporate if I present this session again.

Link to video: https://vimeo.com/403268529

 

-Frog Out

Newsletter #6 – Positivity through uncertainty

Note: today’s topic touches on the current COVID-19 pandemic.¬† While this has not directly impacted my own family’s life I know it has impacted many other families and individuals.¬† I write this post as the spouse of a medical professional and father of a family of 3 young children.¬† I do not trivialize what others are going through.¬† My hope is to share a light to others who are in darkness / uncertainty to find their way through this time.

TinyLetter-6-1

 

 

Positivity through uncertainty

During times of crisis like this COVID-19 (Coronavirus) pandemic there are many ways to react to our current situation.  Some people fall into despair while others step up to become leaders and survivors.  While it may feel like we have no control over how we react we can actually influence ourselves in certain ways.

Awhile back on Twitter a friend shared  found an interesting article about Science Proves That Gratitude Is Key to Well-Being.  The article describes how gratitude is linked to happiness and well-being.

“A¬†2003 study¬†compared the well-being of participants who kept a weekly list of things they were grateful for to participants who kept a list of things that irritated them or neutral things. The researchers showed that the¬†gratitude-focused participants exhibited increased well-being and they concluded that ‚Äúa conscious focus on blessings may have emotional and interpersonal benefits.”

I’ve written about¬†How I Do A Personal Monthly¬†Retrospective.¬† No matter how good or bad my week or month has been, I find that I am in a much better state of mind after I do my retrospectives.¬† Much of that has to do with the fact that every single time (and I’ve gone back to verify) I write¬†down more positives than negatives.¬† Over time this focus on the positives will lead you be more positive in general and others will also start to notice.

While this current time of COVID-19 pandemic, social distancing, and uncertainty in our daily lives can be difficult, try to focus on the positives in your life.  Daily or weekly write down at least 1-2 things that are going well in your life or the lives of others around you.  We will get through this and being in a positive state of mind will help.

What things are you thankful for?  I honestly would like to hear back from you in reply or comments.

P.S. I’m thankful I celebrated my birthday this morning¬†with my wife and kids at home and virtually with my family through video chat later tonight.

-Frog Out

Searching for Truncated Files in GitHub Folder

I’m sharing out this tip as I ran into this scenario recently.¬† If you are ever browsing through the GitHub website for files in a repo folder but get the warning “Sorry we had to truncate this directory… files were omitted from the list.” then this post may help.

 

Solution

I was recently browsing the Microsoft Graph .Net SDK repo through the GitHub website looking for the various Message functions.¬† Unfortunately the folder I was browsing has 6,000+ files and only the first 1,000 files are displayed (see highlighted box in following screenshot).¬† The first step in the solution is to click the “Find file” button in the upper right.

TruncatedFilesGHFolder1

 

On the following screen I typed “message” to filter the results for any files starting with that keyword.¬† Now I found the file I was looking for, “../MessageRequest.cs”.

TruncatedFilesGHFolder2

 

Conclusion

Looking back this may seem like an intuitive solution but I was stumped at first.  Hopefully this will help someone (or myself again) if they run into this.

-Frog Out

PowerShell Script to Create Office 365 Security and Compliance Center eDiscovery Case and Holds

This week my customer and a peer both asked for a sample PowerShell script to automate the creation of an Office 365 Security and Compliance Center eDisovery case, hold, and content search.  This post will share out that script and a few things to be aware of (ex. deprecating basic authentication) that are important.

Background

The below script accomplishes the following tasks:

  • Create a Security and Compliance Center eDiscovery case
  • Place an in-place hold on multiple users’ Exchange Online mailboxes
  • Create a content search within eDiscovery case for any folders named “Legal Hold” and the child folders under them

Important Note

As of the publish date (Mar 4th, 2020) the Security and Compliance Center remote PowerShell module relies on basic authentication.  The Exchange team has publicly shared that basic authentication for Exchange Online will be deprecated by Oct 2020.  As such that means the below script may not be usable in its current form in ~6 months.  When a replacement or update is available I will attempt to update this sample to reflect that.

Exchange Online deprecating Basic Authentication
https://support.microsoft.com/en-us/help/4521831/exchange-online-deprecating-basic-auth

In terms of the Exchange Online remote PowerShell module there is a v2 module being developed (active development, not ready for production) which you can find on the PowerShell Gallery.  This new module support OAuth authentication which resolves the issue of deprecated basic authentication.

ExchangeOnlineManagement module on PSGallery
https://www.powershellgallery.com/packages/ExchangeOnlineManagement

Solution

Before running this script, ensure that the account you log in with has the appropriate permissions to both Exchange Online as well as Security and Compliance Center.  My sample uses a single admin account but you may adapt the script to use separate accounts if needed.  See the following articles for more details.

Connect to Exchange Online PowerShell
https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps

Connect to Office 365 Security & Compliance Center PowerShell
https://docs.microsoft.com/en-us/powershell/exchange/office-365-scc/connect-to-scc-powershell/connect-to-scc-powershell?view=exchange-ps

Note: If you do not see the below Gist please refer to code at this location: EXO_New-SCCeDiscoveryCaseAndHold.ps1

Conclusion

In this post I shared a sample script for automating the creation of an Office 365 Security and Compliance Center eDiscovery case, hold, and folder scoped content search.  The folder scoping was an interesting detour as I had to track down the way to gather folder IDs from a product group engineer sample (linked in the above sample).  I hope you find this useful and good luck scripting.

-Frog Out