This document provides detailed instructions for deploying the Travel Advisor application to Tanzu Platform for Cloud Foundry.
- .NET 9 SDK installed on your local machine
- CF CLI installed on your local machine
- Access to a Tanzu Platform for Cloud Foundry environment
- Proper permissions to create and bind services
- Access to the GenAI tile in your Tanzu Platform environment
- Google Maps API key
- Build the application in Release mode:
dotnet publish -c Release -r linux-x64 --self-contained false- Log in to your Tanzu Platform for Cloud Foundry environment:
cf login -a <API_ENDPOINT> -u <USERNAME> -p <PASSWORD> -o <ORG> -s <SPACE>- Create a service instance for the LLM from the GenAI tile:
# List GenAI tile service offering plans
cf marketplace -e genai
# Create a service instance from one of the available plans
cf create-service genai PLAN_NAME travel-advisor-llmImportant
Replace PLAN_NAME above with an available plan from the GenAI tile service offering
- Push the application to Cloud Foundry:
cf push --no-start- Bind the application to the service instance:
cf bind-service travel-advisor travel-advisor-llm- You'll need to set an environment variable for the Google Maps API key:
cf set-env travel-advisor GOOGLEMAPS__APIKEY your_google_maps_api_keyImportant
Replace your_google_maps_api_key above with a valid Google Maps API key with appropriate permissions.
- Start the application:
cf start travel-advisor- After deployment, verify the application is running:
cf apps- Find the route where the application is deployed:
cf app travel-advisor- Open the application URL in a browser to test it.
If there are issues with service bindings, check the logs:
cf logs travel-advisor --recentTo view the health of the application using Steeltoe actuators:
curl https://<APP_URL>/healthIf you need to restart the application:
cf restart travel-advisor- Make your changes to the application
- Rebuild in Release mode
- Push the updated application:
cf pushTo scale the application vertically (change memory):
cf scale travel-advisor -m 1GTo scale the application horizontally (change instance count):
cf scale travel-advisor -i 3If a deployment goes wrong, you can rollback to the previous state:
cf rollback travel-advisor