Building Windows Phone Apps with Windows Azure Mobile Services

  • Published on
    12-Feb-2016

  • View
    28

  • Download
    0

DESCRIPTION

Building Windows Phone Apps with Windows Azure Mobile Services. Dmitry Krainyk DataArt. Agenda. Windows Azure Mobile Services Data Push Notifications Auth Diagnostics & Scale. What is Windows Azure Mobile Services?. Auth. Data. Notifications. Logging & Diag. Server Logic. - PowerPoint PPT Presentation

Transcript

Building Connected Windows 8 Apps with Windows Azure Mobile ServicesBuilding Windows Phone Apps with Windows Azure Mobile ServicesDmitry KrainykDataArt 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.10/27/20131Windows Azure Mobile ServicesDataPush NotificationsAuthDiagnostics & ScaleAgendaWhat is Windows Azure Mobile Services?DataNotificationsAuthServer LogicLogging & DiagScaleSchedulerSlide Objectives:Provide broad overview of WA Mobile Services featuresSpeaking Points:WAMS Backend for mobile clients.WAMSBuild a cloud backend in minutes with no hassles, no deployments, no fearSupports Windows 8 client SDK, Windows Phone 8 SDK, iOS SDK Android coming soonDataStructured Storage with SQL DatabaseAutomatic service api generated for storageRich querying capabilityServer LogicAutomatic CRUD service api generatedAbility to author server logic that intercepts CRUD operation pipelineAuthAuthenticate against Windows LiveTable level authorization with no code More granular control with server side scriptsNotificationsIntegrates with WNS to provide Toast, Tile, Badge and Raw notificationsClean object model to compose notificationsSchedulerScheduler allows you to run Scripts to perform tasks at a scheduled basis minutes, hrly, daily, monthly or on demand.Example aggregate News RSS feeds and send a tile update every 15 minutes Logging and Diagnostics for monitoringScale out and Scale up 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.10/27/20133Key ScenariosWindows Azure Mobile Services are ideal for:Modern mobile appsWindows Store Apps, Windows Phone, iOS, AndroidCommon ScenariosReduces the friction associated with repeating common tasks such as user authentication, push notifications and structured storageRapid DevelopmentTime is money. Get your app up and running sooner when you use Mobile Services to configure a straightforward and secure backend in less than five minutes.Slide Objectives:Outline the Key Scenarios Mobile Services can be used for4Server LogicAutomatic service REST API generated for storageDynamic Schema on/offAbility to author server logic that intercepts CRUD operation pipelineRich querying capabilityCustom APISlide Objectives:Detail the Server Logic capabilitySpeaking Points:On creating of a Mobile Service a dynamic REST API is generated that sits on top of your structured storageDynamic SchemaWhen Dynamic Schema is enabled, your Mobile Service will automatically add columns to tables as necessary to store incoming data.When Dynamic Schema is disabled, your Mobile Service will only accept data whose properties correspond to existing columns on your tables.5Server LogicSupported Modules + Globalsmssqlrequestconsolepush.*tablesstatusCodesmssql.query('select top 1 * from statusupdates', { success: function(results) { console.log(results); } }); Slide Objectives:Detail the Modules and Globals available to server side scripts.Speaking Points:Talk through the slidePush.* currently supports push notifications for W8 (push.wns), WP8 (push.mpns), iOS (push.apns), Android coming soonA subset of Node.js modules are also supportedPerforming SQL queries is something that some people are not aware of. Instead of tables if you want to use mssql you can execute sql directly. One useful example of this would be to execute a store procedureLatest full list here: http://msdn.microsoft.com/en-us/library/windowsazure/jj554226.aspx 6Structured StorageStructured Storage with SQL DatabaseIf using single database apps are partitioned by schemaAppX.TodoitemAppY.TodoitemManage data inPortalSQL PortalSQL Management StudioREST APISlide Objectives:Detail the structured storage featureSpeaking Points:Structured storage provided by WAMS is backed by a Windows Azure SQL DatabaseDB can be Multi-tenant i.e 10 Mobile services can all use the one SQL Database. In this scenario each DB is partitioned by SchemaMultiple ways admins can access the raw data being stored. 7REST API to SQL type mappingsJSON ValueT-SQL TypeNumeric values (integer, decimal, floating point)FloatBoolean BitDateTimeDateTimeOffset(3)String Nvarchar(max)Slide Objectives:Detail the current REST API JSON value to T-SQL type mappingsSpeaking Points:Table shows the current JSON type mapping to T-SQL mapping used when columns are dynamically generated.As we iterate on mobile services you will see the list of type mappings grow8Push Notification Lifecycle OverviewRequest Channel URIRegister with your Cloud ServiceAuthenticate & Push NotificationWP 8NotificationClient PlatformAppMobile ServicesWindows Push Notification Service(1)(2)(3)(3)Slide Objectives:Detail the push notification lifecycle to give context for the demo coming upWNS is freeSpeaking Points:Show the start screen and talk about how push notifications can be used to lightup the start screenGreen components are those FREE services Microsoft providesBlue components are those components that the application developer must write.Step 1 using the WinRT API request a channel. A channel uniquely identifies an app and its tile.Step 2 channel is then registered and stored in your Mobile serviceStep 3 When your application specific logic determines that it is time to send a notification you can retrieve the channel and compose a notification to be sent. This is a two step process that first requires your service to auth against WNS and then compose and send a notification. Mobile Services makes this step incredibly easy.Step 3 - part 2 WNS will take care of delivering the notification and the Notification client platform will deal with surfacing that notification for you and rendering the tile/toast/badge etc9Auth*Authenticate against Microsoft Account, Twitter, Facebook, GoogleTable level permissions for each CRUD operationEveryoneAnyone with the Application KeyOnly Authenticated UsersOnly Scripts and AdminsMore granular control with server side scriptsuser.level: {admin, authenticated, anonymous}user.userId: id or undefined if not authenticatedSlide Objectives:Detail Auth optionsSpeaking Points:Windows Azure Mobile Services enables you to set the following permissions on table operations: Everyone: This means that any request for the operation against the table is accepted. This option leaves your data wide-open for everyone to access. Anybody with the Application Key: Only the correct application key is required to perform the operation. The application key is distributed with the application. Because this key is not securely distributed, it cannot be considered a security token. To secure access to you mobile service data, you must implement authentication. Only Authenticated Users: Only authenticated users are permitted to perform the operation. In this preview release, clients are authenticated by Live Connect services. Scripts can be used to further restrict access to tables based on an authenticated user. Only Scripts and Admins: The operation requires the service master key, which limits the operation only to registered scripts or to administrator accounts. The user parameter is available in all server side scripts methods and can be used to add more granular auth polices on you CRUD operationsNotes: 10SchedulerExecute scripts on a Scheduleby Minutesby Hoursby DaysBy MonthsExecute scripts on DemandExamples Periodic purge of old data Poll and aggregate from 3rd party (Twitter, RSS, others) Process/resize images Schedule sending push notifications for a given time of day Slide Objectives:Detail Auth optionsSpeaking Points:Support for additional auth providers such as Facebook are coming soonWindows Azure Mobile Services enables you to set the following permissions on table operations: Everyone: This means that any request for the operation against the table is accepted. This option leaves your data wide-open for everyone to access. Anybody with the Application Key: Only the correct application key is required to perform the operation. The application key is distributed with the application. Because this key is not securely distributed, it cannot be considered a security token. To secure access to you mobile service data, you must implement authentication. Only Authenticated Users: Only authenticated users are permitted to perform the operation. In this preview release, clients are authenticated by Live Connect services. Scripts can be used to further restrict access to tables based on an authenticated user. Only Scripts and Admins: The operation requires the service master key, which limits the operation only to registered scripts or to administrator accounts. The user parameter is available in all server side scripts methods and can be used to add more granular auth polices on you CRUD operationsNotes: 11Diagnostics, Logging and ScaleDiagnosticsAPI callsCPU TimeData OutLoggingconsole.error()console.log()Scale - ComputeScale out instance countScale up VM sizeScale - StorageScale out mobile service tenant to dedicated SQL DBScale up SQL DB capacitySlide Objectives:Detail what Mobile Services provides as far as Diagnostics, Logging and Scale is concernedSpeaking Points: Note when moving a Mobile Service from a multi-tenant DB to its own. Currently data is not automatically migrated. 12Pricing during Previewreserved modeservice level agreementsPreviewNo availability SLA*General Availability99.9%Shared Instance Small instance is the only size availableFree - 10 applications with unlimited inbound data. Capped max of 165MB outbound data/dayPay - SQL DatabasePrivate VMSmall instance is the only size available Free - unlimited inbound data. 165MB outbound data/day, excess charged. Pay - SQL Database, Compute same reduced rate as Web Sites i.e 33% discount, excess outbound transfers starting at $0.12/GBUp to 100 applicationsshared modeNotes:More Details here - http://www.windowsazure.com/en-us/pricing/details/#header-0 SLAWhile Mobile Services is in preview, it can be used with apps in production, if customers ask for SLA and support, both can be provided by the product team upon request as part of the early adopters program, contact zumosla@microsoft.com for details.13Pricing Example:10 x Mobile Services on shared instances100MB SQLDatabaseUnlimited ingress

Recommended

View more >