colorado cloud foundry meeting
TRANSCRIPT
TECHNOLOGY SOLUTIONS DELIVERED
TECHNOLOGY SOLUTIONS DELIVEREDTECHNOLOGY SOLUTIONS DELIVERED
Azure Service Brokerand Spring Music
January 23, 2017
TECHNOLOGY SOLUTIONS DELIVERED
• Installed as a tile with PCF• Standard Service Broker
application for Open Source CF• Provides self-provisioning of Azure
Services
Azure Service Broker
TECHNOLOGY SOLUTIONS DELIVERED
Azure Service Broker
TECHNOLOGY SOLUTIONS DELIVERED
Spring Music
• Simple demonstration of Spring Cloud principles
• Automatically detects connection type based on bound services
• Provides H2, MySQL, Mongo, and Redis
TECHNOLOGY SOLUTIONS DELIVERED
Create an Azure SQLServer Service Instance
• Use the same cf cli commands• Azure credentials are in the tile configuration• Service details kept in a json file• Service creation asynchronous
TECHNOLOGY SOLUTIONS DELIVERED
Bind the Service and Start the App!
• App didn’t start at all• A lot of errors around “unable to connect to local SQL Server Instance”
TECHNOLOGY SOLUTIONS DELIVERED
So now what?• Looks like Spring Cloud
was able to recognize the SQL Server bound service instance
• Didn’t know how to create a SQL Server Data Source
• How to get Spring to create this?
TECHNOLOGY SOLUTIONS DELIVERED
The Magic of Spring• Just get the MS
driver onto the classpath
• Spring Cloud smart enough to figure out how to create the ServiceInfo class
• Still had to do some app-specific wiring
TECHNOLOGY SOLUTIONS DELIVERED
Demo
TECHNOLOGY SOLUTIONS DELIVERED
Create an Azure Redis Service
• Use the same cf cli commands• Azure credentials are in the tile configuration• Service details kept in a json file• Service creation asynchronous
TECHNOLOGY SOLUTIONS DELIVERED
Bind the Service and Start the App!
• App started great!• Ended up using H2 database• Automatic recognition of Redis-based bound service did not happen
TECHNOLOGY SOLUTIONS DELIVERED
Service Instance Differences
TECHNOLOGY SOLUTIONS DELIVERED
How can I make Spring Music recognize this?
TECHNOLOGY SOLUTIONS DELIVERED
Custom Service Info Creator classes• ServiceInfo class to describe the bound service• ServiceInfoCreator class to get Spring to create that ServiceInfo bean• File to Register the creator class with Spring• App-specific wiring and config
TECHNOLOGY SOLUTIONS DELIVERED
Questions?
TECHNOLOGY SOLUTIONS DELIVERED
To learn more…
• https://github.com/Azure/meta-azure-service-broker/tree/master/
• https://github.com/ECSTeam/spring-music
• https://www.microsoft.com/en-us/sql-server/developer-get-started/