colorado cloud foundry meeting

16
TECHNOLOGY SOLUTIONS DELIVERED TECHNOLOGY SOLUTIONS DELIVERED Azure Service Broker and Spring Music January 23, 2017

Upload: ncayou

Post on 21-Jan-2018

16.000 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Colorado Cloud Foundry Meeting

TECHNOLOGY SOLUTIONS DELIVERED

TECHNOLOGY SOLUTIONS DELIVEREDTECHNOLOGY SOLUTIONS DELIVERED

Azure Service Brokerand Spring Music

January 23, 2017

Page 2: Colorado Cloud Foundry Meeting

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

Page 3: Colorado Cloud Foundry Meeting

TECHNOLOGY SOLUTIONS DELIVERED

Azure Service Broker

Page 4: Colorado Cloud Foundry Meeting

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

Page 5: Colorado Cloud Foundry Meeting

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

Page 6: Colorado Cloud Foundry Meeting

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”

Page 7: Colorado Cloud Foundry Meeting

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?

Page 8: Colorado Cloud Foundry Meeting

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

Page 9: Colorado Cloud Foundry Meeting

TECHNOLOGY SOLUTIONS DELIVERED

Demo

Page 10: Colorado Cloud Foundry Meeting

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

Page 11: Colorado Cloud Foundry Meeting

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

Page 12: Colorado Cloud Foundry Meeting

TECHNOLOGY SOLUTIONS DELIVERED

Service Instance Differences

Page 13: Colorado Cloud Foundry Meeting

TECHNOLOGY SOLUTIONS DELIVERED

How can I make Spring Music recognize this?

Page 14: Colorado Cloud Foundry Meeting

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

Page 15: Colorado Cloud Foundry Meeting

TECHNOLOGY SOLUTIONS DELIVERED

Questions?

Page 16: Colorado Cloud Foundry Meeting

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/