This sample provisions the MS SQL database within Microsoft Azure using the Open Service Broker. This process generates a randomly named database, user and password. Once the provisioning is completed, the database is configured with a sample Orders
table populated with two rows of sample data. The generation of the table and data is handled within the seed-db
lambda function which is defined in the k8/deployment.yaml
file.
This sample demonstrates how to:
- Create a development Namespace in the Kyma runtime.
- Provision the Azure MS SQL database using the Open Service Broker.
- Deploy a Serverless Function and an APIRule.
- SAP BTP, Kyma runtime instance
- Microsoft Azure Account
- kubectl configured to use the
KUBECONFIG
file downloaded from the Kyma runtime
- Create a new
dev
Namespace:
kubectl create namespace dev
- Open the Kyma Console and choose the
dev
Namespace. - Within the
dev
Namespace, choose Service Management -> Catalog -> Add-Ons. - Choose the
Azure Service Broker
. - Follow the steps to create the
azure-broker-data
Secret noted in theDocumentation
. - Within the Azure Service Broker Add-On, choose the Add once option.
- Choose your desired
Minimum services stability
. The MS SQL service is available inStable
. - Set the
Azure Secret name
toazure-broker-data
. - Choose the Create option.
- Open the Kyma Console and choose the
dev
Namespace. - Within the
dev
Namespace, choose Service Management -> Catalog -> Services. - Choose the
Azure SQL Database 12.0
tile. - Choose the following:
- Plan: Basic Tier
- Connection Plan: Default
- Location: Your desired location
- Resource Group: The resource group to assign the database to
- Choose Create.
- Apply the Deployment:
kubectl -n dev apply -f ./k8s/deployment.yaml
- Verify that the Function is up and running:
kubectl -n dev get function seed-db
- Open the Kyma Console and choose the
dev
Namespace. - Within the
dev
Namespace, choose Development -> Functions. - Choose the
seed-db
Function. - Choose the Configuration tab.
- Choose the Create Service Binding option.
- Choose the ServiceInstance for the Azure SQL.
- Choose Create.
- Open the Kyma Console and choose the
dev
Namespace. - Within the
dev
Namespace, choose Configuration -> API Rules. - Choose the
seed-db
APIRule. - Choose the Host value link. The expected response is
database has been initialized....
. - Remove the Function/APIRule Deployment:
kubectl -n dev delete -f ./k8s/deployment.yaml