Creating the Service Broker Instance

Objective

After completing this lesson, you will be able to create the Service Broker Instance

Create a Service Broker Instance

The Service Broker is responsible for providing the access token that is necessary to consume the APIs.

Screenshot of the SAP BTP Cockpit on the Instances and Subscriptions page for Intelligent Agri. It shows one subscription to SAP Intelligent Agriculture with a standard plan. The subscription was created and changed on 15 Dec 2022, with the status Subscribed. The Create button is highlighted on the top right. The sidebar lists options such as Services and Security, and tabs for Subscriptions, Instances, and Environments are present. No instances are currently listed.

This activity is performed in the Instances and Subscriptions section. When the application is subscribed, select the Create button in the upper right corner of the screen. Again, this step is required to get the credentials to access the APIs.

Steps

  1. Select the Service, Plan, and enter the Instance Name. Choose Next.

    Screenshot of the SAP BTP Cockpit showing a New Instance or Subscription dialog box for Intelligent Agri. It is in the Basic Info step, with dropdowns for selecting the Service and Plan. SAP Intelligent Agriculture is chosen as the service, and standard as the plan. The Runtime Environment is set to Other, and the Instance Name is Intelligent Agriculture. The Next button is highlighted, indicating progression to the next step. Tabs at the top indicate the steps: Basic Info, Parameters, and Review.
  2. The user must either upload a JSON file or enter the parameters in JSON format. Then, choose Next.

    Code Snippet
    1
    { "xs-security": { "xsappname": "farming", "oauth2-configuration": { "credential-types": [ "binding-secret" ] } } }

    Note

    *JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax. It is commonly used for transmitting data in web applications (for example, sending some data from the server to the client, so it can be displayed on a web page, or the opposite).
    Screenshot of the SAP BTP Cockpit showing the New Instance or Subscription dialog box in the Parameters step for Intelligent Agri. The interface allows uploading or specifying instance parameters in JSON format. A JSON snippet is displayed in the text box. The Next button is highlighted, indicating progression to the next step. The tabs at the top show the steps: Basic Info, Parameters, and Review. The background displays the Instances and Subscriptions page.
  3. Select Create.

    Screenshot of the SAP BTP Cockpit showing the New Instance or Subscription dialog box in the Review step for Intelligent Agri. It displays the details: Service set to SAP Intelligent Agriculture, Plan as standard, and Runtime Environment as Other. The Create button is highlighted, indicating confirmation to proceed with creation. A message states, Creating an instance might take a while. Tabs at the top show the steps: Basic Info, Parameters, and Review. The background shows the Instances and Subscriptions page.
  4. The Service Instance shows the status as Created.

    Screenshot of the SAP BTP Cockpit on the Instances and Subscriptions page for Intelligent Agri. It shows a subscription to SAP Intelligent Agriculture with a standard plan, created and changed on 15 Dec 2022, with the status Subscribed. There is now one instance listed, Intelligent Agriculture, with the service SAP Intelligent Agriculture, plan standard, and runtime environment Other. The status Created is highlighted. The sidebar includes navigation options like Services and Security.
  5. After creating the Service Broker instance, you need to create a key that will link the application to this service broker instance.

    To do this, click on the three dots right next to the Created status.

    Screenshot of the SAP BTP Cockpit on the Instances and Subscriptions page for Intelligent Agri. It shows a subscription to SAP Intelligent Agriculture with a standard plan, created and changed on 15 Dec 2022, with the status Subscribed. One instance, Intelligent Agriculture, is listed under Instances with the service SAP Intelligent Agriculture, plan standard, and runtime environment Other. The status is Created, and an option to view details is indicated by an expandable menu icon. The sidebar contains navigation options like Services and Security.
  6. Then, click on Create within Service Bindings to create a Key.

    A customer needs to create the key to receive the credentials to generate the Oauth token.

    This access token will be used to authenticate against the APIs.

    Screenshot of the SAP BTP Cockpit on the Instances and Subscriptions page for Intelligent Agri. The left panel shows subscriptions, with SAP Intelligent Agriculture having the status Subscribed, and an instance called Intelligent Agriculture with the status Created. The right panel details the instance, with information on the service, plan standard, and runtime environment Other. There are sections for Service Bindings and Labels, both currently empty. A Create button is highlighted for adding service bindings. Navigation options are visible in the sidebar.
  7. In the Binding Name field, enter Key, and select Create.

    New Binding dialog box in the SAP BTP Cockpit. The Binding Name field is filled with Key. Options are available to configure binding parameters by uploading a JSON file or specifying JSON parameters manually. The interface includes Browse... for file selection and a text area for JSON input. The Create button is highlighted, with a Cancel option also available.
  8. The Key now has the status Created.

    Screenshot of the SAP BTP Cockpit on the Instances and Subscriptions page for Intelligent Agri. The left panel lists a SAP Intelligent Agriculture subscription as Subscribed and an instance Intelligent Agriculture as Created. The right panel shows details for the Intelligent Agriculture instance, with a focus on Service Bindings. A binding named key is listed with the status Created. The Labels section is empty. A Create button is available for additional bindings. Navigation options are visible in the sidebar.

    Video Summary

    This video tutorial guides on how to create a service broker instance, highlighting the steps to secure the necessary access credentials for using associated APIs. The demonstration covers vital steps like the selection of the "Intelligent Agriculture" option, the process of naming an instance, and how to input important JSON data, which viewers would also have access to. The tutorial neatly concludes with the exhibit of a created instance, followed by the production of a key for the instance, and successfully obtaining data from the created assets. With a comprehensive step-by-step guide provided, viewers can gain a clear understanding of creating service broker instances and accessing APIs.

Log in to track your progress & complete quizzes