35
Application Lifecycle Management for SharePoint and Office 365 apps Chris O’Brien - MVP

Application Lifecycle Management for Office 365 development

Embed Size (px)

Citation preview

Page 1: Application Lifecycle Management for Office 365 development

Application Lifecycle Management for SharePoint and Office 365 appsChris O’Brien - MVP

Page 2: Application Lifecycle Management for Office 365 development

About me

Independent ConsultantHead of Development, Content and Code (UK)

www.sharepointnutsandbolts.com@ChrisO_Brien http://cob-sp.com/COBLinkedIn

Page 3: Application Lifecycle Management for Office 365 development

What do we mean by ALM?ALM focuses on:

• Efficient team development, with quality outputs• Planning for application upgrades• Predictable deployments

Things like:

• Continuous Integration/Continuous Deployment• Packages not built on dev machines• Code quality checks• Structured deployment process

Page 4: Application Lifecycle Management for Office 365 development

Remembering – SharePoint, ALM, and painNeeded:On-premises TFS serverOn-premises SharePoint VM to deploy toCustomisation of build processPowerShell remotingLots of custom PS scripts

http://sharepointci.codeplex.com

AAARGH!

Page 5: Application Lifecycle Management for Office 365 development

Good news!

ALM for ASP.NET apps is MUCH easier

Page 6: Application Lifecycle Management for Office 365 development

Flavours of app development

Worth considering Azure for ALM in dev phase, even if not real target

TypeOffice 365 appSharePoint Add-In/Office Add-In

HostingAzureOther cloudOn-prem IIS servers

Page 7: Application Lifecycle Management for Office 365 development

Continuous Deployment with Azure and Visual Studio Online

Developer checks-in

Build runs on hosted build

controller

Output automatically

deployed to Azure Web App

Page 8: Application Lifecycle Management for Office 365 development

DemoAutomated builds for apps (using Azure)

Page 9: Application Lifecycle Management for Office 365 development

Summary – CD with Azure and VS OnlineConfigure project for Office 365 integrationApp registered in Azure AD

Add solution to source control Create Azure Web App, select “publish from source control”

DONE!

Page 10: Application Lifecycle Management for Office 365 development

Managing Azure – old portal vs. newSome features not yet in both

In spring 2015, use:OLD – for Azure Active DirectoryNEW – for Azure Web App Deployment Slots

Page 11: Application Lifecycle Management for Office 365 development

Managing dev/test/prod for apps in Azure

Page 12: Application Lifecycle Management for Office 365 development

Using multiple Office 365 tenancies? Apps in Azure have some considerations! ** Specifically Office 365 apps i.e.

- Apps which use the Office 365 APIs- Apps which use Azure AD auth (for

SSO)

Page 13: Application Lifecycle Management for Office 365 development

The issueOffice 365 apps need to be registered in the “correct” Azure AD (tied to O365 tenancy)

So, app needs to be registered/deployed to EACH Azure subscription behind your tenancies

Page 14: Application Lifecycle Management for Office 365 development
Page 15: Application Lifecycle Management for Office 365 development

Dev/test/UAT/prod for apps in Azure – issueBUT: often, “test” Office 365 tenancies do not have: Domain integration (e.g. MyCompany.com, not

onmicrosoft.com) ..and therefore Single Sign-On (SSO) with O365 Full directory of real users AAD Sync Yammer Enterprise Production license type (e.g. E3/E4) Etc.

Page 16: Application Lifecycle Management for Office 365 development

The answer?

Azure Deployment Slots!

Page 17: Application Lifecycle Management for Office 365 development

Azure Web Apps - deployment slotsDefine additional “instances” of an Azure Web App (site)

Allow you to test purely in production Office 365 environment, BUT with dev/test/prod separation for apps (Azure sites)

Page 18: Application Lifecycle Management for Office 365 development

Azure Web Apps - deployment slotsEach site gets:

Different URL – with slot name

Own app settings Own connection strings Own SCM site

http://mysite.azurewebsites.net

http://mysite-dev.azurewebsites.nethttp://mysite-test.azurewebsites.net

Page 19: Application Lifecycle Management for Office 365 development

In Azure portal:

PowerShell:

