Microsoft Virtual Academy Header Mastering Azure App Service, Part 4 Building Azure Mobile Apps Scott J. Peterson Produced by
Azure Mobile Apps Azure Mobile Apps make it easy to build cross-platform and native apps for iOS, Android, Windows, and Mac operating systems, seamlessly store data, authenticate users, and send push notifications.
Supported Languages & Tools Mobile Apps can be developed in both C# and Node.js and consuming apps can be developed in most supported languages on most platforms. Mobile App development is built into Visual Studio 2015 for supported languages and additional “in browser” tools are available in various forms.
The Agenda Mobile App Concepts Getting Started Developing Mobile Apps Authentication & Authorization Cross Platform Development Push Notifications Next Steps Tips & Tricks
Mobile App Concepts • Create or upgrade existing Mobile Apps • Azure Mobile App Services: • Connect to on-premises data • Robust authentication • Leverage offline scenarios • Broadcast push notifications
Mobile App Concepts • Backend exposed as a “enhanced” Azure Web App • Mobile App services easily accessible via REST API concepts for client apps • Single-source for: • Storage • Authentication • Notification
The Azure Mobile App Environment • Mobile Apps are part of the new “Web + Mobile” Suite • Mobile App management is not available via the “Classic” Azure Portal • Create and manage Mobile Apps in: • Azure Management Portal • Visual Studio 2015 • Other tools of your choice
Developing Mobile Apps Developing Azure Mobile Apps with Visual Studio is almost exactly like developing MVC-based or Web API solutions with Visual Studio, except that the Azure App Service can controls integration, authentication, and other cumbersome tasks.
Common Mobile App Concepts Client SDK or Server SDK Data and Synchronization Authentication Push Notifications Connected Services Scaling & Availability
Authentication & Authorization • Authentication types (or “flows”) • Server flow • Client flow • Mobile clients don’t (typically) redirect • Leverage App Service authentication settings • Leverage Mobile App authentication flows • Only the Mobile App clients offer easy “login” methods
Cross Platform Development Nothing changes in your Azure Mobile App “backend” Almost all client-side code can be shared Project for other target platforms can be added or removed as needed Xamarin is built into Visual Studio 2015 Azure App Services manage keys and stores
Push Notifications Every mobile platform needs push notifications sent in their own specific way Handling registration, queues, device availability, failover, scaling is totally unreasonable Azure Mobile App Notification Hubs handle everything Apps, App Identifiers, Packages must be registered and “known” by the platform and the Mobile App Notification Hub Tagged, targeted, and broadcasted communications Absolutely the best way to communicate across devices and platforms
Next Steps Dig deeper into Offline Data Synchronization and Local Stores Start migrating existing Mobile Services to Azure Mobile Apps. Start evaluating methods in your existing Mobile Apps that should be exposed as Azure API methods to integrate into your Mobile Apps. Start evaluating methods that can be reused as functions and create Azure Functions and integrate. Remote debugging is your best friend, get comfortable with it. Create Azure Mobile Apps and just test and alter the code, and then delete your projects and services. Evaluate your Azure Resource and Storage configurations.
Building Azure Mobile Apps Scott J. Peterson, MCSD, MCPSB, MCT Senior Enterprise Architect & Developer firstname.lastname@example.org
Tips & Tricks The new Azure Portal seems to respond better when using Firefox. Internet Explorer seems to respond better than Edge. When you first start developing Azure Mobile Apps give your API apps “junky” names. This makes it easier to go out and delete services afterwards so you don’t get charged for them. Wait to add Azure Mobile Authentication until the end of the development cycle if possible, to avoid complexity. Sometimes if you delete and recreate a Mobile app with the same name there is a 30 minute (or so) delay before Azure gets “un-confused”. It may think the service you just created is the old service. Be patient, Azure will figure it out. You can always call the “/.auth/me” endpoint from a backend HTTP request to grab token and other appropriate information. Try it out!