從入口網站手動安裝或更新 Azure Functions 繫結延伸模組Manually install or update Azure Functions binding extensions from the portal

Azure Functions 2.x 版執行階段使用繫結延伸模組來實作觸發程序和繫結的程式碼。The Azure Functions version 2.x runtime uses binding extensions to implement code for triggers and bindings. 繫結延伸模組是在 NuGet 套件中提供的。Binding extensions are provided in NuGet packages. 若要註冊延伸模組,您基本上會安裝套件。To register an extension, you essentially install a package. 開發函式時,安裝繫結延伸模組的方式取決於開發環境。When developing functions, the way that you install binding extensions depends on the development environment. 如需詳細資訊,請參閱觸發程序和繫結文章中的註冊繫結延伸模組For more information, see Register binding extensions in the triggers and bindings article.

有時,您需要在 Azure 入口網站中手動安裝或更新繫結延伸模組。Sometimes you need to manually install or update your binding extensions in the Azure portal. 例如,您可能需要將某個已註冊的繫結更新至較新的版本。For example, you may need to update a registered binding to a newer version. 您可能也需要在入口網站的 [整合] 索引標籤中,註冊某個已支援但無法安裝的繫結。You may also need to register a supported binding that can't be installed in the Integrate tab in the portal.

安裝繫結延伸模組Install a binding extension

請使用下列步驟,從入口網站手動安裝或更新延伸模組。Use the following steps to manually install or update extensions from the portal.

  1. Azure 入口網站中,找出您的函數應用程式並選取它。In the Azure portal, locate your function app and select it. 選擇 [概觀] 索引標籤,然後選取 [停止] 。Choose the Overview tab and select Stop. 停止函數應用程式會將檔案解除鎖定,以便進行變更。Stopping the function app unlocks files so that changes can be made.

  2. 選擇 [平台功能] 索引標籤,然後在 [開發工具] 底下,選取 [進階工具 (Kudu)] 。Choose the Platform features tab and under Development tools select Advanced Tools (Kudu). Kudu 端點 (https://<APP_NAME>.scm.azurewebsites.net/) 會在新視窗中開啟。THe Kudu endpoint (https://<APP_NAME>.scm.azurewebsites.net/) is opened in a new window.

  3. 在 Kudu 視窗中,選取 [偵錯主控台] > [CMD] 。In the Kudu window, select Debug console > CMD.

  4. 在命令視窗中,瀏覽至 D:\home\site\wwwroot,然後選擇 bin 旁邊的刪除圖示以刪除此資料夾。In the command window, navigate to D:\home\site\wwwroot and choose the delete icon next to bin to delete the folder. 選取 [確定] 來確認刪除。Select OK to confirm the deletion.

  5. 選擇 extensions.csproj 檔案旁邊的編輯圖示,此檔案定義了函數應用程式的繫結延伸模組。Choose the edit icon next to the extensions.csproj file, which defines the binding extensions for the function app. 專案檔會在線上編輯器中開啟。The project file is opened in the online editor.

  6. 針對 ItemGroup 中的 PackageReference 項目進行必要的新增和更新,然後選取 [儲存] 。Make the required additions and updates of PackageReference items in the ItemGroup, then select Save. 您可以在我需要什麼套件? (英文) Wiki 文章中,找到目前支援的套件版本清單。The current list of supported package versions can be found in the What packages do I need? wiki article. 所有三個「Azure 儲存體」繫結都需要 Microsoft.Azure.WebJobs.Extensions.Storage 套件。All three Azure Storage bindings require the Microsoft.Azure.WebJobs.Extensions.Storage package.

  7. wwwroot 資料夾中,執行下列命令以在 bin 資料夾中重建所參考的組件。From the wwwroot folder, run the following command to rebuild the referenced assemblies in the bin folder.

    dotnet build extensions.csproj -o bin --no-incremental --packages D:\home\.nuget
    
  8. 返回入口網站中的 [概觀] 索引標籤,選擇 [啟動] 以重新啟動函數應用程式。Back in the Overview tab in the portal, choose Start to restart the function app.

後續步驟Next steps