Microsoft

Blog Categories

Subscribe to RSS feed

Archives

Archive for the ‘.NET’ Category

Developing for Office 365 and SharePoint

Recently I participated in a Microsoft developer discussion on the Yammer Network where some great ideas were shared. I am re posting a summary of the session posted in that group here for everyone’s benefit

——————————–

Overview: Microsoft responses to questions are provided by Chris Johnson, Sonya Koptyev, Jeremy Thake, Dorrene Brown, Mauricio Ordonez, Brian Jones, Ricky Kirkham, Christophe Fiessinger, Jeremy Chapman, Alister Spiers, and 365 IT Pro Team as well as MVP Juan Carlos Gonzalez Martin.
 

FUTURE PLANS
Q: When will we see the O365 APIs move out of preview? When will we see the O365 APIs move out of preview?
A: We’re aiming for end of this calendar year. We’re getting a bunch of great feedback and have a few partners building solutions that have helped us identify some additional work we’d like to get in. We will have a public roadmap soon that we will be keeping up to date to help give people a heads up on when developer related features will be coming.

Q: Are there any plans in the SharePoint roadmap for an analytics API about user actions (like Usage or Audit data for SharePoint On-Prem)?
A: It is something that our Information Management team are working on. This is obviously challenging from a multi-tenant perspective due to the nature of where we have come from historically with the SharePoint platform

Q: Is there is any plans for Lync online API so we can schedule and add people to meetings from our custom application? 
A: We are working to expand our APIs across the suite, but we don’t have any announcements around the Lync Online APIs at this time.
 
Q: Can you please provide a little more insight around the plans for auto versus provider hosted apps and what is going to happen to Cloud Business Apps (light switch / html)? I understand provider hoist is the current guidance but I’d like to understand what the path will be so we can make some good architectural and strategic decisions for our apps in the near future – 3-6 months timeframe. We currently create, and have a need for small, dedicated task oriented apps that interact between Office 365 and SQL Azure.
A: The Auto-hosted apps preview program is closed (http://blogs.office.com/2014/05/16/update-on-autohosted-apps-preview-program and we will be allowing the apps to run until close to the end of the year. The guidance is to convert your auto-hosted apps (if you have any) to provider-hosted. That is the preferred app deployment model today. We cannot comment on the CBAs but can pull in the right folks to answer your questions around CBAs.

Q2: Are you working on a replacement for Autohosted Apps? Autohosted Apps were a really powerful App Type for creating and deploying small Apps without having to worry about deploying them in Azure.
A2: We heard from developers that they wanted to have full access to Azure, and so as we announced in the blog post we will continue to work with the Visual Studio team to continue to simplify and streamline the deploy process into Azure.

Q: Is there a plan to enhance the APIs available for administrative activies such as managing domains/DNS entries or modify Exchange/Lync/Sharepoint settings via APIs?
A: Our approach is to have management APIs via PowerShell + the remote APIs via REST/CSOM. We don’t currently have anything to share about new APIs coming to PowerShell about those specific things. We’re always looking to improve what can be automated! The big focus has been to make it easier through poweshell cmdlets… check them out on TechNet - http://technet.microsoft.com/en-us/library/dn194107.aspx

Q: Are there any plans to be more transparent about updates to the UI? Given that our development is focused on a client side API, any changes to the standard HTML can immediately render our solutions broken. For example — the top navigation bar’s text color recently changed. If my branding had used that color for the background color, the text would have been invisible. Even “non-disruptive” changes can be disruptive.
A: There is work in progress to be more transparent with our roadmap where we will share changes such as the user experience changes along with new and changed APIs.

The nature of us running a service now is that we are continually improving the user experience. With SharePoint On-Premises the user experience has changed between Cumulative Updates, Service Packs and major releases. As a SharePoint developer we have always had to manage this balance, taking a dependency from your code on the UI is a fragile one due to the frequency of change and we would recommend you avoid it at all costs.

With regards to the scenario you provided around the top navigation bar text color recently changing…the Theme approach is fully supported. I do agree that it is unfortunate that the text became invisible. We are working on some new features to improve this experience, but are not quite ready to disclose them

Q: Are there plans to make it easier for public facing and publishing sites to be Responsive ready? What can we look forward to?
A: Have you checked out this post about responsive web design in SharePoint? http://blogs.msdn.com/b/sharepointdev/archive/2013/04/01/implementing-your-responsive-designs-on-sharepoint-2013.aspx
Also, you can find additional information about designing public facing sites here: http://office.microsoft.com/en-us/office365-sharepoint-online-enterprise-help/public-website-faq-HA104135026.aspx#_Toc383417646

Q: CRM now supports multiple instances within a single Office 365 tenant. Will SharePoint receive this same capability in the future so that we can better manage Development and QA instances?
A: Currently SharePoint has the capability of creating different Site Collections in the same tenancy which is how some handle dev/QA areas to keep things separate. However, others choose to create an entirely separate tenancy to keep things separate.

In your case what are you looking for isolation of? Sites, User profiles? Mailboxes? All of the above? Keen to hear more about what you are looking for. Please log it on UserVoice: http://officespdev.uservoice.com/

Q: A request that we get from Office365 customers is hiding specific content from the suite bar. Are there any plans to implement customizing and hiding content? This would need to be consistent across all Office365 Services. 
A: We’ve also heard several times that customizing the suite bar is something that users want as well. While we aren’t quite ready to share our thinking just yet, this is something we are thinking about at this time.
 
APIs 
Q: How much change should we expect moving from the Preview APIs to the Production APIs?
How much notice will we get when this happens to make sure we can make adjustments in our code?
A: We don’t anticipate huge changes in the O365 APIs moving from preview to production. There will be changes to the APIs while they are still in preview, but we’ll make sure to let everyone know in advance. We are currently working on a 30-60-90 day roadmap for the public that will show people what will be changing in the near future.
 
Q: In the preview Office 365 Files Rest API what is the reasoning behind limiting file copy and move operations to only within the same document library? This really limits the usefulness of those operations and is less functionality than what is in the existing SharePoint web endpoints.
A: No reason other than we haven’t implemented the feature yet :) The Files APIs are still in preview mode, and while we can’t share the exact improvements we will be making this is definitely a good idea. Can you add this feature request to our UserVoice (aka.ms/officedevfeedback) so we can get it on our backlog?

