Monday, August 8, 2016

GigJam - first experience

Hi All,

Recently, I played with Microsoft new tool called as 'GigJam'. It is a cool tool to bridge the systems and get the things much quicker.

It is not a screen sharing tool where you depend on bandwidth to get the screen shared. You share the canvas of application and define what section can be seen by other party and what action can a recipient can take as read/write.

I have recently presented it at Melbourne Office 365 User group and uploaded details at below location.
Feel free to browse them and leave your comments for improvement.

Slide - @SlideShare
Detailed information - @European SharePoint E-books 

Sunday, August 7, 2016

Microsoft Stream - With Office365

Microsoft announced a new service called as ‘Microsoft Stream’. For details, please check out the blog at https://blogs.office.com/2016/07/18/what-microsoft-stream-means-to-office-365/.

It is a new video business service and anyone with a valid business email address can sign up for the service. Microsoft aiming to solve the below business challenges via Microsoft Stream services –
  • Getting started in seconds to use the service. This has been a challenge due to IT involvement for the end user requirements.
  • Allow easy upload and organization of videos. With easy drag and drop capabilities, upload your videos and organize them by either starting a channel or contributing to a channel based on team, group, topic etc.
  • Search the relevant content quickly. There are options like “trending” videos powered by machine learning, as well as search by hash tag, most liked videos and other key search terms.
  • Watch anywhere, on any device, anytime.
  • Security on content - who views your video content by determining how widely to share within your organization, and to what channels. Secure application access is enabled by Azure Active Directory, a recognized leader in identity management systems, to protect sensitive corporate content.
  • Follow what is relevant to you.
  • Socialize videos by sharing via email, “Like” your Favorites and embed videos to web pages within your organization.
I tried my hands on this service and found it quite easy to use from an end user perspective.

Sign up Process –

Signing up for Stream was easy. What I did, steps are as listed below –
  1. Open an InPrivate browsing session in Edge/Chrome/your fav browser.
  2. Log in to the service https://portal.office.com/ using your Office 365 credentials.
  3. In the same browser session navigate to http://stream.microsoft.com/  
     
  4. Click on the ‘Sign in’ option, which is located in top right of the page. Clicking on sign-in will take you to a page which will have your logged in user email address as below
  5. Click on the ‘Sign up’ button. And the page will take few seconds to loop through the internal process and displays that you are almost there to use the service.
  6. On clicking Start, you will be redirected to share page. Here you can invite other colleagues.    
  7. You might land on home page. But just click again for sign in. (this happened during my experience and may not be the case with you).
  8. Now if you go to your Office 365 Apps, you can see the newly added Stream App in app launcher.

Uploading video
  1. Now we can start uploading the videos. Click on the arrow button available in top bar on top right section (highlighted in blue).
  2. On Browse page, you can see the videos sort by options like relevance, trending or other valid options.
  3. On Channels page, you can find channel relevant to you, or popular channels or channel with most videos.

