透過封裝移轉環境和租用戶應用程式Environment and tenant app migration through Packaging

了解如何透過封裝移轉資源到不同的環境。Learn how to migrate resources from one environment to another with packaging. 這些環境可能是在同一個租用戶內或橫跨幾個不同的租用戶。These environments can be within the same tenant or across different tenants.

案例The scenario

讓您可能需要移轉資源的常見情況是當您有「測試」或「開發」和「生產」環境的時候。One common scenario where you may want to migrate resources is where you have Test or Dev environments and a Production environment. 開發人員和測試人員在各自的環境中擁有應用程式的全域存取權。Developers and testers have wide access to the apps in their environments. 但當新的應用程式移轉至生產環境時,該環境便嚴格控制可用於更新及變更此應用程式的權限。But when it comes time to migrate a new app to production, that environment has rigorous control over permissions to update and change it.

另一種情況是,每位客戶都有自己的環境和資料。Another scenario is one where each customer has their own environment and data. 每加入一個新客戶,便為其建立新環境,而您要將應用程式移轉至他們的環境。When a new customer is added, a new environment is created for them, and you would migrate apps into their environment.

透過封裝可以移轉哪些資源?Which resources can I migrate through packaging?

匯出應用程式時,與應用程式相依的資源也會匯出至封裝。When you export an app, the dependent resources for your app will also get exported into the package. 一開始僅支援所有可能資源類型的子集,如下表所述。Initially only a subset of all possible resource types will be supported as outlined in the table below.

資源類型Resource type 支援的Supported 匯入選項Import options
應用程式App Yes 有兩個選項可以將應用程式匯入環境:There are two options to import an app into an environment:
  1. 新建 – 應用程式會在匯入封裝的環境中建立為新的應用程式。Create new – The app will be created as a new app in the environment where the package is imported.
  2. 更新 - 應用程式已存在於環境中,匯入封裝時將會更新。Update - the app already exists in the environment and will be updated when this package is imported.
流程Flow Yes 有兩個選項可以將流程匯入環境:There are two options to import a flow into an environment:
  1. 新建 – 流程會在匯入封裝的環境中建立為新的流程。Create new – The flow will be created as a new flow in the environment where the package is imported.
  2. 更新 - 流程已存在於環境中,匯入封裝時將會更新。Update - The flow already exists in the environment and will be updated when this package is imported.
注意:流程依存的所有資源也將包含在要匯出的應用程式封裝內,封裝匯入後需要設定這些資源 NOTE: All resources that the flow depends on will also be included within the app package that is exported and will need to be configured with the package is imported
CDS 實體自訂和挑選清單CDS Entity Customizations and Picklists Yes 有兩個選項可以將 CDS 實體或挑選清單匯入環境:There are two options to import CDS Entities or Picklists in an environment:
  1. 覆寫 - 如果有相同名稱的資源,此匯入會取代它。Overwrite - If there's a resource with the same name, this import will replace it. 如果沒有相符的資源,就會建立新資源。If there isn’t a matching resource, a new resource will be created.
  2. 合併 – 如果有相同名稱的實體或挑選清單,會新增新的欄位或項目,但遺漏的欄位或項目不會移除。Merge – If there's an entity or picklist with the same name, new fields or entries will be added, but missing fields or entries won’t be removed.
自訂連接器Custom Connectors No 如果應用程式相依於自訂連接器,目前我們並未支援將連接器作為封裝的一部分匯出。If an app depends on a custom connector we do not currently support exporting the connector as a part of the package.

如果您的應用程式相依於自訂連接器,目前僅有的選項是手動重新建立或更新目標環境中的連接器,並在匯入封裝時選取該連接器。If you have an app that relies on a custom connector, your only current option is to manually re-create or update the connector in your target environment and select that connector when you import the package.

連線Connections No 如果應用程式相依於連線 (例如需認證的 SQL 連線),目前我們並未支援將連線或認證作為封裝的一部分匯出。If an app depends on a connection (such as a SQL connection w/ credentials), we do not currently support exporting the connection or credentials as a part of the package.

如果您的應用程式相依於共用連線 (如 SQL),目前僅有的選項是在目標環境中手動重新建立該連線及適當的認證,並在匯入封裝時選取該連線。If you have an app that relies on a shared connection (like SQL), your only current option is to manually re-create that connection with the appropriate credentials in your target environment and select that connection when you import the package.

