Learn how to make changes to the Semantic Kernel web app service

This guide provides steps to make changes to the plugins of a deployed instance of the Semantic Kernel web app. Currently, changing semantic plugins can be done without redeploying the web app service but changes to native plugins do require re-deployments. This document will guide you through the process of doing both.

Prerequisites

  1. An instance of the Semantic Kernel web app service deployed in your Azure subscription. You can follow the how-to guide here for details.
  2. Have your web app's name handy. If you used the deployment templates provided with the Chat Copilot, you can find the web app's name by going to the Azure Portal and selecting the resource group created for your Semantic Kernel web app service. Your web app's name is the one of the resource listed that ends with "skweb".
  3. Locally tested plugins or planner ready to be added to your Semantic Kernel web app service.

How to publish changes to the Semantic Kernel web app service

There are two main ways to deploy changes to the Semantic Kernel web app service. If you have been working locally and are ready to deploy your changes to Azure as a new web app service, you can follow the steps in the first section. If you have already deployed your Semantic Kernel web app service and want to make changes to add Semantic plugins, you can follow the steps in the second section.

1.Deploying your Chat Copilot App to Azure as a web application

After working locally, i.e. you cloned the code from the GitHub repo and have made changes to the code for your needs, you can deploy your changes to Azure as a web application.

You can use the standard methods available to deploy an ASP.net web app in order to do so.

Alternatively, you can follow the steps below to manually build and upload your customized version of the Semantic Kernel service to Azure.

First, at the command line, go to the '/webapi' directory and enter the following command:

dotnet publish CopilotChatApi.csproj --configuration Release --arch x64 --os win

This will create a directory which contains all the files needed for a deployment:

../webapi/bin/Release/net8.0/win-x64/publish'

Zip the contents of that directory and store the resulting zip file on cloud storage, e.g. Azure Blob Container. Put its URI in the "Package Uri" field in the web deployment page you access through the "Deploy to Azure" buttons or use its URI as the value for the PackageUri parameter of the deployment scripts found on this page.

Your deployment will then use your customized deployment package. That package will be used to create a new Azure web app, which will be configured to run your customized version of the Semantic Kernel service.

2. Publish plugins directly to the Semantic Kernel web app service

This method is useful for making changes when adding new semantic plugins only.

How to add Semantic plugins

  1. Go to https://YOUR_APP_NAME.scm.azurewebsites.net, replacing YOUR_APP_NAME in the URL with your app name found in Azure Portal. This will take you to the Kudu console for your app hosting.
  2. Click on Debug Console and select CMD.
  3. Navigate to the 'site\wwwroot\Skills'
  4. Create a new folder using the (+) sign at the top and give a folder name to store your semantic functions e.g. SemanticPlugins.
  5. Now you can drag and drop your semantic functions into this folder
  6. Next navigate to 'site\wwwroot'
  7. Click on the pencil icon to edit the appsettings.json file.
  8. In the appsettings.json file, update the SemanticSkillDirectory with the location of the plugins you have created.
    "Service": {
    "SemanticSkillsDirectory": "/SemanticSkills",
    "KeyVaultUri": ""
  },
  1. Click on "Save" to save the changes to the appsettings.json file.
  2. Now your web app is configured to use your semantic functions.

Take the next step

To explore how you build a front-end web app explore the Chat Copilot app.

If you have not already done so, please star the GitHub repo and join the Semantic Kernel community! Star the Semantic Kernel repo

gray circles of semantic kernel