以工作為基礎的取用者行動應用程式

App Service
App Service - Mobile Apps
Xamarin

解決方案構想 Solution Idea

如果您想要瞭解如何使用詳細資訊、實行詳細資料、定價指引或程式碼範例來擴充本文,請讓我們知道 GitHub 意見反應!If you'd like to see us expand this article with more information, implementation details, pricing guidance, or code examples, let us know with GitHub Feedback!

此取用者行動應用程式架構使用 Azure App Service Mobile Apps 來簡化多個社交識別提供者的驗證、儲存資料,並同步處理以進行離線存取,以及傳送推播通知。This consumer mobile app architecture uses Azure App Service Mobile Apps to simplify authentication with multiple social identity providers, store data and sync it for offline access, and send push notifications.

此應用程式是以 Visual Studio (PC 或 Mac) 和 Xamarin 所建立,在 Android、iOS 和 Windows 之間共用 c # 程式碼,而不會影響使用者體驗。The app is built with Visual Studio (PC or Mac) and Xamarin, sharing C# code across Android, iOS, and Windows without compromising user experience. Visual Studio App Center 是用來將組建和測試自動化,並散發給 Beta 測試人員和應用程式商店,同時也提供使用方式監視和分析搭配 App Insights。Visual Studio App Center is used to automate builds and tests and distribute to beta testers and app stores, while also providing usage monitoring and analytics in conjunction with App Insights.

右邊的連結提供有關部署及管理上述解決方案架構中所列之 Azure 產品的檔。The links to the right provide documentation on deploying and managing the Azure products listed in the solution architecture above.

Visual Studio Team ServicesVisual Studio Team Services

Visual StudioVisual Studio

適用于 Xamarin 的 Visual Studio ToolsVisual Studio Tools for Xamarin

Application InsightsApplication Insights

Visual Studio App CenterVisual Studio App Center

App Service Mobile AppsApp Service Mobile Apps

架構Architecture

架構圖表會 下載此架構的SVGArchitecture diagram Download an SVG of this architecture.

資料流程Data Flow

  1. 使用 Visual Studio 和 Xamarin 建立行動應用程式。Create the mobile app using Visual Studio and Xamarin.
  2. 在 Azure 入口網站上建立並設定新的 Mobile Apps 後端,或透過 Visual Studio,並在 Visual Studio 中設定解決方案,以與後端通訊。Create and configure a new Mobile Apps back end on the Azure portal, or through Visual Studio, and configure the solution in Visual Studio to communicate with the back end.
  3. 透過社交識別提供者來執行驗證。Implement authentication through social identity providers.
  4. 透過 App Service Api 和 SDK 建立模型驅動的資料結構。Create a model-driven data structure through the App Service APIs and SDK.
  5. 執行離線同步,讓行動應用程式在沒有網路連線的情況下運作。Implement offline sync to make the mobile app functional without a network connection.
  6. 如果您在 Visual Studio 中建立後端,您可以直接從 Visual Studio (PC 或 Mac) 發佈 app service。If you created the back end in Visual Studio, you can publish the app service directly from Visual Studio (PC or Mac).
  7. 使用您選擇的原始檔控制提供者來儲存方案原始程式碼。Store the solution source code with your source control provider of choice.
  8. 透過 Visual Studio App Center 建立並測試應用程式,並將其發佈。Build and test the app through Visual Studio App Center and publish it.
  9. 使用 Application Insights 來監視 App Service。Use Application Insights to monitor the App Service.

元件Components

  • 使用 c # 在 Visual Studio 2017 或 Visual Studio for Mac 中建立 web 前端、mobile apps 和後端服務。Build the web front end, mobile apps, and back end services with C# in Visual Studio 2017 or Visual Studio for Mac.
  • Xamarin:使用 c # 和 Azure sdk 建立適用于 IOS 和 Android 的行動應用程式。Xamarin: Create mobile apps for iOS and Android using C# and Azure SDKs.
  • Visual Studio App Center: App Center 會藉由從 BitBucket、GitHub 和 Visual Studio Team Services 提取程式碼,來啟用持續整合和部署工作流程。Visual Studio App Center: App Center enables a continuous integration and deployment workflow by pulling code from BitBucket, GitHub, and Visual Studio Team Services.
  • App Service:用戶端應用程式會使用其中一個行動用戶端 sdk 來連接到 Azure 行動應用程式後端。App Service: The client app uses one of the mobile client SDKs to connect to an Azure Mobile App backend. 用戶端 Sdk 具有離線同步處理和驗證的內建支援,可讓您更輕鬆地建立功能完整的應用程式。The client SDKs have built-in support for offline sync and authentication, making it much easier to build a full-featured app.
  • Application Insights:使用 Application Insights 來偵測問題、診斷損毀,以及追蹤 web 應用程式中的使用量。Application Insights: Detect issues, diagnose crashes, and track usage in your web app with Application Insights. 在整個開發生命週期中做出明智的決策。Make informed decisions throughout the development lifecycle.
  • Azure SQL Database:結構化資料儲存在 SQL Database 的雲端關係資料庫服務,可支援交易和有效率的查詢。Azure SQL Database: Structured data is stored in SQL Database, a cloud relational database service, which supports transactions and efficient querying.
  • 離線同步處理:使用 Azure 行動應用程式用戶端 sdk 的離線資料同步功能,來建立回應式和健全的應用程式,即使有網路問題也很有用。Offline sync: Use the offline data sync feature of the Azure Mobile App client SDKs to create responsive and robust apps that remain useful even when there are network issues.
  • 身分識別提供者:使用 App Service 驗證/授權,與社交或企業身分識別提供者整合。Identity Provider: Use App Service authentication/authorization to integrate with a social or enterprise identity provider.

後續步驟Next steps