CDS 自訂角色和權限集合CDS Custom Roles and Permission Sets No 目前不支援匯出自訂 CDS 角色和/或權限集合,因此目前唯一的選項是在目標環境中手動重新建立這些實體。Exporting custom CDS roles and/or permission sets is not currently supported, so the only option today is to manually re-create these entities in your target environment.
閘道Gateways No 只有預設 (和 {租用戶名稱} (從預覽) ) 環境支援閘道,因此不支援匯出/移轉閘道。Gateways are only supported in the default (and {tenant name} (from preview) ) environments, so export/migration is not supported.
CDS 資料列CDS data rows No 目前不支援從 CDS 實體匯出資料列,因此在 CDS 結構描述變更已套用至新環境後,目前僅有的選項是手動匯出和匯入資料。Export rows from CDS entities is not current supported, so the only option today to manually export and import data after your CDS schema changes have been applied in a new environment.

我要如何取得應用程式封裝功能?How do I get access to packaging for my app?

對應用程式具備「可以編輯」權限的使用者都可以匯出應用程式。The ability to export an app is available to any user with "Can edit" permission to the app.

在目的地環境中具備「環境建立者」權限的使用者都可以匯入應用程式。The ability to import an app is available to any user with "Environment Maker" permission in the destination environment.

使用者必須具備 PowerApps 方案 2 或 PowerApps 方案 2 試用授權才能匯出或匯入應用程式。A user must have a PowerApps Plan 2 or PowerApps Plan 2 trial license in order to export or import any app.

附註:當封裝功能已供預覽時,具備有效 PowerApps 授權的任何使用者都可以針對其應用程式與環境試用封裝NOTE: While packaging is in preview, any user with a valid PowerApps license will be able to try out packaging for their apps and environments.

匯出應用程式Exporting an app

  1. http://web.powerapps.com 中,按一下或點選 [應用程式],選取要移轉的應用程式之省略符號,然後選取 [匯出 (預覽)]。In http://web.powerapps.com, click or tap Apps, select the ellipses for the app you want to migrate, and then select Export (preview).

    選取匯出

  2. [匯出封裝] 頁面開啟時,輸入封裝的名稱和描述。When the export package page opens, enter a Name and Description for the package.

    檢閱封裝詳細資料

  3. 在「檢閱封裝內容」區段中您可以選擇性新增註解或筆記,或者針對在封裝匯入期間,每個個別資源將如何匯入目標環境來變更設定。Within the ‘Review Package Content’ section you can optionally add comments or notes or change the setting for how each individual resource will be imported into the target environment during package import.

    設定封裝內容

  4. 選取匯出完成後,封裝檔案會在幾秒鐘內開始下載。When you are done select Export and the package file will begin downloading within a few seconds.

匯入應用程式Importing an app

  1. http://web.powerapps.com 中,按一下或點選 [應用程式],然後選取 [匯入封裝 (預覽)]。In http://web.powerapps.com, click or tap Apps, and then select Import package (preview).

    選取匯入

  2. 選取 [上傳] 並選取要匯入的應用程式封裝檔案。Select Upload and select the app package file that you want to import.

    選取封裝檔案

  3. 上傳封裝之後,您必須檢閱封裝內容,並為標示紅色圖示的項目提供其他輸入,方法是選取各項目的扳手圖示並輸入所需資訊。Once the package has been uploaded you will need to review the package contents and will need to provide additional input for any item marked with a red icon by selecting the wrench icon for each item and entering the required information.

    檢閱封裝內容

  4. 提供所有必要資訊後,選取 [匯入]。Once you have provided all of the required information select Import.

    已更新的封裝內容

  5. 匯入完成時會自動重新導向至一個頁面 (類似以下頁面),概述匯入作業是否已順利完成。When import completes you will be automatically redirected to a page (similar to the one below) that outlines whether or not the import operation was successful.

    檢閱匯入結果

注意 如果您正在匯入應用程式,並選擇更新現有的應用程式,新的變更會儲存為應用程式的草稿。NOTE If you are importing an app and chose to Update an existing app, the new changes will be saved as a draft of the applications. 您必須發佈變更,使其可供應用程式的所有其他使用者使用。You will need to publish those changes in order for them to be available all other users of the applications.

已知限制Known limitations

限制Limitation 狀態Status
已回報需要數分鐘才能完成匯入包含 ~3 項以上資源的應用程式封裝。Importing app packages that contains more than ~3 resources has been reported to take several minutes to complete. 這是已知問題,將會盡快推出修正程式。This is a known issue and a fix will be rolled out soon.