Comparison with Office 365 Video service –
Feature
Microsoft Stream
Office 365 Video
Upload speed
The upload speed was good and similar to O365 Video services ((for 10MB file)

As competent as Stream service. (for 10MB file)
Video Processing
As soon as the video was uploaded, it was available for viewing and defining other attributes (as shows in above screenshot)
It took few seconds to process the video and made available for viewing.

Sharing
You can share the video using URL directly.

You can use the URL same way to share it or using email.
Embedding
The portal provides you an option to choose the frame size and auto play property for your web pages.

It is depending on who you embed your video in the page.
Multi device support with bandwidth
Stream offer multiple quality of video options.

Video portal has good options but less than Stream service.

Statics
Like, View statistics are immediately available.

It takes up to 1 days to process the statics and
Overall comparison
Overall, Stream service offer the same as Video but with
New Look
Fast statistics processing
More video quality options
Similar to other video service in consumer space
But miss options like Yammer, download (I haven’t seen an easy way to download it), finding embed code for video.

Looking forward how this goes and integrate with other O365 services like Group, Yammer, BI and others.

Saturday, June 25, 2016

Collab 365 - Summit 2016 - Select the best development approach for your case

In continuation to my talks on Office 365 Dev, I delivered a talk at Collab365 - Summit 2016. You can find more information on their home page.

My session is about how we shall compare the multiple development styles available to us and select wisely a preferred situation for development. The focus here is to deliver what will maximize the benefit to end user productivity.

Session details - https://collab365.conferencehosts.com/confs/Summit2016/c365summittrivedi/ConfPages/SessionRoom.aspx

This is available on demand and can be viewed anytime now.

Tuesday, June 21, 2016

Microsoft Graph - Easy to switch

The purpose of this article is to learn how much it is easy to switch your application from using multiple Offie 365 service end points to one end point - graph.microsoft.com. This will make easy to switch the context of applications using same end point and without requiring authentication token against each end points.

It's been a while since Microsoft started to focus on Office 365 development platform.
Office 365 has a mix of products like Exchange, SharePoint. Microsoft has been adding many new products in Office 365 suite recently.

When Initially development started, each product has its' own development APIs. Like 
· For Exchange, use EWS or REST APIs.
· For SharePoint, either uses client side object model or REST APIs.
· For Lync becoming Skype, some of the Skype APIs were available.

Now, consider a real-time customer scenario where you have to access email, calendar, tasks and OD4B service from one application and in a sequence. 
In this case, the programmer has to write multiple sets of APIs across different platforms. Moreover, each time the platform changes, the programmer has to handle authentication token against end point.
To solve this challenge, Microsoft introduced Unified APIs in the preview. This was released around Mid-2015. The intention was to build a unified model to query across products from one end point. Since this was in preview, not ready for production use, a lot of developers did not build the application using this.
A lot of developers have built the application using the previously recommended and supported model. Now it is a good time to switch the code to Microsoft Graph API.
Let's get started in action.
When you configure the project with Office 365 API, either the native or web application gets registered with Azure AD. This registration will add details like client id, client secret, tenant id, the domain in the configuration file of the application.
I am considering ASP.NET app here. It can be MVC or web forms. 
1. First thing, you already have registered your app with Azure AD and set the applications permissions.
2. You should change the property SSL Enabled to TRUE if this is not done.
3. Now let's add Microsoft Graph permissions on the app.
a. Go to Azure Management Portal and sign in using the organizational account. ( I generally do sign in using global admin user account).
b. In the left-hand navigation, click Active Directory.
c. Select the directory you share with your Office 365 subscription.
d. Locate and select the Application tab on the header/options bar.
e. Select the application you created for this lab.
f. Open Configure tab
g. Scroll down to the permissions to other applications section.
h. Click the Add Application button.
i. In the Permissions to other applications dialog, click the PLUS icon next to the Microsoft Graph option.
j. Click the CHECK icon in the lower right corner.
k. For the new Microsoft Graph application permission entry, select the Delegated Permissions drop-down on the same line and then select the permissions required for your application. (screenshot is for reference only, permissions should be selected based on the required scope)
l. Click the Save button at the bottom of the page.

4. Now in your Visual Studio solution, add a help class which will help to build the strings from configuration file quickly. Example - 
public class SettingsHelper
   {
       public static string ClientId
       {
           get { return ConfigurationManager.AppSettings["ida:ClientId"]; }
       }
 
       public static string ClientSecret
       {
           get { return ConfigurationManager.AppSettings["ida:ClientSecret"]; }
       }
       public static string AzureAdInstance
       {
           get { return ConfigurationManager.AppSettings["ida:AADInstance"]; }
       }
 
       public static string AzureAdTenantId
       {
           get { return ConfigurationManager.AppSettings["ida:TenantId"]; }
       }
 
       public static string GraphResourceUrl
       {
           get { return "https://graph.microsoft.com/v1.0/"; }
       }
 
       public static string AzureAdGraphResourceURL
       {
           get { return "https://graph.microsoft.com/"; }
       }
 
       public static string AzureAdAuthority
       {
           get { return AzureAdInstance + AzureAdTenantId; }
       }
 
       public static string ClaimTypeObjectIdentifier
       {
           get { return "http://schemas.microsoft.com/identity/claims/objectidentifier"; }
       }
   }
 
5. Now, let's add a function call to get the access token for logged in user for Graph API authentication
 
public async Task<string> GetGraphAccessTokenAsync()
{
   var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value;
   var userObjectId = ClaimsPrincipal.Current.FindFirst(SettingsHelper.ClaimTypeObjectIdentifier).Value;
 
   var clientCredential = new ClientCredential(SettingsHelper.ClientId, SettingsHelper.ClientSecret);
   var userIdentifier = new UserIdentifier(userObjectId, UserIdentifierType.UniqueId);
 
   // create auth context
   AuthenticationContext authContext = new AuthenticationContext(SettingsHelper.AzureAdAuthority, new ADALTokenCache(signInUserId));
   var result = await authContext.AcquireTokenSilentAsync(SettingsHelper.AzureAdGraphResourceURL, clientCredential, userIdentifier);
 
   return result.AccessToken;
}
6. Based on your application type (MVC/Webforms), add the CRUD functions in your form/controller class.
7. In my ASP.NET forms application, I have added the function call as in Page Load 
RegisterAsyncTask(new PageAsyncTask(GetUserFiles));
And definition was
public async Task GetUserFiles(){}
9. Implementation  for reading the files from OneDrive for business as 
var accessToken = await GetGraphAccessTokenAsync();
           var restURL = string.Format("{0}me/drive/root/children", SettingsHelper.GraphResourceUrl);
 
           try
           {
               using (HttpClient client = new HttpClient())
               {
                   var accept = "application/json";
 
                   client.DefaultRequestHeaders.Add("Accept", accept);
                   client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
 
                   using (var response = await client.GetAsync(restURL))
                   {
                       if (response.IsSuccessStatusCode)
                       {
                           var jsonresult = JObject.Parse(await response.Content.ReadAsStringAsync());
 
                           string filesInfo = string.Empty;
                           foreach (var item in jsonresult["value"])
                           {                                
filesInfo = filesInfo +  item?["name"]?.ToString() + Environment.NewLine ;
                           }
                           txtOutput.Text = filesInfo;
                           //lblGraphSuccess.Text = "Successfully request using graph";
                       }
                   }
               }
           }
           catch (Exception el)
           {
               //Handle Exception your style
           }
10. Same way you can apply other APIs and build update/delete methods.

This will help you to get started changing your code from individual end points to one unified end point.
Feel free to post comments if you have any question.
For details on implementation differences, you can look at below articles and git repos