Q: What is the relationship between the O365 APIs (http://msdn.microsoft.com/library/office/dn605893) and SharePoint apps intended for SharePoint Online? Are SP apps going to be replaced (eventually) by the O365 APIs? If not, what scenarios are appropriate for SP Apps, but not for O365 APIs, and vice versa?
A: No, they are not replacing Apps for SharePoint. The way we see is that the Apps are the contextual experience of surfacing your customization into SharePoint and Office. Such as App Parts, Ribbon Custom Actions, List Item Block Actions in SharePoint or Read/Write Compose in Outlook and Content App in PowerPoint.

The Office 365 APIs are your way of reaching into the services (Calendar, Mail, Contacts, OneDrive for Business, SharePoint All Sites) from your standalone web applications or mobile applications.We see these two complementing each other to deliver your business solutions. We will be sharing more soon on this direction and strategy.

Q: From my SharePoint site can I call my custom for example WebAPI endpoint and use OAuth to authorize this call on the backend? I want to call external backend from JavaScript in my SharePoint site and just know the caller from my backend I don’t want to call back to SharePoint I will just get data from my backend and send it to the caller. 
A: We don’t think you can use the context token in that way. There’s no way to obtain a context token programmatically. What we would suggest for these JavaScript scenarios is that your WebAPI use an Auth cookie that gets sent in response to the initial context token.

GENERAL QUESTIONS AND FUNCTIONALITY 
Q: When will we get to know more about the Discovery Service? We work in integration, and knowing what’s out there instead of having to search for it would be extraordinarily helpful.
A:The Discovery Service allows applications to find the specific endpoint location for resources. For example, when a user signs into an application it can call the discovery service to determine URL of the user’s OneDrive. This saves the user from having to manually type in the URL. http://msdn.microsoft.com/en-us/library/office/dn605898(v=office.15).aspx

Q: I’ve been having a lot of trouble figuring out leverage Office Web Apps as a provider hosted app. What’s the best path for third party companies wanting to give users the best web experience possible?
Is it possible to use Office Web Apps with a client dropbox account? Feed them a byte[] or some such action?
A: If the files are stored in O365, then you should be able to use the Web Apps to render the files. If the files are in dropbox, you’d need to first get them into the user’s OneDrive for business folder, and the Web Apps would then render them.

Q: What is the relationship of the O365 Common Consent Framework (http://msdn.microsoft.com/en-us/library/office/dn605895(v=of…) to SharePoint apps? Assuming the app is targeted only for SharePoint Online, is the ComCon Framework and alternative to the existing ACS/OAuth system for SP app developers? Is it meant to replace the existing system?
A: The Common Consent Framework allows applications to access multiple services. Today the set of services supported by common consent includes SharePoint, Exchange, and the directory. In contrast, SharePoint app authorization model allows access solely to SharePoint resources. At SharePoint Conference 2014 we announced our direction is to converge these two models.
Right now you can actually already call the CSOM and REST APIs if your app asks for at least READ permissions that the user consents to. You can pass the Auth Bearer token as you make calls to both those APIs.

Q2: How would you use CSOM in an O365 APP? Would you use a token to establish a ClientContext?
A2: Yes, you can use CSOM completely out of SharePoint…there is a post of Kirk Evans where he shows how to create a Timer Job where you can see this idea.http://blogs.msdn.com/b/kaevans/archive/2014/03/02/building-a-sharepoint-app-as-a-timer-job.aspx
The Microsoft team is also working on getting out some simple blogs posts dealing with this particular subject.

Q: When developing Apps for Office 365 and the App Catalog: we may want to update our app from time to time. What resources are there to learn the best way to do this and could this potentially translate to On-Prem app updates? 
A: Ricky Kirkham did an amazing session on this at SharePoint Conference http://channel9.msdn.com/Events/SharePoint-Conference/2014/SPC425. Due to the app model not sitting on the SharePoint Server, the good news is that IISRESETs are not required that would impact the operational uptime of the SharePoint server.
There are naturally strategies just like any web applications of releasing new versions of your web app into production still. But it does not impact your SharePoint SLA now, just your app. We have several topics on MSDN about updating SP apps. The top node is: http://msdn.microsoft.com/en-us/library/office/fp179904%28v=office.15%29.aspx. It is not necessary to stop SharePoint to update an app. Only the app itself is inaccessible while the update is running.

Q: Why is the Recycle method not exposed on SP.Web in CSOM? In order to recycle a web rather than delete it. I only see DeleteObject exposed where other objects such as SP.List have a Recycle method.
A: That would be a great one to add to user voice, and we can take a look at it. http://officespdev.uservoice.com

Q: Tenancy scope app can’t install app part. How I can create the concept of app stabling to my site and run code in the host web without needing to install an app and add my app part to the host web?
A: If it is a scenario when a user launches the home page of the host web and you want to execute some code and render something on the page,right now you would need to add the App to every Site where you wanted the App Part.
Right now you can’t automatically add the App Part to a page, we have an engineer investigating this scenario right now. In the future we intend on improving this scenario of deploying apps at a tenant level. If you just want to execute code against multiple host webs, have you can build a Standalone Web Application or Mobile Application that calls the Office 365 APIs.
 
Q: How to deal with the announcement of discontinuation of InfoPath in SharePoint? Is there any guidance or migration path?
A: Customers can still use InfoPath until 2023. We plan to release a replacement (side by side for now) with the SharePoint form customization technology, currently codenamed “FoSL” later this summer. We are also working actively on vNext technologies for other scenarios, and we will provide more details later this year, closer to Q4. http://blogs.office.com/2014/01/31/update-on-infopath-and-sharepoint-forms

Q2: Regarding the 2023 date… will this include InfoPath Forms Services or just InfoPath Desktop Client? Dates this far in the future would certainly impact a client’s decision.
A2: InfoPath Desktop Client will continue to be supported through 2023. InfoPath Forms Services in on-prem deployments will also continue to be supported until 2023. InfoPath Forms Services in SharePoint Online (Office 365) will be maintained until the next on-premises release of SharePoint. We will provide a year’s notice (via blog post) before turning off IPFS in the service.

Q: Will it be possible (or is it already possible) to use Word Online, Excel Online, etc from SharePoint Online as a drop in replacement for textarea/ckeditor html-fields in .Net/Azure web applications?
A: We currently have the ability to drop a document on a page and use Word Online to view it. However, we don’t have the ability to just use it as a generic rich text editing control like you would with the radEditor for example.

Q2: When you say drop a document on a page, do you mean a web page that is not within SharePoint Online (like a regular MVC-web application pages (for example a cshtml-page))? And does this solution require the users to login to SharePoint online also?
A2: Yes, that’s right. Auth depends on where the document sits. If it’s in Office 365, then yes, they would need to authenticate. You can also do the same with documents in OneDrive.

 

 

Source: Yammer IT Pro

Testing Sitecore With Test Driven Code

Testing is a necessary difficulty that we all must endure. The practice of Test Driven Development (TDD) doesn’t always make testing easier but I firmly believe it makes the development of software more predictable and reliable.

Throughout my career I’ve been a part of many teams, both those disciplined in good testing practices and others not so disciplined. Since my involvement with developing for Sitecore, I have been in the past consistently disappointed in the abilities to test different facets of a Sitecore solution. Read the rest of this post »

Declarative data caching in .NET business layer

One of the most effective ways to improve application performance is to implement data caching. Most of the applications are relatively retrieving the same data from external sources like database of web service and if that source data is never or seldom changes then application is just wasting CPU time and I/O querying the source again and again. There are a great many ways to cache data in application, there are different software frameworks, standalone applications and even caching appliances, but probably the most widespread and easiest way to cache data is a built-in .NET MemoryCache class which is providing a simple in-process caching since .NET 4.0. cache

Read the rest of this post »

Strengthen Company Culture with Yammer enhanced by HDInsight

In a world of broadband internet connections, online collaboration tools and the ability to work from almost anywhere – office culture can be difficult to sustain.  This especially holds true for people who live in large cities (where the commute can be problematic) or in harsh climates (like the never ending winter in Chicago this year).   Yammer can help by creating remote social interactions.

Strengthen Company Culture with Yammer enhanced by HDInsightYammer is an enterprise social network that aims to connect people in the office.  A few of its features are instant messaging, user profiles, a primary news-feed, interest groups, recommendations for people to follow, groups to join as well and a recent activity feed.  The interface is clean and well designed.  One of the great things is that once you start using Yammer it is really easy to continue.

There is one area where Yammer seems to fall short.  There is no clear way to bring people together who have common interests.  The other users and groups that are recommended to me by Yammer are made based on the groups I am a part of and people I follow.  It does not take into consideration any of the data in my user profile.

Perficient recently held a hack-a-thon where my team identified this short coming.  Social interaction via online collaboration tools wasn’t cutting it.  In an online culture how can we leverage all of our tools to help facilitate more meaningful social gatherings?  The answer was to use interest data that co-workers have provided through Yammer to generate meaningful recommendations.  A Yammer profile consists of many different “interest groups”.  It lists categories such as Expertise, Interests, Previous Company and Schools Attended.  All of these can be classified as conversation topics and can be used as a common social interest.

This is where HDInsight powered by Hadoop and Mahout can help.  Mahout can consume massive quantities of information and return logical connections represented within the data.  For additional reading about Hadoop and Mahout click here.

Using an HDInsight Hadoop cluster in coordination with the Mahout recommendation engine we could provide meaningful recommendations to users based on their individual interests.  This wouldn’t just recommend topics that a user might be interested in but also groups they could create or join with other users based on their mutual interests – similar to the recommendations Facebook suggests regarding people you may know, groups to join or pages you may like.

Creating these logical, online groups would “connect the dots” to uncover a similarity between people where it might otherwise remain hidden.  It could also help facilitate in-person group outings, social gatherings or simply more friends and comraderie in the office.  Through this you are creating a more meaningful environment aided by technology.

A thriving office culture can stand out in a world where telecommuting tends to be more convenient.  This may not convince everyone to come to the office. However, instead of viewing it as obligatory, implementing a solution like this can encourage more people to choose to commute to the office for the social comraderie.  All of this can be done for free through the Yammer API and a Windows Azure account.

Windows Azure: Retiring Windows Server 2008 and how to upgrade

Beginning on June 2, 2014 Windows Azure will be retiring Windows Server 2008.  This means that you will no longer be able to deploy a new Cloud Service or manage your existing services on virtual machines running Windows Server 2008.

Windows Azure: Retiring Windows Server and how to UpgradeWindows Azure currently supports four different GuestOS ‘versions’:

  • GuestOS 1.x – Windows Server 2008
  • GuestOS 2.x – Windows Server 2008 R2
  • GuestOS 3.x – Windows Server 2012
  • GuestOS 4.x – Windows Server 2012 R2

If your Cloud Service has not been upgraded and is still running on Windows Server 2008 you must upgrade the servers that power your service.  How do you do that?  Isn’t the point of a running a PaaS cloud service instead of using IaaS to handle the operating system and hardware for me?  The short answer is yes, but…

PaaS will take care of much of the hardware, IIS patches and OS patches for you but Azure will not do entire OS upgrades for your entire service unless you tell it to.  This happens because incompatibilities between cloud services and operating systems are likely to arise.  This would cause developers to try and fix code on the fly.  That is not only bad for up time but could also come with some very serious security holes.

Thankfully, living in a world where you have to manually upgrade the server OS for your service is in the past.  Azure makes it easy to upgrade the guest OS for your service.  You can even have your production service remain on Windows Server 2008 while upgrading your staging environment and deploying your service there.  This will allow developers to fix any outstanding bugs that are introduced with the operating system upgrade.

How do you upgrade your staging environment?  It is pretty straight forward.  From the cloud service dashboard select your staging environment and choose Configure.  At the bottom of the page find the operating system section.  You will see drop down menus for OS Family and OS Version.  Select proper OS Family (in this case anything but 1.x) and OS Version.  To always have the most up to date OS Version select automatic.  This ensures your cloud service will always be running on the latest Azure VM that is available.  If you do not want this select a static version of an OS.  This guarantees that your cloud service will remain running this OS until you upgrade it in the future.

When the service is cleared for production it is time to configure your production environment.  Upgrading your production environment can lead to some downtime for your service, but there is a way to avoid it.  Normally you will need to configure your staging and production environment independently but now you can swap your staging and production environments using the Swap option in the portal.  This will effectively swap your staging environment into production.  The change will happen within seconds and any downtime experienced will be minimal.

After the swap you can rebuild and configure the former production environment, which is now your staging environment to match that of your current production environment.

Guide to Integrating Your Product Catalog with Sitecore

The Perficient Sitecore team has been writing feverishly over the past few months to publish several new guides. Most recently, Mark Servais, a Sr. Technical Consultant within Perficient’s Sitecore practice and Sitecore MVP, authored a new paper, Four Ways to Successfully Integrate Your Product Catalog with Sitecore.

Sitecore Product CatalogSitecore is a content management platform that is very flexible in terms of its ability to integrate data and extend functionality. This guide explains several different approaches and best practices to integrating products into Sitecore, depending on your product catalog scenario. Of course, every integration is going to be unique in that each company has distinct practices, with diverse systems housing the product data, and various criteria surrounding the interaction with that data. Mark points out that you’ll want to take sales, pricing, attributes, and regional offerings into account as applicable.

Common scenarios include:

  1. The product catalog exists in Sitecore exclusively for the enterprise
  2. The product catalog exists outside of Sitecore and is managed outside of Sitecore
  3. The product catalog exists outside of Sitecore and is managed in multiple systems including Sitecore
  4. The product catalog exists outside of Sitecore and is managed in Sitecore

Mark goes into detail on each of the four ways, providing potential advantages and disadvantages depending on the scenario. He closes by recommending the use of a custom data provider to gain the most control and functionality, yet provides options if you are unable to do so. He also stresses the importance of data concurrency and consistency when thinking about how your content editors will interact with the product data.

You can download the full guide here.

And if you missed the other Sitecore guides, you can find them below:

ASP.net Cascading Dropdownbox and Jquery

Background: A few days back as part of my .Net learning effort I had to deliver a task that depicts the below screen sampledemo

When the end-user types the username, the application should validate the username from the database and display his / her training details in the dropdown box named TopicNames and LevelName. The application then should display the details in the four text boxes based on the selection made in the two combo boxes. The data in the four text boxes should refresh without refreshing the entire page, if the user changes the selections in the combo box. I had several difficulties to accomplish this task, as I was new to this technology.  I wanted to share my lessons learned hoping it would be of great help to beginners or people who are not aware of Jquery in order to reduce redundant effort.

Project Technology

  • Visual Studio 2012
  • Database ( I used MySQL  )
  • ADO.Net Entity Framework
  • MVC
  • JQuery used for connecting to Server without refreshing the page

Read the rest of this post »

Windows Azure: How to create a streaming media service (GUI)

In my previous post I discussed how Microsoft and NBC were streaming every single event live and on demand at the Sochi Olympic Games.  Azure makes publishing and streaming videos easier than ever before.  This post will walk you through creating a media service, uploading content (video or audio), encoding it and publishing it for consumption.  We will do this all using the Azure management portal.

  • To start log into Azure and go to the portal (if you don’t have an Azure account you can get one for free at http://windows.azure.com).  Select ‘Media Services’ on the left hand navigation bar, then select ‘New’. NewMediaService
  • Fill in the requested information.  Note that in order to create your Media Service.  You must use and existing storage account or create a new one.  In this example we will be creating a new storage account.  This storage account will hold all of the media that we would like to stream from Azure.
    NewMediaService2
  • After you Media Service is created your dashboard should look similar to this.  Our next step is to upload some content.  Click on the ‘Upload’ button.
    NewMediaService3
  • You can select content to stream in two ways.  You can upload content you have stored locally on your computer, or you can “upload” content to Media Services that is already located in Azure blob storage.  The content can be located in any storage account you have access to in Azure.

Read the rest of this post »

MVC controller actions vs Web API vs SignalR – what to use?

Over the course of a last few years Microsoft unleashed two new web development frameworks: Web API and SignalR, both are suitable for asynchronous communications between web client and web server.  And, of course, we still have MVC controller actions that can be used for asynchronous communications too and can accept and return JSON objects. So, what’s the difference between these three frameworks and what are the best patterns and practices for using these?

communication 1. First, the MVC controller actions. ASP.NET MVC framework is a layer on top of good old ASP.NET and it was originally built support and traditional synchronous web development architecture where controller action is generating HTML as a response to HTTP requests and accepting HTTP form posts when the whole page is reloaded.  However, it’s also possible to call a controller action asynchronously from javascript passing JSON object as a parameter and getting JSON in response.
As MVC is built on top of ASP.NET it inherits ASP.NET paradigms like session support. HTTP protocol is stateless by it’s definition, however ASP.NET is supporting user session state.  Being statefull also means thread affinity.

2. Web API is looking very similar to MVC: there are controllers,  routes and filters. However, Web API is tracing it’s roots from the different source: WCF. Because of that, Web API doesn’t have a dependency from ASP.NET and could potentially be hosted on a web server which is different from IIS or could be self-hosted in application. Web API is stateless, asynchronous (Task<T> could be used as a return type for actions) and there are no thread affinity. Web API is very aware of HTTP verbs (like GET, PUT, DELETE, etc) and so it’s completely restful. In fact, the default routing setup for Web API doesn’t include action into the route.

Read the rest of this post »

Integrating ASP.NET MVC authentication with SiteMinder SSO

SiteMinder is an enterprise-class secure single sign-on solution by CA (Computer Associates) which is employed by many large companies to secure their intranet access and provide single sign-on functionality to various intranet applications.  SiteMinder has a broad support for different application frameworks which is making possible to use in heterogeneous enterprise environment.
For example, when SiteMinder is used to secure ASP.NET/IIS application then it’s normally configured as IIS handler. For example (in web.config):

<add name="handler-wa-32" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Program Files\CA\webagent\win32\bin\ISAPI6WebAgent.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,bitness32" />
sso SiteMinder module is intercepting every request to ASP.NET application resource and authenticating and authorizing user. If user is authenticated and authorized successfully then SiteMinder is passing the request further down the pipeline to ASP.NET.
So, how too integrate SiteMinder authentication with ASP.NET MVC authentication? SiteMinder is doing a great job for handling it on it’s own, but quite often MVC application will need to doit’s own, custom authorization in order to grant or deny user access to different resources, depending on user role.

Read the rest of this post »