transitioning to sharepoint app development
Post on 28-Nov-2014
50 Views
Preview:
DESCRIPTION
TRANSCRIPT
TRANSITIONING TO SHAREPOINT APP DEVELOPMENT
Simon Rennocks
Principal Consultant
Microsoft Certified Master - SharePoint
ProSource Solutions LLC
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
SPEAKER BACKGROUND
Expertise
Principal Consultant
Microsoft Certified Master - SharePoint
ProSource Solutions LLC
18+ Years of Experience
Email srennocks@prosource-corp.com
Blog rennocks.wordpress.com
Twitter @simonrennocks
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
SESSION GOALS
• Understand why apps will replace full trust code
• Know how to create an on premise development environment for building apps
• Be able to create SharePoint apps on premise and in Office 365
• Know how to publish apps both on premise and to Office 365
• Follow the best practices for developing updates for apps
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
AGENDA
Building Apps
App Publishing
Updating Apps
Moving From Full Trust
Code
Getting Started with
Apps
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
MOVING FROM FULL TRUST CODE
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
CODE DIFFERENCES
Full Trust
Feature Receivers
Web Parts
Application Pages
Server-Side Code
Apps
App Event Receiver
App Parts
App Pages
Remote Server-side Code
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
OPERATIONAL COMPARSION
Full Trust
User Only Security
Elevated Permissions
Apps
User & App Security
Use “App Only”
Break Inheritance Request Permissions
No Resource Monitoring Resource Monitoring
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
DEPLOYMENT CHANGES
Full Trust
To Farm
Files in Hive
Assemblies in GAC
WSP Deployment
Apps
To Site Collection
Everything in Content DB
Assemblies Remote
.App Publishing
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
What challenges do full trust solutions pose?
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
WEB PART REFACTORING
Use client side code
Separate out
SharePoint code
Use REST endpoints
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
2010 CHALLENGES
Server-side Code
Full Permissions
Not following Best Practices
Performance and Errors
Unhandled Errors & Crashes
Slow Sites
Development Cycle
Long approval times
Cross Solution Testing
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
CROSS PLATFORM DEVELOPMENT
• Languages and technologies
• Lower entry bar
• MVC and MVVP support
• Expanded object model
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
How are apps different?
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
EVOLUTION OF OBJECT MODEL
SharePoint 2010SharePoint 2007SharePoint 2013
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
WHY APPS SHOULD BE USED
• Familiar programming model
• Multiple hosting options
• Flexible web experience
• Integrates with Office apps
• App available to users via–Office Store
– App Catalog
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
WHEN TO USE APPS
• Using SharePoint in Office 365
– Apps required
• If On-Premise
– Meets business requirements
• In the Cloud and On-Premise
– Best to use apps
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
WHAT HAVE WE COVERED?
ComparisonFull Trust
ChallengesHow Apps Can Help
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
GETTING STARTED WITH APPS
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
WHAT ARE APPS
• Lightweight web applications– Apps parts hosted in IFrame
• Web scoped–Own isolated app web
• Tenant “shared” scoped– Shared app web across multiple site collections
• Different authentication options– Azure ACS for low trust – on premise or O365
– Digital certificates for high trust – on premise only
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
TYPES OF APP
Immersive Full Page
App Part
UI Custom Action
NOT TENANT SCOPED
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
App Web
SHAREPOINT-HOSTED APP
1. Isolated app web
2. SharePoint Access
3. Cross-domain library
4. Tenant scope access
Host Web
1
3
JSOM
2
Other Site Collections
4JSOM REST
REST
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
PROVIDER-HOSTED APP
1. Client-side object model
2. App Web optional
3. Provide tenant isolation
4. Tenet Scope access
App Web
Host Web
Remote Web
1 2 3
Other Site Collections
1 4
32
REST
SCOM,REST, JSOM
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
What’s needed before we can create apps?
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
APP PREREQUISITES
On Premise Office 365
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
ON PREMISE SETUP
Create Development Farm
Provision Services
User Profile
App Management
Subscription Service
Create Isolated Domain
Configure Settings
App Domain
App Prefix
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
CREATING CERTIFICATES
• Create self-signed cert
• Create folder for certs
• Export certs to folder
• Give app pools access
• Register .cer with SP
• Project uses .pfx cert
• App uses .cer cert
IIS Project
AppRegister Cert
.cer.pfx.pfx
Folder
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
DEVELOPER TOOLS
• Office 365 developer subscription–Or use a site with developer template
– Develop using “Napa”
• Visual Studio– Professional or higher
– 2012 or 2013 plus latest updates
• Extensions required–Microsoft Office Developer Tools
– NuGet Package installer
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
APP INFRASTRUCTURE OVERVIEW
Where Stage RequirementSharePoint
HostedProvider Hosted
Setup
Provision app farm services
Create Isolated app domain Optional
Create certificates & configure trust High Trust
Configure access to Azure AD ACS Low Trust
Setup
Development site collection
Visual Studio 2012 or 2013
Create App catalog
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
Lets look at how to do this
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
DEMO
• Configuring a developer farm to support apps
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
WHAT HAVE WE LEARNED?
What are Apps
App Prerequisites
On Premise Setup
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
BUILDING APPS
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
APP PROJECT SETUP
• SharePoint location
• Specify hosting model
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
PROVIDER-HOSTED OPTIONS
• Choose web app type
• Choose authentication
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
SharePoint-Hosted
Provider-Hosted
APP PROJECT STRUCTURE
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
CLIENT WEB PART
Properties passed in query string
Properties Defined in here
Reference to web page
Default app part dimensions
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
JSOM PATTERN
• Get SharePoint context using app web url
• Define objects to get
• Execute to get objects
• Result sent to async event
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
CSOM PATTERN
• Pass in HttpContext to return SP context
• Create user context from the SP context
• Determine what we need
• Group as much in each Load as possible
• Execute to get the data
• Use the data returned
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
CROSS DOMAIN
• Get the app web and host web url’s
• Load the cross domain library from the host web
• Specify callback event to access host web objects
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
CROSS DOMAIN
• Get the app web context
• AppContextSite used to access host web
• Specify permissions need in AppManifest
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
HOST WEB PERMISSIONS
<AppPermissionRequests>
<AppPermissionRequest
Scope="http://sharepoint/content/sitecollection/web"
Right="Manage"
/>
</AppPermissionRequests>
AllowAppOnlyPolicy="true" >
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
How do we deploy app components?
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
APP COMPONENTS
• Type of app assets– SharePoint lists, document libraries
– Images, css and javascript files
• Deploy from app–When app first accessed
– Required host web manage rights
• Deploy using app event receiver– Receiver added to remote web
– Use azure web sites
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
ASSET DEPLOYMENT
• To app web– If isolation required
– Need to sell app
• To host web– Easier user access
– Shared app access
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
APP EVENT RECEIVERS
• From app project– Enable property pane
– Service endpoint added to AppManifest
• In web project– Receiver service code class
• Debugging possible– Requires azure service bus reference
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
Lets create some Apps
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
DEMO
• Create a Provider-hosted app–Office 365
– App event receiver for components
Alt
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
THE APP BUILT AND PUBLISHED
Creating an App
App Components
Demo App
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
APP PUBLISHING
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
APP REGISTRATION – HIGH TRUST
• Provider-hosted apps– Use AppRegNew.aspx Same as Client Id
Hosting url
Required only for apps launched from outside of SharePoint
Not used in high trust apps
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
HIGH TRUST SETUP
• Create web site– In web.config add
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
How do we publish low trust apps?
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
APP REGISTRATION – LOW TRUST
• Provider-hosted apps– Use AppRegNew.aspx Same as Client Id
Hosting url
Required only for apps launched from outside of SharePoint
Same as Client Secret
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
AZURE WEB SITES
Add client Id & secret to app settings
Download Publishing Profile
Create web site
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
APP DEPLOYMENT – LOW TRUST
App project
Client Id and secret
Publish app
Add to app
catalog
Web project
Add publishing
profile
Publish web to azure
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
Lets publish our App
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
DEMO
• Publish a low trust app to Office 365
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
THE APP IS PUBLISHED
High Trust Apps
Low Trust O365 Apps
Publishing Demo
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
UPDATING APPS
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
UPDATE BETTER THAN REPLACING
Update due to
• Required for store apps
• Data preserved
Replace will not work
• No control on what users do with App
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
KEY POINTS
• Users may not update app–One app version
– Same version after update
– Update logic relies on version number
• Rolls back on error– All components
–App data not lost–Mostly automatic except for custom logic
– Errors reported to UI
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
EDGE CASE RISKS
• Installing too little– User using version 1 of app
–Missed going to version 2
– Updates to version 3
– Update logic fails to add version 2 list
– App fails on displaying version 2 list
• Installing too much– User updates from version 2 to 3
– Update logic tries to re-add version 2 list
– Update fails due to existing list
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
How should we update Apps?
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
Previous updates in version range
Current update
<EndRange = 2.0.0.0>
1.000 - 1.999 For version 1
APP PROJECT PATTERNS
• App web project feature– Use same version as app
• Feature upgrade actions– Never use “Begin Range”
– “End Range” exclusive
• Client web part– Always change name
– Removes old versions
<EndRange = 3.0.0.0>
2.000 - 2.999 For version 1 & 2
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
PROVIDER-HOSTED VERSIONING
Pass In App Version
Page V 1
Page V 3Page V 3
App V 1 App V 1
App V 3
?
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
UPDATE LOGIC
• Same as app feature pattern
• Add logic to install receiver without checks
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
ROLL BACK ON ERROR
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
TELL SHAREPOINT
• Result is an SPRemoteEventResult object
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
Finally, lets update an app
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
DEMO
• Updating our App
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
THE APP IS UPDATED
The shift to Updating
How to Update
Demo
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
SUMMARY
Building Apps
App Publishing
Updating Apps
Moving From Full Trust
Code
Getting Started with
Apps
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
CALL TO ACTION
• Get an O365 Developer License
• Join the PnP Yammer Group
• Visit the PnP GitHub
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
FINAL COMMENT
• Now we have a tools and the understanding to create apps and move away from full trust code
• Thank you for listening
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
QUESTIONS?
srennocks@prosource-corp.com
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
Established in 2009
Offices in Richfield, OH + Atlanta, GA
Areas of Expertise:• Application Development Consulting
• Cloud Consulting
• Core Infrastructure Consulting
• Managed Services
• Staffing Services
COMPANY OVERVIEW
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
MICROSOFT PARTNERSHIP
Awards & Recognition• Microsoft 2014 Partner of the Year,
U.S. Enterprise Services
• Microsoft 2013 Partner of the Year, U.S. Enterprise Services, Commercial Sector
• Microsoft 2012 Partner of the Year, U.S. Enterprise Services, Commercial Sector
• Microsoft 2011 Partner of the Year, U.S. Enterprise Services
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
OUR VALUES: THE FOUNDATION
QUALITYWe’re about getting the job done right, developing supportable solutions that perform to our client’s requirements.
VALUEWorking with us will yield excellent value for our client’s investment.
EXCELLENCEWe use our best talent and abilities to create practical and usable software and services.
TRUSTWe partner with our clients to deliver on- time, within budget, with our long-term success a top priority.
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
OUR AREAS OF EXPERTISEWhere we SHINE and do AMAZING work!
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
We enhance and extend current product functionality or develop new software applications and capabilities. We ensure that your applications support your immediate and future business needs. We also help leverage and integrate into your existing systems and devices, enabling you to take better advantage of your investments.
APPLICATION DEVELOPMENT
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
We help you leverage your existing investments, infrastructure and skill sets to build the right cloud solution for your business—one that will scale securely and work for you today and in the future.
CLOUD
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
We bring proven methodologies, tools and processes to enable easier manageability, monitoring, implementations, migrations and updates to key infrastructure technologies. This also includes adoption of cloud solutions when it is appropriate for your business.
CORE INFRASTRUCTURE
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
We enable you to optimize and reduce the cost of key business systems by managing your Windows ™ infrastructure – servers and software – by providing remote technical support assistance. Our best in class tools and resources provide peace of mind when tackling the challenges of managing your infrastructure, freeing you up to focus on strategic business needs.
MANAGED SERVICES
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
We pair the right technologist with the right company – whether it’s for a short-term engagement or long-term employment. We access the needs, goals and personalities to make the right fit.
STAFFING
ProSource Solutions, LLC. | www.prosourcesolutionsllc.com
Financial Services
Manufacturing Government Healthcare Services
INDUSTRIES WE SERVE
top related