<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>SoftwareSimian</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/softwaresimian/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/softwaresimian/feed.xml</link>
    <description />
    <lastBuildDate>Fri, 27 Oct 2017 17:08:50 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Finding free time in Office 365 via REST</title>
      <link>https://docs.microsoft.com/archive/blogs/softwaresimian/finding-free-time-in-office-365-via-rest</link>
      <pubDate>Fri, 27 Oct 2017 17:08:10 GMT</pubDate>
      <dc:creator><![CDATA[SoftwareSimian]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/softwaresimian/?p=725</guid>
      <description><![CDATA[Here is a two step tutorial of how you can find time in Office 365 calendars via REST...]]></description>
      <content:encoded><![CDATA[Here is a two step tutorial of how you can find time in Office 365 calendars via REST
<ol>
 	<li><a target="_blank" href="https://blogs.msdn.microsoft.com/softwaresimian/2017/10/05/using-postman-to-call-the-graph-api-using-azure-active-directory-aad/" rel="noopener noreferrer">https://blogs.msdn.microsoft.com/softwaresimian/2017/10/05/using-postman-to-call-the-graph-api-using-azure-active-directory-aad/</a></li>
 	<li><a target="_blank" href="https://blogs.msdn.microsoft.com/softwaresimian/2017/10/27/posting-messages-to-the-graph-api-from-microsoft-flow/" rel="noopener noreferrer">https://blogs.msdn.microsoft.com/softwaresimian/2017/10/27/posting-messages-to-the-graph-api-from-microsoft-flow/</a></li>
</ol>
Enjoy]]></content:encoded>
    </item>
    <item>
      <title>Posting messages to the Graph API from Microsoft Flow</title>
      <link>https://docs.microsoft.com/archive/blogs/softwaresimian/posting-messages-to-the-graph-api-from-microsoft-flow</link>
      <pubDate>Fri, 27 Oct 2017 17:05:25 GMT</pubDate>
      <dc:creator><![CDATA[SoftwareSimian]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/softwaresimian/?p=616</guid>
      <description><![CDATA[I needed to POST a message to Microsoft's Graph API in order to find meeting slots in a calendar...]]></description>
      <content:encoded><![CDATA[I needed to POST a message to Microsoft's <a href="https://developer.microsoft.com/en-us/graph">Graph API </a>in order to find meeting slots in a calendar within my organisation. I wanted this wrapped in an API so that I could call it from Cortana. Read my previous post about how I got this working from Postman as this will cover off the Azure Active Directory pre-requisite. (<a target="_blank" href="https://blogs.msdn.microsoft.com/softwaresimian/2017/10/05/using-postman-to-call-the-graph-api-using-azure-active-directory-aad/" rel="noopener noreferrer">https://blogs.msdn.microsoft.com/softwaresimian/2017/10/05/using-postman-to-call-the-graph-api-using-azure-active-directory-aad/</a>)

I first looked at Flow as it had the following Action, it looked great as I could log into an Active Directory resource and call the API with delegated authority and then expose that as an API for Cortana to call without having to authenticate.
<a href="https://msdnshared.blob.core.windows.net/media/2017/10/Http-with-Azure-AD.png"><img width="1024" height="614" class="size-large wp-image-655 aligncenter" alt="Http with Azure AD" src="https://msdnshared.blob.core.windows.net/media/2017/10/Http-with-Azure-AD-1024x614.png" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/CustomConnectors.png"><img width="239" height="252" class=" wp-image-646 alignright" alt="Create Custom Connector" src="https://msdnshared.blob.core.windows.net/media/2017/10/CustomConnectors.png" /></a>However, this first party <strong>action</strong> only allows you to use the GET verb whilst authenticating with an Azure Active Directory secured resource. However, Flow allows you to create your own <a href="https://flow.microsoft.com/en-us/documentation/register-custom-api/">Custom Connectors</a>. From the previous <a target="_blank" href="https://blogs.msdn.microsoft.com/softwaresimian/2017/10/05/using-postman-to-call-the-graph-api-using-azure-active-directory-aad/" rel="noopener noreferrer">blog</a> you would have a POST message to the Graph API from Postman which you can create a Postman Collection with your working method call and then export it is a V1 Postman Collection. You will need this to create a Custom Connector in Flow without a Swagger file.
Log in to flow and then click the Cog in the top right corner and select Custom Connector.

<img width="367" height="322" class="wp-image-635 alignleft" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/CreateCustomConnector.png" />

&nbsp;

&nbsp;

The Graph API does not provide a Swagger File for the API's that are exposed, however you can use a Postman Collection to do that for you.

&nbsp;

&nbsp;

&nbsp;

<img width="558" height="256" class="wp-image-636 alignright" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/CreateCustomConnector2-1024x470.png" />

&nbsp;

&nbsp;

&nbsp;

Once you have imported your V1 Postman Collection into Flow, it will appear as generatedApiDefinition.swagger.json.

&nbsp;

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/General.png"><img width="626" height="531" class="wp-image-645 alignleft" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/General-1024x869.png" />
</a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/Security.png"><img width="521" height="474" class="wp-image-695 alignright" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/Security-1024x932.png" /></a>

&nbsp;

&nbsp;

On the first tab called General, you will notice that it has pulled in the resource Url that was defined in your Postman Collection and populated this in the Host. Give your API an icon and a useful description if you want to change it from what is pulled in from Postman. Click Continue

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

The second tab is Security, where you will have to fill in your Application ID (Client id) from the previous blog and your secret. This means the Flow will run with the permissions defined in that application. You will also have to fill in the ResourceURL which is https://outlook.office.com, all the other values can be default.<a href="https://msdnshared.blob.core.windows.net/media/2017/10/Security.png"></a>

The third tab is where we define the message that we are going to send, skip over this for the time being and go to the Test tab to check everything is working. It will ask you to "Create Connector", go ahead and do this.

After you have created the connector, it would have registered this in flow; now go back to the second tab "Security", you will notice that it has now supplied you with a RedirectURL, copy this

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/RedirectURL.png"><img width="1024" height="120" class="alignnone size-large wp-image-675" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/RedirectURL-1024x120.png" /></a>

And then go back into your "App Registration" in the Azure portal and allow your application to be called from this URL. The Azure Portal calls these "Reply URLs"

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/ReplyUrls.png"><img width="1024" height="332" class="alignnone size-large wp-image-685" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/ReplyUrls-1024x332.png" /></a>

Go back to the last "Test" tab and click the "+ New Connection", if everything is wired up correctly with Azure Active Directory, Office 365 and Flow, then you should see your mail box appear in the box above the "+ New Connection" button. If not, there is something wrong with your AAD Application.
<a href="https://msdnshared.blob.core.windows.net/media/2017/10/TestConnectionAuth.png"><img width="1024" height="519" class="alignnone size-large wp-image-705" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/TestConnectionAuth-1024x519.png" /></a>

Let's just send a payload to Office 365 and see if we get a response. For the time being use Raw Body and paste in the test message that you used in Postman to get it working. Hopefully you should get a valid response back. If you don't, then go back and check in Postman if everything is working. If you get a message back, then the Custom Connector is ready to be used in your Flow.

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/SampleFlow.png"><img width="669" height="452" class="alignnone  wp-image-715" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/SampleFlow-1024x691.png" /></a>

Here you can see that the Custom Connector is represented above with the dog icon. The trigger fires when a json message is sent to it, the second and third <strong>actions</strong> are there to transform the json into the correct shape. Here's a screen shot of the main parts of the flow.<a href="https://msdnshared.blob.core.windows.net/media/2017/10/FullFlow.png"><img width="635" height="1024" class="alignnone size-large wp-image-717" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/FullFlow-635x1024.png" /></a>

So in summary you have seen how we can take a message for the Graph API and host it in Flow and post messages to the Graph API with delegated authority.]]></content:encoded>
    </item>
    <item>
      <title>Using Postman to call the Graph API using Azure Active Directory (AAD)</title>
      <link>https://docs.microsoft.com/archive/blogs/softwaresimian/using-postman-to-call-the-graph-api-using-azure-active-directory-aad</link>
      <pubDate>Thu, 05 Oct 2017 23:04:19 GMT</pubDate>
      <dc:creator><![CDATA[SoftwareSimian]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/softwaresimian/?p=526</guid>
      <description><![CDATA[I needed a mechanism to be able to call an API that would find free time in my calendar. I looked at...]]></description>
      <content:encoded><![CDATA[<span>I needed a mechanism to be able to call an API that would find free time in my calendar. I looked at Flow and Logic Apps and all the only </span><b>Actions</b><span> I could find were the ability to be able to see existing entries in a calendar. However, if you look in the Graph API, the API I need is there. Unfortunately, you cannot use the excellent </span><a href="https://developer.microsoft.com/en-us/graph/graph-explorer"><span>https://developer.microsoft.com/en-us/graph/graph-explorer</span></a><span> to POST to this API as I am not allowed to set the permissions "</span><span>Calendars.Read.Shared, Calendars.ReadWrite.Shared" as detailed in the documentation here. </span><a href="https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/user_findmeetingtimes"><span>https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/user_findmeetingtimes</span></a><span>. </span><span>This blog post is how you can call it from Postman authorising over Azure Active Directory because it does not work in the Explorer. I'm sure that this will become useful for loads of people who want to call API's that are secured by Azure Active Directory.</span>
<h2>Step 1 - Register an Application in Azure Active Directory</h2>
<a href="https://msdnshared.blob.core.windows.net/media/2017/10/AppRegistrations.png"><img width="522" height="101" class="size-full wp-image-536 alignleft" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/AppRegistrations.png" /><span>I</span></a>f we have an application that is linked to the Azure Active Directory, then I can set the permissions that I need for that application to call the API I need. So first, go to the <a href="https://portal.azure.com">https://portal.azure.com</a> and  find "App Registrations". Then click the "New application registration" button at the top of the blade. Give the application a <b>Name</b>, chose a <b>Web  app / API</b> and then the app needs a <b>Sign-on URL</b> which can be anything, as the app doesn't actually exist. Once you have created it, it will look something like this.

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/CreateAppRegistration.png"><img width="1010" height="471" class="alignnone size-full wp-image-547" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/CreateAppRegistration.png" /></a>

&nbsp;

<span>Next, let's </span><b>add</b><span> the </span><b>Required permissions</b><span> and select the "Microsoft Graph" and chose the required permissions as defined in the documentation, in this case "</span><span>Calendars.Read.Shared, Calendars.ReadWrite.Shared". </span>

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/GraphPermissions.png"><img width="984" height="336" class="alignnone size-full wp-image-576" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/GraphPermissions.png" /></a>

<span>Once you have the permissions set, just click the</span><b> Grant permissions</b><span> button to ensure that this application has the permission scope to call the Graph.</span>

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/GrantPermissions.png"><img width="1024" height="422" class="alignnone size-large wp-image-566" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/GrantPermissions-1024x422.png" /></a>

Once you have added the permissions, we need to have a <b>Key</b> in the application which is often referred to as the "Secret". Give it any old name. Keep the value that is generated safe as we need this later.

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/Key.png"><img width="841" height="340" class="alignnone size-full wp-image-586" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/Key.png" /></a>

<span>The last thing we need to add is a </span><b>Reply Url</b><span> of </span><a href="https://www.getpostman.com/oauth2/callback"><span>https://www.getpostman.com/oauth2/callback</span></a><span> so that we can get our token.</span>
<h2>Step 2 - Get a New Access Token in Postman</h2>
Now, we go back to Postman and we create a new tab and we need to <b>Get a New Access Token</b>. We will have to use the values that we just create in our AD application

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/GetNewAccessToken.png"><img width="1024" height="382" class="alignnone size-large wp-image-555" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/GetNewAccessToken-1024x382.png" /></a>

Here is a table of the fields you need.
<table>
<tbody>
<tr>
<td><b>Postman Field</b></td>
<td><b>Azure Property</b></td>
<td><b>Value / Comments</b></td>
</tr>
<tr>
<td>Token Name</td>
<td></td>
<td>A friendly name for your token, this is not used</td>
</tr>
<tr>
<td>Auth Url</td>
<td></td>
<td><a href="https://login.windows.net/common/oauth2/authorize?resource=https://outlook.office.com">https://login.windows.net/common/oauth2/authorize?resource=https://outlook.office.com</a> (notice the resource at the end of the url)</td>
</tr>
<tr>
<td>Access Token Url</td>
<td></td>
<td><a href="https://login.microsoftonline.com/common/oauth2/token">https://login.microsoftonline.com/common/oauth2/token</a></td>
</tr>
<tr>
<td>Client ID</td>
<td>Application ID</td>
<td>This was created automatically when you registered the app in AD</td>
</tr>
<tr>
<td>Client Secret</td>
<td>Key</td>
<td>This was the Key you created and kept safe</td>
</tr>
</tbody>
</table>
&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/GetNewAccessToken2.png"><img width="831" height="1024" class="alignnone size-large wp-image-565" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/GetNewAccessToken2-831x1024.png" /></a>

Once you click the Request Token, this will take you to your app, with the standard Organisational login page. If you use a Windows Hello or PIN to log in, THIS WILL NOT WORK. Instead choose username and password and phone authentication if necessary. PIN does not work here. I wasted a day on this - save yourself the pain!

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/AuthHeader.png"><img width="1024" height="170" class="alignnone size-large wp-image-545" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/AuthHeader-1024x170.png" /></a>

So now you have all the tokens in Postman, you just chose "Add token to Headers" which will put the Bearer token in your request. Good luck. Next I am going to put this into Microsoft Flow.]]></content:encoded>
    </item>
    <item>
      <title>Service Fabric - Watchdog connector</title>
      <link>https://docs.microsoft.com/archive/blogs/softwaresimian/service-fabric-watchdog-connector</link>
      <pubDate>Mon, 18 Sep 2017 13:14:22 GMT</pubDate>
      <dc:creator><![CDATA[SoftwareSimian]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/softwaresimian/?p=445</guid>
      <description><![CDATA[I was helping a customer move an on premises solution into Service Fabric and they were very keen on...]]></description>
      <content:encoded><![CDATA[I was helping a customer move an on premises solution into Service Fabric and they were very keen on using Application Insights as the dashboard of the Application Health. They also had monitoring within their on-premises system that would periodically send a heartbeat to their services and report health. This sounded a perfect use case for using the <a target="_blank" href="https://azure.microsoft.com/en-us/resources/samples/service-fabric-watchdog-service/" rel="noopener noreferrer">Watchdog sample service</a>, which is an example of how your services could register an endpoint when they started with a stateful Watchdog Service running inside the cluster. The watchdog would then call that endpoint every 30 seconds and report 'Availability' via ETW and then Application Insights.

So let's walk through how we did it. For the sake of this post I have assumed that you have downloaded the sample watchdog from <a target="_blank" href="https://github.com/Azure-Samples/service-fabric-watchdog-service" rel="noopener noreferrer">here </a>and deployed it 'as-is' to your cluster. You can then access the watchdog inside the cluster via the Reverse Proxy on the following address: - https://localhost:19081/Watchdog/WatchdogService. You will notice that in the Visual Studio solution there are two test services; I have taken the pieces out of the test services that you need and placed them in a Nuget package so that you can consume them easily.

Next, we need to add a nuget package to the services that you want to watch. For completeness, the nuget package is available here (<a target="_blank" href="https://www.nuget.org/packages/ServiceFabric.Watchdog.Connector/" rel="noopener noreferrer">https://www.nuget.org/packages/ServiceFabric.Watchdog.Connector/</a>)

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/nuget.png"><img width="1024" height="305" class="alignnone size-large wp-image-455" alt="Add nuget package" src="https://msdnshared.blob.core.windows.net/media/2017/09/nuget-1024x305.png" /></a>

This will add a very small assembly to your service and the source code is available <a target="_blank" href="https://github.com/ross-p-smith/ServiceFabric.WatchDog.Connector" rel="noopener noreferrer">here</a> if you are interested. We will be using the same mechanism that Service Fabric uses tois Event Tracing for Windows (ETW) as the mechanism to trace, warn and error. You will have also notice that if you create a Service Fabric Service, the Visual Studio template will create a ServiceEventSource.cs. Edit the class that Visual Studio has created for you and derive from IServiceEventSource which is in the ServiceFabric.Helpers namespace, so add a using for it to.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/IServiceEventSource.png"><img width="1024" height="237" class="alignnone size-large wp-image-475" alt="IServiceEventSource" src="https://msdnshared.blob.core.windows.net/media/2017/09/IServiceEventSource-1024x237.png" /></a>

Then we will get rid of the clunky private constructor that allows you to call it from anywhere and allow this to be passed in via a DI container instead - all will become apparent later. So delete all the singleton constructor semantics, as below.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/EventDelete.png"><img width="1024" height="279" class="alignnone size-large wp-image-465" alt="Remove this constructor" src="https://msdnshared.blob.core.windows.net/media/2017/09/EventDelete-1024x279.png" /></a>

You will notice that you will need to implement two new methods that are defined in the interface, I place them after ServiceTraceEventId 6 (ServiceRequestStop) and they simply allow you to write generic Trace and Error events.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/NewService-Methods.png"><img width="1024" height="475" class="alignnone size-large wp-image-485" alt="Trace and Error" src="https://msdnshared.blob.core.windows.net/media/2017/09/NewService-Methods-1024x475.png" /></a>Let's compile it and fix up the errors. You should find the only compilation errors are because this class no longer implements the Singleton pattern anymore; i.e. it no longer has Current. You will find the first occurrence in the program flow is in the Main method within Program.cs, change the code to create an instance of ServiceEventSource() above the try block and use the object instance rather than a static. Also notice that I have passed the eventSource into the Stateful constructor.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/Main.png"><img width="1024" height="584" class="alignnone size-large wp-image-495" alt="Main method" src="https://msdnshared.blob.core.windows.net/media/2017/09/Main-1024x584.png" /></a>

The next error is in your service itself, it will be complaining about the missing Current too, change the constructor to be something like this and fix any code to use the private instance rather than the static. This will also fix the constructor arguments that you changed earlier.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/New-Constructor.png"><img width="1024" height="206" class="alignnone size-large wp-image-496" alt="Service constructor" src="https://msdnshared.blob.core.windows.net/media/2017/09/New-Constructor-1024x206.png" /></a>You should be able to get this to compile now. You will probably be thinking that you have lost your singleton EventSource, but if you were to go and amend your CreateServiceInstanceListeners method in your &lt;NameOfService&gt;.cs you will see that you can add the following line so that any service you write will have the EventSource injected in at the constructor level should you need it.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/RegisterSingleton.png"><img width="1024" height="148" class="alignnone size-large wp-image-505" alt="Register Singleton" src="https://msdnshared.blob.core.windows.net/media/2017/09/RegisterSingleton-1024x148.png" /></a>

To finish the ETW piece off, you can now add the following attribute [ServiceRequestActionFilter] to any controller and have it write an event every time it starts and stops. This would not have been possible unless we could inject in the instance of the EventSource.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/ControllerAttribute.png"><img width="727" height="201" class="alignnone size-full wp-image-515" alt="Controller Attribute" src="https://msdnshared.blob.core.windows.net/media/2017/09/ControllerAttribute.png" /></a>

We now have a pretty standard way of writing events, next is registering the service with the Watchdog so that it can call us. The easiest way to do this is to override the RunAsync method within your service like so.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/RunAsync.png"><img width="1024" height="520" class="alignnone size-large wp-image-516" alt="RunAsync" src="https://msdnshared.blob.core.windows.net/media/2017/09/RunAsync-1024x520.png" /></a>

The things to call out here are as follows
<ol>
 	<li>The first parameter of RegisterHealthCheckAsync is a unique name for the service that will appear as the Event name in Application Insights, the second parameter is the URI suffix that I want the watchdog to call</li>
 	<li>The first parameter of RegisterMetricsAsync is used to create a url for the metrics to be retrieved on and the boolean is to signify whether the service is stateful.</li>
</ol>
And that's it, you can see that you can register your services with the watchdog very easily and here is a little screen shot of what you could see in Application Insights if one of your services is having problems. I simulated this error by posting a manual Health Report to the system. Also worth noticing that the Watchdog itself is reporting its own availability too.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/AppInsights.png"><img width="892" height="565" class="alignnone size-full wp-image-517" alt="AppInsights" src="https://msdnshared.blob.core.windows.net/media/2017/09/AppInsights.png" /></a>

At this stage if you want a very in depth explanation of the Health Model, then take 20 minutes to read this: - <a target="_blank" href="https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-health-introduction" rel="noopener noreferrer">https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-health-introduction</a>

Enjoy!]]></content:encoded>
    </item>
    <item>
      <title>Best way to host Microsoft R Server in Azure</title>
      <link>https://docs.microsoft.com/archive/blogs/softwaresimian/best-way-to-host-microsoft-r-server-in-azure</link>
      <pubDate>Tue, 08 Aug 2017 19:54:57 GMT</pubDate>
      <dc:creator><![CDATA[SoftwareSimian]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/softwaresimian/?p=426</guid>
      <description><![CDATA[Today I was asked whether it was better to run Microsoft R Server on a Virtual Machine / Azure...]]></description>
      <content:encoded><![CDATA[<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">Today I was asked whether it was better to run Microsoft R Server on a Virtual Machine / Azure Container Instance or DevTest Labs. The requirement was for a 6 core 32Gb RAM for a developer image. My initial thought was to have a R Server created from the gallery and then use DevTest extension to automatically shut it down at 8pm if we had forgotten. So I set about seeing how this would work.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">DevTest labs allow base images to be created and have some access control around them, allow them to be auto shut down, and have extensions auto deployed on them. However, when looking in DevTest Lab, they was no Microsoft R Server base image, so one would have to be created as a custom image.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">Next I looked at creating a VM from the gallery and using the Auto Shut Down feature from DevTest Labs as an extension to a VM. This would provide a basic framework to have a powerful machine, that shuts down at the end of the day. This was relatively simple to provision and can be seen in the GitHub repo below.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">I wanted to see if this same option could be applied to the new Azure Container Instances (PREVIEW) as this would be a neat way of avoiding the Operating System choice. However, after investigation I found the following problems with Azure Container Instances as it is in Preview.</p>

<ul type="disc" style="margin-left: .375in;direction: ltr;margin-top: 0in;margin-bottom: 0in">
 	<li style="margin-top: 0;margin-bottom: 0;vertical-align: middle"><span style="font-family: Calibri;font-size: 11.0pt">Although UK South was available in the drop down list, it does not pass the validation when you deploy it</span></li>
 	<li style="margin-top: 0;margin-bottom: 0;vertical-align: middle"><span style="font-family: Calibri;font-size: 11.0pt">I could not go above 2 cores</span></li>
 	<li style="margin-top: 0;margin-bottom: 0;vertical-align: middle"><span style="font-family: Calibri;font-size: 11.0pt">I could not go above 4Gb RAM</span></li>
</ul>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-weight: bold">Summary</span></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">After this investigation, I would use a Virtual Machine if you want to provision a server powerful enough to run R Server. To deploy your R server, click the Deploy to Azure button in Option 1. (<a href="https://github.com/ross-p-smith/ARM-Examples#r-server-comparison">https://github.com/ross-p-smith/ARM-Examples#r-server-comparison</a>). This could change when Azure Container Instance is Generally Available. I will update this post when this happens.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">An alternative is to use the Data Science VM that has already been created with all the popular tools pre-installed.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><a href="https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-data-science-linux-dsvm-intro">https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-data-science-linux-dsvm-intro</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Relational Database to Cosmos DB</title>
      <link>https://docs.microsoft.com/archive/blogs/softwaresimian/relational-database-to-cosmos-db</link>
      <pubDate>Mon, 31 Jul 2017 16:47:06 GMT</pubDate>
      <dc:creator><![CDATA[SoftwareSimian]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/softwaresimian/?p=425</guid>
      <description><![CDATA[A customer fired off a few questions to me today regarding their move from on-premises SQL Server to...]]></description>
      <content:encoded><![CDATA[A customer fired off a few questions to me today regarding their move from on-premises SQL Server to Cosmos DB. I thought I would share those questions and answers.
<h3>How can we handle relational DBMS?</h3>
Cosmos DB is not a relational database. You cannot just take your relational database and expect it to run in Cosmos DB. You could move tables of data into Cosmos, but not the relational aspects of your existing data structures. If you are thinking of re-modelling your data as a set of documents rather than in a relational way, then you could use the DocumentDB model within Cosmos. I recommend this as a good read: -<a href="https://docs.microsoft.com/en-us/azure/architecture/guide/technology-choices/data-store-overview"> https://docs.microsoft.com/en-us/azure/architecture/guide/technology-choices/data-store-overview</a>
<h3>Does Cosmos Db have different data types?</h3>
Cosmos is a multi model database which means it supports Graph, Documents, Key-Values and Column-Family. The data types that are supported, if applicable, depend on the model you are using. Documents for instance use JSON, so will support all types supported in JSON.
<h3>Does it have any APIs to load data from different source systems like Excel, CSV, txt, XML etc. Or do we have to write our own importer?</h3>
Importing data for use with the Table API or Graph API is not supported at this time; however, there are a few mechanisms available to you, have a look here <a href="https://docs.microsoft.com/en-us/azure/cosmos-db/import-data">https://docs.microsoft.com/en-us/azure/cosmos-db/import-data</a>
<h3>Can we create store procedure or functions and schedule them as jobs to perform actions automatically?</h3>
DocumentDB does support stored procedures which are represented by server-side JavaScript as detailed here <a href="https://docs.microsoft.com/en-us/azure/cosmos-db/programming">https://docs.microsoft.com/en-us/azure/cosmos-db/programming</a>. For other database models, you could use Azure Functions (<a href="https://azure.microsoft.com/en-us/services/functions/">https://azure.microsoft.com/en-us/services/functions/</a>) in an event driven model or based of a schedule for a light-weight app. Alternatively you could build this tier in .Net or most popular programming languages using these Quick starts <a href="https://docs.microsoft.com/en-us/azure/cosmos-db/">https://docs.microsoft.com/en-us/azure/cosmos-db/</a>
<h3>How we can manage different type of security for example read only?</h3>
In addition to the two master keys for the Cosmos DB account, there are two read-only keys. These read-only keys only allow read operations on the account. Read-only keys do not provide access to read permissions resources. If you did not want to give out your keys, then you can create Users and grant Permissions to resources. Cosmos DB also encrypts your data at rest by default. (<a href="https://docs.microsoft.com/en-us/azure/cosmos-db/database-encryption-at-rest">https://docs.microsoft.com/en-us/azure/cosmos-db/database-encryption-at-rest</a>)
<h3>Can we create data views?</h3>
Using a NoSQL database normally means that you have denormalised your data, so I would need to see what you were using the View for to see if it is required
<h3>Can we create partitions to manage data?</h3>
Cosmos DB provides containers for storing data called collections (for document), graphs, or tables. Containers are logical resources and can span one or more physical partitions or servers. Partition management is fully managed by Azure Cosmos DB, and you do not have to write complex code or manage your partitions. Cosmos DB containers are unlimited in terms of storage and throughput.
<h3>How much data we can store in one JSON document?</h3>
I believe the current limit is around 2Mb per document, if you need more, there are some binary formats you can use, or you can have a master document with an array of child document id's.
<h3>If a part of data stored in JSON is not properly formatted, can we ready other data available in same JSON?</h3>
Using a client API, you should only be able to write valid JSON to Cosmos DB. The format of an attribute should not impact any query as long as it is a valid document.
<h3>How much data Cosmos DB can store?</h3>
At the moment, there are no upper limits of Cosmos DB, it is a global scale database in which throughput and storage can be scaled to handle whatever your application requires. If you have any questions about the scale, please send email to askdocdb@microsoft.com.

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Azure Service Fabric Application Insights working sample</title>
      <link>https://docs.microsoft.com/archive/blogs/softwaresimian/azure-service-fabric-application-insights-working-sample</link>
      <pubDate>Fri, 16 Jun 2017 20:52:25 GMT</pubDate>
      <dc:creator><![CDATA[SoftwareSimian]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/softwaresimian/?p=315</guid>
      <description><![CDATA[This simple post is going to walk through the very basics of getting trace events to appear in...]]></description>
      <content:encoded><![CDATA[This simple post is going to walk through the very basics of getting trace events to appear in Application Insights from Azure Service Fabric using EventFlow. First, let's discuss the options and the advantages and disadvantages of each. A sample application can be found here: - <a target="_blank" href="https://github.com/ross-p-smith/service-fabric-hot-telemetry">https://github.com/ross-p-smith/service-fabric-hot-telemetry</a>
<ol>
 	<li>Configure each service in the Service Fabric Application to directly push logs to Application Insights</li>
 	<li>Use EventFlow to listen for events as they occur and push these events to Application Insights</li>
 	<li>Configure Windows Azure Diagnostics on each node in the cluster to relay all events to Application Insights.</li>
</ol>
<h2><i>Scenario 1 : Direct Application Insights</i></h2>
[caption id="attachment_366" align="alignleft" width="300"]<a href="https://msdnshared.blob.core.windows.net/media/2017/06/AddInsights.png"><img width="300" height="96" class="wp-image-366 size-medium" alt="Add Application Insights" src="https://msdnshared.blob.core.windows.net/media/2017/06/AddInsights-300x96.png" /></a> Configure Application Insights[/caption]

This method is by far the easiest to setup. From Visual Studio, simply right click the service you would like insights from and <b>Configure Application Insights</b>. This will take you to a wizard that will create Application Insights in the cloud or connect to an existing one.

&nbsp;

<b>Advantages</b>: - Easiest way to get telemetry and if you are already using Application Insights, this is a no brainer.

<b>Disadvantages</b>: - This tightly couples your service to the output of the telemetry. What happens if you also want to send the events somewhere else.
<h2><i>Scenario 2: Using EventFlow</i></h2>
<a target="_blank" href="https://github.com/Azure/diagnostics-eventflow">EventFlow</a> provides a pluggable library so that Inputs and Outputs of telemetry information can be configured in a json file. This is a really nice solution as it does not tie you into a particular source or destination and allows multiple destinations to be configured based on severity or keywords. If you are using a .Net Core project, the json file unfortunately does not get created correctly when you add the EventFlow Nuget packages to your project, so I had to manually create this in the PackageRoot\Config location, which is very simple to do and is detailed at the GitHub page above.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/EventFlowBuildProperties.png"><img width="300" height="128" class="size-medium wp-image-375 alignnone" alt="EventFlow" src="https://msdnshared.blob.core.windows.net/media/2017/06/EventFlowBuildProperties-300x128.png" /></a><a href="https://msdnshared.blob.core.windows.net/media/2017/06/EventFlowConfig.png"><img width="300" height="56" class="size-medium wp-image-376 alignnone" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/EventFlowConfig-300x56.png" /></a>

After you add this file, make sure that you edit the properties of the file so that MSBuild does not make it a content file.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/EventFlowPackages.png"><img width="300" height="66" class="size-medium wp-image-396 alignright" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/EventFlowPackages-300x66.png" /></a>Here is a list of the Nuget packages I used to get this sample working; you can see that there are some mandatory libraries and then input/output libraries depending on your scenario. It is important to note that you must ensure that you add the right package if you include an input or output in your eventFlowConfig.json as if you don't you don't get a useful error message to tell you what you have missed.

[caption id="attachment_395" align="alignleft" width="300"]<a href="https://msdnshared.blob.core.windows.net/media/2017/06/config.png"><img width="300" height="168" class="wp-image-395" alt="Event Flow Config" src="https://msdnshared.blob.core.windows.net/media/2017/06/config-300x168.png" /></a> EventFlowConfig.json[/caption]

Once you have EventFlow added to your project, you just need to configure it; in this sample it is nice and simple. You will notice that I only placed one provider name as an input which should match the attribute that is defined in your ServiceEventSource.cs or ActorEventSource.cs. These classes are created when you create a new service using the template from within Visual Studio. You will notice that I did not include the standard "Microsoft-ServiceFabric-Services" provider name here, we will come back to this later.

&nbsp;

&nbsp;

It is normal that you will want to direct telemetry to different instances of ApplicationInsights for your dev / test and production, so we also need a mechanism to pass in this instrumentation key based on a deployment scenario. As you can see in the 'Output'above, I have created a setting that will hold that key, this is a special EventFlow syntax that relates to the Settings.xml in the PackageRoot\Config.

[caption id="attachment_405" align="alignright" width="300"]<a href="https://msdnshared.blob.core.windows.net/media/2017/06/Settings.png"><img width="300" height="61" class="size-medium wp-image-405" alt="Settings" src="https://msdnshared.blob.core.windows.net/media/2017/06/Settings-300x61.png" /></a> settings.xml[/caption]

You can see that I have left the 'Value' blank deliberately so that no hard coded value is checked in to source control. This will mean that we can update config separately from code now.

&nbsp;

In order to populate the ApplicationInsightsInstrumentationKey value I need to tell the Service Fabric Application that this will come in from ApplicationParameters at deploy time. This is achieved by defining a ConfigOverride in the ApplicationManifest.xml. We need a Parameter defined at the top and then use the [] syntax to represent a variable.

[caption id="attachment_406" align="alignnone" width="1024"]<a href="https://msdnshared.blob.core.windows.net/media/2017/06/ApplicationManifest.png"><img width="1024" height="418" class="size-large wp-image-406" alt="Application Manifest" src="https://msdnshared.blob.core.windows.net/media/2017/06/ApplicationManifest-1024x418.png" /></a> ApplicationManifest.xml[/caption]

You then need to put your real instrumentation key in the Local.1Node, Local.5node or cloud.xml files in the ApplicationParameters folder within the Service Fabric application project. You are all good to go!

<b>Advantages</b>: Takes the decision of what you want instrumented and where it goes away from the developer and places this as a Configuration Package which means you could change this without changing the code if required. Has the ability of configuring inputs to be based on keywords or specific events which provides powerful flexibility.

<b>Disadvantages</b>: Fiddly to setup up. EventFlow works In Process, so this configuration is probably not best for high performance services as you are effectively making a connection to App Insights from the service directly. For high performance, I would look at Scenario 3.
<h2><i>Scenario 3: Azure Diagnostics</i></h2>
It is common to setup a cluster with <a href="https://docs.microsoft.com/en-gb/azure/monitoring-and-diagnostics/azure-diagnostics">Azure Diagnostics</a> installed within each instance in the Scale Set. This means that we could just configure Azure Diagnostics to take defined provider names from each node and store them in a storage account of our choosing. The beauty of this solution is that Azure Diagnostics runs in its own process and would take all of the events from those providers across all the nodes. However, if we had a We ended up collecting the "Microsoft-ServiceFabric-Services" and "Microsoft-ServiceFabric-Actors" providers using this mechanism.

[caption id="attachment_416" align="alignnone" width="1024"]<a href="https://msdnshared.blob.core.windows.net/media/2017/06/WAD.png"><img width="1024" height="979" class="size-large wp-image-416" alt="Azure Diagnostics" src="https://msdnshared.blob.core.windows.net/media/2017/06/WAD-1024x979.png" /></a> Defined in the Virtual Machine Scale Set of the cluster[/caption]

An alternative would be to make every service in your cluster write to a canonical Event Source and then that was collected on each node, but I don't believe that was the design.

&nbsp;

<b>Advantages</b>: Very simple, didn't affect the running service as another process was responsible for submitting the telemetry to Application Inisghts

<b>Disadvantages</b>: In order to configure the Azure Diagnostics ETWListener you need to configure each Provider Name in the ARM Template. This is fine if you own the cluster and are able to add a new provider each time you add a new service, but I believe that this will quickly become unmanageable if you have 1000's of different service types. Maybe it would be best to agree on a common provider name and push all ETW events through this.
<h2><i>Summary</i></h2>
After much experimentation I decided to rely on Azure Diagnostics to surface "Microsoft-ServiceFabric-Services" and "Microsoft-ServiceFabric-Actors" events into Application Insights and use EventFlow to send application events]]></content:encoded>
    </item>
    <item>
      <title>Add Azure Active Directory B2B users to your Visual Studio Team Services</title>
      <link>https://docs.microsoft.com/archive/blogs/softwaresimian/add-aad-b2b-users-to-vsts</link>
      <pubDate>Wed, 15 Mar 2017 13:45:44 GMT</pubDate>
      <dc:creator><![CDATA[SoftwareSimian]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/softwaresimian/?p=286</guid>
      <description><![CDATA[I often go on site with customers and do some work for them inside their VSTS. I am going to...]]></description>
      <content:encoded><![CDATA[I often go on site with customers and do some work for them inside their VSTS. I am going to document a way for those companies that are using AAD and VSTS together to add me into their Azure Active Directory so that I can use my company email address and bring in my MSDN license. This means that end customer does not have to create me an account within their domain and does not have to pay for a licence for me to use VSTS.

So, how to add my Organisational Id to your VSTS tenant. Step 1 and 2 are not necessary as the GUID is actually unique for Visual Studio Team Services, but at least you can see how I got the details
<h3>Prerequisites</h3>
<ul>
 	<li>The service to be shared with the third party must be connected to the Azure AD of the company wishing to share the service</li>
 	<li>The third party company must also be using Azure AD</li>
 	<li>The person configuring the federation must have Administrator Privileges on the Azure AD</li>
</ul>
<h2>Step 1: Obtain the Application ID for the Service to be Shared</h2>
The first step is to obtain the ApplicationID for the specific service that you wish to federate (in this case Visual Studio Team Services).

This may be achieved by manually reading the GUID for the service from the Azure Active Directory (AzAD) portal or by using PowerShell. You can install the PowerShell cmdlet from here - <a href="https://go.microsoft.com/fwlink/p/?linkid=236298">https://go.microsoft.com/fwlink/p/?linkid=236298</a>

Open a PowerShell console as Administrator
<table>
<tbody>
<tr>
<td width="925">PS C:\&gt;Connect-MsolService

PS C:\&gt;Get-MsolServicePrincipal -ServicePrincipalName Microsoft.VisualStudio.Online</td>
</tr>
</tbody>
</table>
&nbsp;

This will return the following information:
<table>
<tbody>
<tr>
<td width="927">ExtensionData         : System.Runtime.Serialization.ExtensionDataObject

AccountEnabled        : True

Addresses             : {Microsoft.Online.Administration.RedirectUri}

AppPrincipalId        : 499b84ac-1321-427f-aa17-267ca6975798

DisplayName           : Microsoft.VisualStudio.Online

ObjectId              : 8648cd11-9177-xxxx-9fc740f1ad20

ServicePrincipalNames : {https://app.vssps.visualstudio.com/, 499b84ac-1321-427f-aa17-267ca6975798,

Microsoft.VisualStudio.Online}

TrustedForDelegation  : False</td>
</tr>
</tbody>
</table>
&nbsp;

The Service Principal Name is what you need: - 499b84ac-1321-427f-aa17-267ca6975798
<h2>Step 2: Create a CSV File</h2>
Now that you have the GUID for the service you wish to federate, you can put this into a CSV file to create the new identities in AzAD. Based on this blog: -

<a href="https://docs.microsoft.com/en-gb/azure/active-directory/active-directory-b2b-invitation-email">Azure AD B2B Invitation: CSV file format</a>

&nbsp;

The new fields are as follows:
<table>
<tbody>
<tr>
<td width="73"><strong>Type</strong></td>
<td width="149"><strong>Field</strong></td>
<td width="718"><strong>Description</strong></td>
</tr>
<tr>
<td width="73">Required</td>
<td width="149">Email</td>
<td width="718">The email address of the person you are inviting to use the service</td>
</tr>
<tr>
<td width="73">Required</td>
<td width="149">DisplayName</td>
<td width="718">Display name for invited user (typically, first and last name)</td>
</tr>
<tr>
<td width="73">Optional</td>
<td width="149">InvitationText</td>
<td width="718">Customize invitation email text after app branding and before the redemption link</td>
</tr>
<tr>
<td width="73">Optional</td>
<td width="149">InvitedToApplications</td>
<td width="718">AppIDs to corporate applications to assign users. AppIDs are retrievable in PowerShell by calling:

&nbsp;

Get-MsolServicePrincipal | fl DisplayName, AppPrincipalId

&nbsp;</td>
</tr>
<tr>
<td width="73">Optional</td>
<td width="149">InvitedToGroups</td>
<td width="718">ObjectIDs for groups to add user to. ObjectIDs are retrievable in PowerShell by calling

&nbsp;

Get-MsolGroup | fl DisplayName, ObjectId

&nbsp;</td>
</tr>
<tr>
<td width="73">Optional</td>
<td width="149">InviteRedirectURL</td>
<td width="718">URL to direct an invited user after invite acceptance. This should be a company-specific URL (such as contoso.my.salesforce.com). If this optional field is not specified, the invited user is directed to the App Access Panel where they can navigate to your chosen corporate apps. The App Access Panel URL is of the form <a href="https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2faccount.activedirectory.windowsazure.com%2fapplications%2fdefault.aspx%3ftenantId%3d%253cTenantID%253e&amp;data=01%7c01%7crosmith%40064d.mgd.microsoft.com%7c8f1d5d1945ce4caa232c08d38f89a540%7c72f988bf86f141af91ab2d7cd011db47%7c1&amp;sdata=kQOcjZNHFhBNUYYeV1up6Zp2aH1webWEfF2i1tbKP9A%3d">https://account.activedirectory.windowsazure.com/applications/default.aspx?tenantId=&lt;TenantID&gt;</a>.</td>
</tr>
<tr>
<td width="73">Optional</td>
<td width="149">CcEmailAddress</td>
<td width="718">Email address to copy emailed invitation. If the CcEmailAddress field is used, this invitation cannot be used for email-verified user or tenant creation.</td>
</tr>
<tr>
<td width="73">Optional</td>
<td width="149">Language</td>
<td width="718">Language for invitation email and redemption experience, with "en" (English) as the default when unspecified. The other 10 supported language codes are:

1. de: German
2. es: Spanish
3. fr: French
4. it: Italian
5. ja: Japanese
6. ko: Korean
7. pt-BR: Portuguese (Brazil)
8. ru: Russian
9. zh-HANS: Simplified Chinese
10. zh-HANT: Traditional Chinese</td>
</tr>
</tbody>
</table>
The following table is a copy of the actual CSV file used in the proof of concept (several optional fields were not used):
<table>
<tbody>
<tr>
<td width="196"><strong>Email</strong></td>
<td width="188"><strong>DisplayName</strong></td>
<td width="128"><strong>InvitationText</strong></td>
<td width="176"><strong>InvitedToApplications</strong></td>
<td width="269"><strong>InviteRedirectURL</strong></td>
</tr>
<tr>
<td width="196"><strong>xxxx@microsoft.com</strong></td>
<td width="188"><strong>Ivor Engine(Microsoft)</strong></td>
<td width="128"><strong>Hi Ivor, Welcome to VSTS</strong></td>
<td width="176"><strong>499b84ac-1321-427f-aa17-267ca6975798</strong></td>
<td width="269"><strong><a href="https://mytenant.visualstudio.com/">https://mytenant.visualstudio.com/</a></strong></td>
</tr>
</tbody>
</table>
&nbsp;
<h2>Step 3: Create a new user in Azure AD</h2>
<ul>
 	<li>Navigate to the Azure Active Directory User management panel</li>
 	<li>Add user</li>
 	<li>Select 'Users in partner companies' as shown below:</li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2017/03/AddUser.png"><img width="300" height="260" class="alignnone size-medium wp-image-295" alt="adduser" src="https://msdnshared.blob.core.windows.net/media/2017/03/AddUser-300x260.png" /></a>
<ul>
 	<li>Upload the CSV file created in Step 2</li>
 	<li>Wait for the update to complete</li>
 	<li>Azure AD will now send an invitation to all users identified in the CSV file.</li>
</ul>
&nbsp;
<table>
<tbody>
<tr>
<td width="928"><strong>PLEASE NOTE:</strong>

It is vital that the invited users respond to the invitation from Azure AD (as well as the subsequent invitation that they will receive from VSTS), or they will be unable to access the services that have been identified in the CSV file</td>
</tr>
</tbody>
</table>
<h2>Step 4: Add User(s) to Visual Studio Team Services Collection Group</h2>
Once the user has been added to Azure Active Directory and they have accepted both the invitation from AzAD and from the application, you will be able to add them as a user in VSTS. They will appear as though they were in your directory, now they can utilise their MSDN account to collaborate with you on your project. This user will authenticate against their own companies Azure Active Directory. So if they no longer work for that company (Joiners/Leavers) they will not be able to authenticate. Which is not the case if you have created them an account in your AD.

Good luck!]]></content:encoded>
    </item>
    <item>
      <title>Retrieving Distinct Count of the PageViews in Application Insights using parseurl</title>
      <link>https://docs.microsoft.com/archive/blogs/softwaresimian/appinsights-parseurl</link>
      <pubDate>Wed, 04 Jan 2017 20:07:48 GMT</pubDate>
      <dc:creator><![CDATA[SoftwareSimian]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/softwaresimian/?p=275</guid>
      <description><![CDATA[Had a query from a partner today about how they could get a report from Application Insights to tell...]]></description>
      <content:encoded><![CDATA[Had a query from a partner today about how they could get a report from Application Insights to tell them how many times a particular App Service had been called. The sticking point was to group all of the hits to a particular instance irrespective of the full url that was being retrieved.

We built this up slowly to find out the syntax of what was being expected

<code>// Create a table with a query
let recentReqs = pageViews | where timestamp &gt; ago(30d);
// select one column into a new table
let recentHosts = recentReqs | project parsejson(parseurl(url))["Host"];
recentHosts | summarize count() by tostring(Host)</code>

Once we had this working, we knew we could simplifying this into

<code>pageViews
| where timestamp &gt; ago(30d)
| summarize count() by tostring(parsejson(parseurl((url))["Host"]))</code>

Hope this helps someone!]]></content:encoded>
    </item>
    <item>
      <title>dotnet restore unable to resolve .NET Framework libraries</title>
      <link>https://docs.microsoft.com/archive/blogs/softwaresimian/dotnet-restore-unable-to-resolve-net-framework-libraries</link>
      <pubDate>Sun, 25 Sep 2016 21:20:22 GMT</pubDate>
      <dc:creator><![CDATA[SoftwareSimian]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/softwaresimian/?p=235</guid>
      <description><![CDATA[I was at a hack at the start of the month and we were attempting to create a CI pipeline for the...]]></description>
      <content:encoded><![CDATA[I was at a hack at the start of the month and we were attempting to create a CI pipeline for the solution. The solution was made up of a dotnet core (1.0.0-preview2-003121) Web API project that references some .Net Framework 4.5.2 class libraries. When I compiled this in VSTS it was unable to restore the .Net Framework libraries.

Searching around, there are similar issues being found on GitHub; <a href="https://github.com/dotnet/cli/issues/3199">https://github.com/dotnet/cli/issues/3199</a> and <a href="https://github.com/aspnet/Tooling/issues/741">https://github.com/aspnet/Tooling/issues/741</a>.

The problem turned out that the version of Nuget on the Hosted Build Agents does not work with this mix of core and framework. In order to fix this: -
<ul>
 	<li>Add a variable called NugetDownloadUrl with a value of  https://dist.nuget.org/win-x86-commandline/v3.5.0-rc1/NuGet.exe</li>
 	<li>Add a simple PowerShell task to download the Release Candidate nuget. The command should be: -<strong><span style="color: #000000;font-family: Calibri">Invoke-WebRequest -OutFile "$(build.ArtfifactStagingDirectory)\NuGet.exe" $(NugetDownloadUrl)</span></strong><a href="https://msdnshared.blob.core.windows.net/media/2016/09/NuGetDownload.png"><img width="410" height="93" class="alignnone wp-image-245" alt="NuGetDownload" src="https://msdnshared.blob.core.windows.net/media/2016/09/NuGetDownload-300x68.png" /></a></li>
 	<li>Then add a standard Nuget restore task but pointed explicitly at the NuGet.exe file that was just downloaded. <strong><span style="color: #000000;font-family: Calibri">$(Build.ArtifactStagingDirectory)\Nuget.exe</span></strong></li>
</ul>
<!--more-->

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/NugetRestore.png"><img width="388" height="208" class=" wp-image-255 aligncenter" alt="NugetRestore" src="https://msdnshared.blob.core.windows.net/media/2016/09/NugetRestore-300x161.png" /></a>

Now, when you compile your project, it will compile your dotnet framework projects and restore the dotnet core packages.]]></content:encoded>
    </item>
  </channel>
</rss>