“Swapping” deployment slotsSlots can be swapped to deploy updatesActually a DNS update, not copy of content

Process:Publish updates to dev/test slotsSwap test/production when ready

Switch-AzureWebsiteSlot –Name ‘COB website’ -Slot1 'Production' -Slot2 <slotName>

Page 20: Application Lifecycle Management for Office 365 development

DemoUsing Azure deployment slots for dev/test/production

Page 21: Application Lifecycle Management for Office 365 development

Summary – using deployment slots for appsCreate additional deployment slotsRegister separate instance of app in Azure AD:

https://msdn.microsoft.com/en-us/office/office365/howto/add-common-consent-manually

Configure “slot-specific” ClientID and PasswordDeploy app to slot

DONE!

Page 22: Application Lifecycle Management for Office 365 development

Update process using slots1. Continuous build deploys to DEV slot2. When ready, swap DEV and TEST

1. ..once testing is complete (and no rollback needed), then manually publish same build to DEV slot

2. ..now DEV and TEST are the same, but PROD is not

3. When ready, swap TEST and PROD1. ..once testing is complete (and no rollback needed), then swap DEV and TEST, and

manually publish same build to DEV slot2. ..now updates in PROD, and all slots are the same..

Page 23: Application Lifecycle Management for Office 365 development

More Azure coolness – “Testing in production”Traffic Routing - send some traffic to another slot

Uses:Testing new functionality on small number of usersA/B testing

Page 24: Application Lifecycle Management for Office 365 development

SharePoint Add-Ins

Page 25: Application Lifecycle Management for Office 365 development

OK, but what about SharePoint Add-Ins?Very easy to deploy/test against Office 365Very similar to Office 365 apps (especially provider-hosted), but:App registered with AppRegNew.aspxSpecify Office 365 tenant to test against (in build settings):

Page 26: Application Lifecycle Management for Office 365 development

OK, but what about SharePoint Add-Ins?Trusting the app:Link provided in build report

OR, use web test to “click the link”

Page 27: Application Lifecycle Management for Office 365 development

DemoContinuous Deployment for SharePoint Add-Ins

Page 28: Application Lifecycle Management for Office 365 development

Summary – CD for SharePoint Add-InsSame as for O365 app:Create Azure site, link to source control

SharePoint app specific:Use AppRegNew.aspx to register appDownload/edit publish profile – specify ClientID/Client SecretEdit build definition, specify:

Office 365 tenant to deploy toPath to publish profile (for app packaging)Azure site to deploy to

http://blogs.msdn.com/b/kaevans/archive/2014/04/02/deploying-a-sharepoint-app-to-azure-as-part-of-a-build.aspx

Page 29: Application Lifecycle Management for Office 365 development

Other variants1. Can’t use Visual Studio Online?Several options supportedSelect source in Azure Web App config

Page 30: Application Lifecycle Management for Office 365 development

Other variants2. Need to use an on-prem TFS build server?Use scripts at http://officesharepointci.codeplex.com

Page 31: Application Lifecycle Management for Office 365 development

Integrating quality checksTest the applicationRecord Coded UI Tests (requires on-prem build controller)Write unit tests

Check code qualityIntegrate SPCAF (for SharePoint apps or WSPs)http://docs.spcaf.com/v5/SPCAF_OVERVIEW_660_HOWTORUNSPCAFINTEAMBUILD.html

Page 32: Application Lifecycle Management for Office 365 development

Common errors/pitfallsInvalid credentials in O365 deployment site (build config)

App previously deployed not by build

Page 33: Application Lifecycle Management for Office 365 development

Some ALM go-to guys

Kirk Evans (Microsoft) http://blogs.msdn.com/b/kaevans

Matthias Einig (SPCAF) http://www.matthiaseinig.de

Jeremy Thake (Microsoft) http://www.jeremythake.com

Page 34: Application Lifecycle Management for Office 365 development

SummaryNever done automated builds before? Well, NOW is the time!

App development models mean SharePoint complexities are removed

Visual Studio Online can provide build mechanism

Azure can provide the deployment and hosting mechanism

Page 35: Application Lifecycle Management for Office 365 development

© 2015 Microsoft Corporation. All rights reserved.