共用方式為


匯出診斷數據

這很重要

Visual Studio App Center 於 2025 年 3 月 31 日淘汰,但分析和診斷功能除外,這些功能將持續支援到 2026 年 6 月 30 日。 瞭解更多資訊。

這篇文章會引導您如何根據使用者要求匯出資料。 若要匯出資料,您有兩個選項:

  1. 使用 Azure Blob 儲存
  2. 呼叫 API 以取得特定當機/錯誤資訊

使用 Azure Blob 儲存

將所有錯誤和符號化的當機,包括堆疊追蹤和附件匯出至 Azure 部落格記憶體。 您需要 Azure 訂用帳戶,才能將數據匯出至 Azure Blob 記憶體。 您可以在 App Center 匯出檔中深入瞭解 App Center 如何與 Azure Blob 記憶體搭配運作。

若要將診斷數據匯出至 Blob 記憶體,請呼叫下列 App Center API:

POST https://api.appcenter.ms/v0.1/apps/{owner_name}/{app_name}/export_configurations

使用以下其中一個有效負載將損毀導出至 Azure Blob 儲存體:

標準匯出用的負載

{
  "type" : "blob_storage_linked_subscription",
  "subscription_id": "<Your-Azure-Subscription-ID",
  "export_entities": [ "crashes" ]
}

自訂匯出的數據負載:

{
  "type" : "blob_storage_connection_string",
  "connection_string": "<Your-blob-storage-connection-string",
  "export_entities": [ "crashes" ]
}

若要在 Blob 記憶體中尋找位置,請呼叫下列 App Center API:

GET https://api.appcenter.ms/v0.1/apps/{owner_name}/{app_name}/export_configurations

呼叫 API 以取得特定當機/錯誤資訊

這些是您必須呼叫的不同 API,才能匯出相關聯的診斷資訊。

1.藉由呼叫下列方式,取得損毀/錯誤群組中每個損毀/錯誤的損毀/錯誤記錄元數據:

https://api.appcenter.ms/v0.1/apps/{owner_name}/{app_name}/errors/errorGroups/{errorGroupId}/errors

2.藉由呼叫來取得 stacktrace:

https://api.appcenter.ms/v0.1/apps/{owner_name}/{app_name}/errors/errorGroups/{errorGroupId}/stacktrace

3.透過呼叫提取事件記錄:

https://api.appcenter.ms/v0.1/apps/{owner_name}/{app_name}/errors/{errorId}/session_logs

4.藉由呼叫來取得任何附件標識碼:

https://api.appcenter.ms/v0.1/apps/{owner_name}/{app_name}/errors/{errorId}/attachments
  1. 如果這是文字附件,您可以呼叫下列功能來取得文字:
https://api.appcenter.ms/v0.1/apps/{owner_name}/{app_name}/errors/{errorId}/attachments/{attachmentId}/text
  1. 如果這是二進位附件,您可以通過呼叫以下方法以取得 URI 位置:
https://api.appcenter.ms/v0.1/apps/{owner_name}/{app_name}/errors/{errorId}/attachments/{attachmentIdd}/location

如何提供此數據的複本給我的使用者

先決條件: 下列流程要求您有辦法對應 App Center 安裝識別碼和您的使用者。

若要提供特定用戶的數據,您必須搜尋導出的數據,並在不同的檔案中複製具有特定安裝標識碼的記錄。 該檔案將包含已匯出至該特定使用者的所有數據。