While SharePoint Framework being the upcoming trend in 2017 for the modern SharePoint landscape, SharePoint developers not only saw their tool belt being extended but there was also a shift becoming a modern developer. With modern development some new tools were introduced for the SharePoint developers, like Gulp, Yeoman, Npm,... Development is one thing, but deploying these solutions? That's another matter.
Uploading wsp files to SharePoint servers and deploying web applications for SharePoint Add-in's to Azure, are already known actions.
But with SharePoint Framework, code has to be deployed to a hosting service as an Azure CDN or a SharePoint CDN/Library and the app package has to be uploaded to the app catalog (like with SharePoint add-ins). Those are new things for the 'classic' SharePoint developers, as also installing solutions by the use the new Application Lifecyle Management API of SharePoint which makes it possible to deploy by code.
This session will provide an overview of the deployment options to Azure and SharePoint and will provide a demo intensive part by creating a deployment tool to install/uninstall/retract/upgrade your app on specific sites and on specific site collection catalogs.
6. Package your webpart
• Use the bundle gulp task to build, localize, and bundle the project
• Use the package-solution gulp task to package the project into
a .sppkg file
• The ship parameter build task creates a minified version of the
bundle and copies all of the web part assets
8. Deploy App to the SharePoint App Catalog
Hint => Create a specific view for checked out packages
9. Upload static assets
• JSON source file
• Manifest for webpart
• JS Files
• Minified version of your code
• Localized strings
• Located in /temp/deploy folder
16. Update SPFx solution
• No need to update app on sites => webparts are
automaticaly using the latest code
• Attention! => Updating an app where SPFx v1.4 is
used, can break all webparts on the site.
=> v1.4.1 solves this problem
40. Enable the SharePoint CDN origin
• Open the SharePoint Online Management Shell
• Execute the following Powershell commands to enable the CDN, set
the CDN origin, and return the CDN Origin ID
48. SharePoint
Application
Lifecycle
Management
• Add SharePoint Framework solution or SharePoint Add-in to tenant
app catalog.
• Remove SharePoint Framework solution or SharePoint Add-in from
tenant app catalog.
• Enable SharePoint Framework solution or SharePoint Add-in to be
available for installation in tenant app catalog.
• Disable SharePoint Framework solution or SharePoint Add-in not to
be available for installation in tenant app catalog.
• Install SharePoint Framework solution or SharePoint Add-in from
tenant app catalog to a site.
• Upgrade SharePoint Framework solution or SharePoint Add-in to a
site, which has a newer version available in the tenant app catalog.
• Uninstall SharePoint Framework solution or SharePoint Add-in from
the site.
• List all and get details about SharePoint Framework solutions or
SharePoint Add-ins in the tenant app catalog.
Administrator enables Office 365 Public CDN for the tenant using SharePoint Online Management Shell.
Static assets to be shared from CDN are uploaded to the SharePoint libraries, which are enabled as CDN origins.
Assets are being exposed from the configured libraries and folders and they can be accessed using CDN URLs.
URLs pointing to CDN location are available to be used in the SharePoint sites and in the customizations hosted from SharePoint.
Open the SharePoint Online Management Shell.
Connect to your Office 365 Developer Tenant within PowerShell session by executing the following commands:
$creds = Get-Credential
Connect-SPOService -Url https://<TENANCY>-admin.sharepoint.com/ -Credential $creds
Enable the Public CDN in the tenant by executing the following command:
Set-SPOTenant -PublicCdnEnabled $true
Configure the allowed file extensions by executing the following command:
Set-SPOTenant -PublicCdnAllowedFileTypes "CSS,EOT,GIF,ICO,JPEG,JPG,JS,MAP,PNG,SVG,TTF,WOFF,TXT“
Add the CDN Origin by executing the following command:
New-SPOPublicCdnOrigin -Url "https://<TENANCY>.sharepoint.com/sites/dev/siteassets/cdn“
Get the CDN Origin Id by executing the following command:
Get-SPOPublicCdnOrigins