Walkthrough: how to deploy spfx sample webparts

A while ago I did a short series on how to provision and deploy the SharePoint Starter Kit. From this, I thought it would be fun to detail how to take one of the many, great spfx web part samples available in the SharePoint GitHut repository and go through the steps involved to deploy it end to end.

As with my last series on the SharePoint Starter Kit and generally with all my posts my aim is to simplify and detail every step involved to show that you can these things working without huge effort of developer expertise, I am not a developer by any stretch of the imagination so hopefully putting all the pieces together is useful 🙂

spfx client-side web parts

All the samples are available in the sp-dev-fx-webparts repository on GitHub from the link below. For the purpose of this example, I am deploying the Modern Experience Theme Manager web part, as I wanted to test out how easy it makes applying, removing and updating custom themes (it does).

https://github.com/SharePoint/sp-dev-fx-webparts
https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/js-theme-manager

Pre-requisites

All of the pre-requirement steps detailed in part one of my SharePoint Starter Kit series are also required for deploying web parts. Make sure you have followed all the steps here before continuing:

How to provision and deploy the SharePoint Starter Kit: part one

Install GitHub

Before you can begin, it’s much easier to clone a repository from GitHub than downloading and extracting a zip file. I also couldn’t get the web part to open from the localhost workbench when I manually downloaded the code.

You can install github for desktop here: https://desktop.github.com/

NOTE: I originally wrote this walkthrough a while back, when I came to finish it up I tried to update by cloned repo but it just wouldn’t work. I just removed the repo from Github desktop, then deleted all the files from the /sp-dev-fx-webparts/ sub-folder and cloned from scratch and it worked.

Make sure a developer certificate is installed

If you followed my SharePoint Starter Kit series, you can skip this step as you’ll of already done it, but if not run the following to install a dev certificate: gulp trust-dev-cert

Step 1: get the webpart working locally

Clone repository/ run web part on localhost

Now we need clone and build the repository to start using the webpart sample. Clone the repository by following the steps below:

  • Open cmd prompt, then navigate to the samples folder > then the web part samples folder you wish to use for example:
cd \sp-dev-fx-webparts\samples\js-theme-manager
  • Run the following command to install the npm packages to build and run the client-side project
npm install
  • Run the following command to preview your web part in the SharePoint Workbench
gulp serve

Your browser should now open and a localhost version of SharePoint Workbench will allow you to add the web part and access the properties:

(When I first wrote this I was using a different webpart as an example)

NOTE: I tried this using IE at first, it didn’t open at all, so i just switched to using another browser and the workbench loaded just fine.

Test the web part in your tenant workbench

Copy the URL of the localhost workbench, open a new browser window and paste the URL but update it to reflect your sharepoint tenant, for example:

https://sstuff.sharepoint.com/sites/dev/_layouts/15/workbench.aspx

Step 2: package and (soft) deploy!

Package/ deploy the web part to your tenant

Now we have tested our web part is working locally and within the context of our sharepoint tenancy, we can now package our solution and deploy into our SharePoint environment.

  • If gulp serve is still running, press CTRL+C to stop it in cmd prompt
  • In cmd prompt, enter the following command
gulp package-solution
  • This command creates a package in the sharepoint/solution folder called something like “js-theme-manager.sppkg”
  • Navigate to your SharePoint Admin site, open the app catalog site, under apps for sharepoint, drag and drop your sppkg file
Drag and drop the sppkg file straight into apps for SharePoint
  • Press the deploy button on the pop-up window, notice the localhost domain is showing here, we will need to change this once we’ve tested our web part is working
  • Back to the console, run gulp serve to make the local assets available for the web part
  • Navigate to a site where you want to deploy the webpart, press the cog button, add an app
  • Select the webpart you just added (this might take a minute or two to be available)
Add the newly added app to your SharePoint site
  • Add your new webpart to a page!

Enable CDN for your tenant

Now we’ve deployed and tested the webpart in our SharePoint environment, we can update our solution to host the assets directly in our tenancy or a content delivery network .

  • Open PowerShell, connect to your SharePoint Online tenant using the following command:
Connect-SPOService -Url https://contoso-admin.sharepoint.com
  • Get the current status of public CDN settings from the tenant level by executing the following commands one-by-one.
Get-SPOTenantCdnEnabled -CdnType Public
Get-SPOTenantCdnOrigins -CdnType Public
Get-SPOTenantCdnPolicies -CdnType Public

spfx solutions can automatically benefit from the Office 365 Public CDN as long as it’s enabled in your tenant. When CDN is enabled, */CLIENTSIDEASSETS origin is automatically added as a valid origin.

  • Enable public CDN in the tenant by running the following command:
Set-SPOTenantCdnEnabled -CdnType Public
  • Confirm settings by selecting Y and then Enter

Step 3: ready for final deployment

