Category: Uncategorized

Connect to new Office 365 Group

Creating Office 365 groups has already been a feature in Office 365 for a while. But there still was a missing piece for the old project-and team sites of SharePoint Online where users wanted to ‘migrate’ their site to the capabilities of an Office 365 group.

A Tenant administrator could already do the trick of ‘groupify’¬†the site and create an Office 365 group of it. But from an end-user perspective there wasn’t really an option other than smiling to the tenant administrator.

Luckily it’s now available for end users in targeted release (or first release ūüôā ) tenants and will probably go globally available soon.

 

What is “Connect an Office 365 group”

Like said in the introduction, your classic SharePoint Online site will be tranformed into an Office 365 with the following additional capabilities:

  • The modern pages are activated on your site, and the home page is changed to a modern one.
  • When filling in the owners of the group, they will become the site collection administrators and are added to the owners group of the site. Group Members are added to the members group.
  • Office 365 Group features like Planner, Conversations, Calendar… are also added to the newly created group.

Tenant administrators can disable this feature by going to the tenant settings of the SharePoint environment (classic admin center), https://[TENANT]-admin.sharepoint.com/_layouts/15/online/TenantSettings.aspx
Under the category Connections from sites to Office 365 groups one can disable the feature by setting it to 

Besides the content (documents..) of the site, are the site pages also migrated to the “new” site collection. They are still in classic mode, but they contains all the webparts that where configured. So there is no work lost of your “old” site. If you didn’t change the old homepage (home.aspx), then the “new” created site collection just contains a modern home(1).aspx, which is the new homepage of your site collection.

 

How?

From an end-user perspective, you can transform your classic site to an Office 365 Group by simply selecting the gear icon and select Connect to new Office 365 Group.

Selecting Connect to new Office 365 Group will result in an overview page about what will be created by Office 365 for your site collection:

 

Next, you will be guided through the default steps you have to pass when creating an Office 365 Group:

 

 

Passing through all steps, will result in a modern SharePoint Online site collection and a modern homepage.

 

 

More information about this newly added feature can be found at the official documentation of Microsoft (where it is still defined as to be released) => https://docs.microsoft.com/en-us/sharepoint/dev/features/groupify/groupify-overview

OneDrive – Some files weren’t downloaded.

Recently my colleague and me were wondering why we bumped into a specific scenario where weren’t able to download (all the) files from a shared resource on OneDrive.
The only thing we were able to see is we downloaded a .zip file with some files and folders in it with an extra file (__All_Errors.txt) containing the following text:

Indeed, a description that doesn’t explain a lot. It simply says there is something wrong, but what? In OneDrive itself, there wasn’t a error or warning popping up, so were where up to our self to find out what’s wrong.

What did we upload?

First of all let’s see what we uploaded to OneDrive. Basically, it was a .zip file contains folders and files (multiple types: .txt, .exe, .html…) that was zipped by using 7-ZIP.

Resulting in the following structure in OneDrive:

Resolution

After trying a lot of things (different compression methods, different compressing tools, security settings of the download link),  we came up with the following (pretty simple) resolution:

The download only results in the error file if you want to download a specific subfolder from the uploaded .zip-file. So make sure you uncheck the subfolders and files.
As you can see in the animation below, you have the possibility to only download a specific subfolder:

So simply download the whole folder/.zip instead of a subfolder until Microsoft fixes this issue.

SharePoint Application Lifecycle Management API – How to use it in your code

As described in my previous post РInstall & Uninstall SharePoint apps by code announced at ESPC 2017РMicrosoft announced an Application Lifecycle Management (ALM) API to install, uninstall, deploy, retract, upgrade, and remove your applications from the app catalog of your tenant and/or a specific site collection app catalog (available early 2018).

Microsoft documentation

This API is useful when you want to automate your deployment management of your SPFx solutions and add-ins, which you can do by using, e.g. a console application.
A real world scenario could be that you developed an SPFx solution for a specific set of sites and you want to push that solution onto these sites. Then you can create a console application which retrieves the ID of the solution (or app as it is called by Microsoft in the app catalog), and install it specific on these sites. If there was already an older version installed on the site, the API will upgrade the solution to the newest version that is available in the app catalog.

The PnP team did already a great job by providing an extension for their PnP CSOM project. It includes a new ALM class that contains an AppManager, the AppManager provides you the posibility to execute the specific calls as install/uninstall/upgrade… for a specific site.

How to develop this console application? This blog post will provide you a step by step guide to create the application with ‘real’ REST calls to the API and with the PnP CSOM extension.

By using PnP CSOM extension for the ALM API

Once you created a new console application project in Visual Studio, add the SharePointPnPCoreOnline Nuget Package and include the following references in your program.cs file:

  • OfficeDevPnP.Core.ALM
  • Microsoft.SharePoint.Client

First thing to do is to create a secure connection to SharePoint Online. With that connection, we can retrieve a valid ClientContext, which is necessary to create an AppManager object.

This can be done by using the SharePointOnlineCredentials implemantation that requires a username (string) and a password (SecureString).

Get available apps

From that moment we have the AppManager object, so we can execute several actions. To get more information about a specific app/solution, we can use the GetAvailable() method of the AppManager. This method will execute a call to the ALM API and returns a list of all available apps for the specific site of the ClientContext.

As you can notice, we are retrieving a list of AppMetadata that contains the following information:

Install a app on a specific site

If you want to install a specific app, you can choose to provide the complete AppMetadata object or the app/solution id to the install method.

Upgrade an app on a specific site

The property CanUpgrade indicates if their is a newer version available in the app catalog than the version that is installed on the site. If there is a newer version available, the upgrade method can be used to get the app/solution to the latest version.

Add solution package to tenant app catalog

Adding a solution (app package => .sppkg) can currently only being done to the tenant app catalog and not yet to a site collection app catalog. So this request has to be targeted to the tenant app catalog site:

Deploy solution package in tenant app catalog

Before the solution is avaible for installation on sites, it has to be enabled/deployed into the tenant. This is also only possible for the tenant app catalog, so not on site collection level.

Retract and remove solution package in the tenant app catalog

If your app is no longer needed on your tenant, you can use the retract and remove action to remove it.  This is also only possible for the tenant app catalog, so not on site collection level.

By using your own REST calls to the ALM API

As with the PnP chapter; once you created a new console application project in Visual Studio, you can add the SharePointPnPCoreOnline Nuget Package and include the following reference in your program.cs file:

  • Microsoft.SharePoint.Client

An extra thing here is that you have to take care of the Authorization header, cookies, URL’s, request method, and parsing all by yourself. This is more difficult but possible like shown in the following code example:

This response will contain a list of all the available apps for the specific site and further on you can use the ID (and not the whole metadata als with the PnP extension) to install/upgrade… an app.

Installing an app can be done by the url:¬†/_api/web/tenantappcatalog/AvailableApps/GetById(‘GUID’)/Install, and needs to be used in a POST request:

The other calls like adding, deploying, retracting, removing.. can definitly be done by simple REST calls, but are prety much the same as described above.

Recap

As you can see the new ALM API is really powerful and can help a lot of SharePoint teams to create an automatic deploy process for their apps. It can also help these teams to push specific apps to specific sites to increase the usage and installment rate of their apps/solutions.

Creating a console application with ‘custom’ HTTP call to the API is way more difficult than using the PnP extension. So if it is possible and allowed by your internal company policy, PnP is definitely the way to go.

Extra references: