Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Deploy the sample ai servcie chat-agent, and explore the power of Azure Open AI service.

Step by step guidance

  1. Run the following commands to deploy the sample chat-agent AI application to Azure Container App.

       
    APP_NAME=chat-agent
    UMI_ID=$(az identity show --resource-group $RESOURCE_GROUP --name $ACA_IDENTITY --query id --output tsv)
    CLIENT_ID=$(az identity show --resource-group $RESOURCE_GROUP --name $ACA_IDENTITY --query clientId  --output tsv)
       
    OPEN_AI_ENDPOINT=$(az cognitiveservices account show --name $OPEN_AI_SERVICE_NAME --resource-group $RESOURCE_GROUP --query properties.endpoint --output tsv)
    
    az containerapp create \
       --name $APP_NAME \
       --resource-group $RESOURCE_GROUP \
       --ingress internal \
       --target-port 8080 \
       --environment $ACA_ENVIRONMENT \
       --min-replicas 1 \
       --artifact ./spring-petclinic-chat-agent/target/spring-petclinic-chat-agent-$VERSION.jar \
       --user-assigned $UMI_ID \
       --env-vars SPRING_AI_AZURE_OPENAI_ENDPOINT=$OPEN_AI_ENDPOINT SPRING_AI_AZURE_OPENAI_CLIENT_ID=$CLIENT_ID \
       --bind $JAVA_CONFIG_COMP_NAME \
       --runtime java
    
  2. Run the below command to get the FQDN of the api-gateway application.

    az containerapp show --name api-gateway \
       --resource-group $RESOURCE_GROUP \
       --query properties.configuration.ingress.fqdn \
       --output tsv
    
  3. Workthrough the chat agent. Open your browser with above FQDN and navigate to the agent tab to chat with the AI agent.

    • You can talk with the agent, it can help to query all vets and their specialty.
    • The agent also can help to recommend the vet according to the symptoms of the pet.

lab 5 chat