Go back to the console, make sure you are still in the relevant web part project directory, end sure gulp serve by pressing CTRL+C.

  • Open explorer, then open the package-solution.json in a code editor, from the config folder and check you see the following:
"includeClientSideAssets": true,
  • Run the following task to bundle the solution:
gulp bundle --ship
  • Then, run the following task to package your solution:
gulp package-solution --ship
  • From the same sharepoint/solution folder, drag & drop the newly updated solution package into the app catalog again. As it already exists, press Replace
  • Check the domain now shows as SharePoint Online, rather than localhost
  • Make sure your updated app isn’t checked out, if it is – check it in
  • Navigate back to where you previously deployed the app, add it to a page and test that it works!

Microsoft 365 update for May 2019

I decided to hold fire on posting a full write up from the SharePoint Conference to create a bumper edition of this month’s update.

I’ll include several of the bigger announcments coming out of SPC19, but ill include a full list of links to all the annocument recaps coming out of the event for more information.

In this month’s update:

SharePoint

SharePoint home sites

One of the most requested features of the modern experience for SharePoint is the ability to have the default or ‘root’ SharePoint site in the full modern experience. Home sites can be any commication site in your environment, that come with ‘superpowers’ such as:

  • News from home sites becomes organisational news
  • Search from home sites becomes tenant wide
  • Shared branding with the SharePoint start page
  • Unique mobile app experience

SharePoint home sites are being targeted to be rolled out around Q3 2019.

Find out more:

Sensitivity labels for SharePoint sites

Currently in private preview, Sensitivity Labels allow you to apply consistent security and access policies to SharePoint sites based on the sensitivity of the site.

Sensitivity labels with protection now supported

You can now experience the same collaborative capabilities for Office files protected with sensitivity labels in Microsoft 365 in SharePoint and OneDrive as files with no protection applied. Files with labels applied will be encrypted on upload by Azure Information Protection and understand the policies applied to the document by the label.

External access expiration

Tenant-scoped external sharing expiration allows admins to specify how long external users can have access to sites and their contents. Once the maximum period of time for external sharing links has been met, access if revoked unless extended by the administrator.

Find out more:

SharePoint admin center improvements

There have lots of improvements since the new SharePoint admin center was released to preview earlier this year. Here are some major updates from this month:

  • Classic features now available in new admin center
  • Support for performing bulk actions against a collection of sites
  • Ability to rename sites (GREAT NEWS!)
  • Improved sharing controls
  • Windows PowerShell cmdlet (invoke-spositeswap) that allows you to replace the root site within a tenant with an existing site (ALSO GREAT NEWS!)
Find out more:

Data bar formatting for number columns

Column formatting in SharePoint lists & libraries continues to improve, you can now format number columns with chart-like data bars!

Find out more:

DLP for restricted access

A new security control (in private preview) that blocks external sharing of files in OneDrive and SharePoint until a DLP scan has been completed. This prevents overexposure of sensitive information and compliance with policies set by the tenant administrator.

DLP for restricted sharing

Another new security control (coming to private preview Q3 2019), that coincides with easy sharing with anonymous links, but once files are scanned by DLP and flagged as sensitive, anonymous access to the file is blocked.

Find out more:

App Pages and Teams tabs

Now in GA with SharePoint Framework 1.8, app pages make it possible to add full-page tools in SharePoint. Available through a new create page experinece, team members can add application pages to existing sites.

You can also add more Teams tabs directly into your SharePoint sites.

Find out more:

SharePoint Migration Tool updates

SharePoint 2013 full site migration GA

Announced earlier this year, full site migrations for SharePoint server 2013 now enters GA. This includes migration support for the following:

  • Document lists and libraries
  • SharePoint list templates (see full list here)
  • Out of the box sites (sites not utilising any code or 3rd party tools)
  • Navigation & icons
  • Site descriptions
  • SharePoint web parts (see supported web parts here)
  • Pages (including site asset library pages)
  • Managed metadata (including content types and term stores)

Additional language support

The migration tool is now localised for 11 different languages, support for Chinese (Simplified and Traditional), French, German, Italian, Japanese, Korean, Portuguese, Russian, Spanish & English.

SharePoint 2010 migration support

Huge news for those of us still toiling away on SP2010 😀 with end of extended support for SharePoint 2010 less than 15 months away, you can now start to migrate content from SharePoint 2010 to Office 365.

Find out more:

SharePoint Server improvements

Announced at SPC2019, SharePoint Server 2019 provides more flexible deployment options to include support for Azure Stack and SQL Managed Instances.

A managed instance in Azure SQL Database is a fully managed SQL Server Database Engine Instance hosted in Azure cloud. Support is also being extended for deploying SharePoint Server 2016 (SharePoint Server 2019) on Azure Stack so you can build and run SharePoint environments using consistent Azure services on-premises.

Find out more:

Teams

Proximity-based meeting join

