May 23rd, 2023

How to deploy Semantic Kernel to Azure as a web application service

Nilesh Acharya
Principal Product Manager

Image skpatternlarge

We have heard feedback from our community about having the ability to deploy Semantic Kernel to Azure. We have listened and want to share how you can deploy Semantic Kernel to your Azure Subscription as a web application service.

Deploying to Azure provides a great pathway for developers to take advantage of Azure compute and other services such as Azure Cognitive Services for Responsible AI and vectorized databases.  Setup and deployment are extremely simple! You can use existing Azure Open AI resources and create new resources or even use Open AI resources. 

So what is deployed? Below are the key resources created in the Azure Resource Group.

  1. Azure web app service: hosts Semantic Kernel.
  2. Application Insights: application logs and debugging.
  3. Azure Cosmos DB: used for chat storage (optional).
  4. Qdrant vector database (within a container): used for embedding (optional).
  5. Azure Speech service: used for speech-to-text (optional).

Once the deployment is complete you will have a web app running all your back-end services for Semantic Kernel which can be reached via a web service end point. Using this deployment, you can continue to develop your own front-end application or proceed with further deployments with a customized version of Semantic Kernel. 

To get started select the use case and deployment option that is best for you. For more details on script parameters and considerations you can refer to the Semantic Kernel learn site here. 

Use Case Deployment Option
Use existing : Azure OpenAI Resources Use this option to use an existing Azure OpenAI instance and connect the Semantic Kernel web API to it. Deploy to Azure

PowerShell File

Bash File

Create new : Azure OpenAI Resources Use this option to deploy Semantic Kernel in a web app service and have it use a new instance of Azure OpenAI Deploy to Azure

PowerShell File

Bash File

Use existing: OpenAI Resources Use this option to use your OpenAI account and connect the Semantic Kernel web API to it. Deploy to Azure

PowerShell File

Bash File

As an example, if you are using the “Deploy to Azure” button with OpenAI resources, you will be presented with a page like below. You will need to review and update the template form to create the resources.

Image AzureDeployment Blogv1

Next click on Review + create. The deployment may take a few minutes and you will be prompted on the portal once all your resources are ready to use.

To confirm your web application server is up and running go to https://YOUR_INSTANCE_NAME.azurewebsites.net/probe. To find your instance name go to the Azure Portal and find the resource group which was just created and click on the ‘App Service’. Your instance name will end with “-skweb”. Once the server is running, you will see the following page.

Image ServerRunningv1

That’s it; you have your Semantic Kernel Service up and running!

In an upcoming blog we will step through how you can make updates to your deployment.

Next Steps:

Find more information about Semantic Kernel deployments here and how to customize your Semantic Kernel click here

Join the community and let us know what you think: https://aka.ms/sk/discord

Image skpatternsmallbw

Author

Nilesh Acharya
Principal Product Manager

0 comments

Discussion are closed.