Proximity-based meeting join for Microsoft Teams Rooms means that the Teams app on your desktop or mobile will find a Teams-enabled room for you to use that is nearby and available. Available now for your desktop and mobile clients, and will start working automatically. 

“Meeting started” notifications on your phone

You can now receive “meeting started” notifications on your phone when someone joins a Teams meeting on your calendar. You can join the meeting right from the notification, and skip searching for the correct meeting in your calendar.

Find out more:

Busy-on-busy signals

Busy on Busy is a feature that allows callers to know a user’s status when contacting them. When a user is already in a call or meeting, this setting alerts the caller that they are on another call by playing a busy signal. This feature is automatically available in your Teams experience.  

New Calls App

Voice over IP (VOIP) enabled users will now see the Calls App in the App bar in the Desktop and Web Clients, with voicemal coming soon. There is no change in functionality for existing users or calling policy configuration.

Call Me functionality

You can now join meetings through a “Call me” functionality both from pre-join screen and during the meeting. To use this feature, you need to provide a phone number where you can receive a phone call.

Find out more:

Read-only material with Class Materials

The new Class Materials folder in the General channel of Microsoft Teams for Education allows you to share files with students, without the ability to edit.

Find out more:

Manage membership on mobile

Manage your team and add new members straight from the Teams app on your phone. Invite guests from outside your organization via their email address using your mobile app.

Export reporting data from the admin center

You can now export Teams usage reports to CSV files for offline analysis. After selecting a report in the Analytics and reports section of the Microsoft Teams admin center, click Export to Excel.


OneDrive

Full-fidelity experience for shared libraries

You can now view shared libraries with full-fidelity from the OneDrive UI on the web. This means you can create new documents, pin important ones to the top, create views, manage metadata, share and more.

Full-fidelity experience for shared libraries
Find out more:

Preview more files than ever before

You can preview more than 320 file types in OneDrive, including 360-degree images and AutoCAD DWG files.

Comments on non-Office files

Collaborators can now add comments to any of the 320+ file with new support for comments on non-Office files.

Animated image of a comment left in a Word document stored in OneDrive.
Find out more:

New records management capabilities

You can now use native connectors to import non-Microsoft 365 data, like data from Facebook and Twitter into the 365 cloud for archival purposes. A new records management solution helps you easily manage business, legal, and HR records in a single location.

Find out more:

Quizzes, polls and forms in Stream

You can now add quizzes, forms, or polls directly into Microsoft Stream videos. The Forms integration into Microsoft Stream helps presenters interact with their audience and gives them a way to solicit feedback.

You can also now securely record, upload, and share video from the Microsoft Stream mobile app.

Animated screenshot of a video being played in Microsoft Stream.
Find out more:

Question and answer feature in Yammer

The new question and answer feature allows you toask a question, then you or a group admin can mark the best answer – making the knowledge easier to share and reuse in the future. Additionally, a group can feature intelligent, bot-like responses to frequently asked questions.

Animated image portraying Yammer question and answer functionality. A cursor clicks "mark best answer" on a person's reply.

Geo-data storage capabilities in Yammer

Microsoft are accelerating availability of in-geo data storage for Yammer in the EU, available now. This means that now Yammer messages and files attached to Yammer messages will be stored at-rest in our EU datacenters, for new Yammer networks in the EU.

Find out more:

Microsoft Search enters GA

Microsoft search is now generally avalible, offering a unified, consistent search experience to help you discover relevant people, content, commands, and activities across all the Microsoft 365 experiences you use daily.

Find out more:

Block downloading option for sharing links

The sharing links feature that blocks downloads is being updated. The updated feature will block downloads, disallow printing, or copying of a file. Block download is now available when using the “Specific people” sharing link type.

Users will be able to create “block download” links from File Explorer, Office apps, and the rest of the apps which use the common Office 365 file sharing experience.

Find out more:

Planner and To-Do intergrations

You can now see all your tasks across Microsoft 365 in To-Do, including flagged emails in Outlook and tasks assigned in Planner. View your tasks, deadlines, and details, and plan to get more done throughout your days.

Animated screenshot of Microsoft To-Do and Planner integration.
Find out more:

Microsoft Graph data connect enters GA

Announced this month, the general availabity of Microsoft Graph data connect. This service helps bring together productivity data from the Microsoft Graph with business data and derive deep insights about effective work patterns.

Find out more:

Links and resources


If you’ve made it this far…wow well done! Apologies this was such a long update, I wanted to make sure I included all of the updates from the SPC19, plus the various pitstops and what’s new blog posts for each of the products we cover in our monthly update.

Finally, the main inspiration for this monthly update, Jim Naroski’s new in 365 video series seems to have changed – with no more Jim. This change for me is definately for this worst, as expressed in the comments section too by the looks of it. Hopefully its a one time thing, but if not Jim’s personal touch to delivering all the latest 365 news spurs me on to continue my own series.

#bringbackjim