Skip to Content
0

XSA HANA 2.0 SPS02 - User Provided Services

Feb 06 at 01:04 PM

365

avatar image

Hello experts!

I'm tring to use an User-Provided-Service to configure an URL of a .Net back-end rest service with some problems, and i need to use that service in several UI5 applications.

For now we are in development phase so i'm could configure the URL in every UI5 application, but i need to use an user-provided to configure it because we gonna test in quality space (inside same enviroment we have a DEV_SPACE and QAS_SPACE), so i need to point the apps to .NET quality URL too.

I did read answer How to set and use destinations in XSA | Cloud Foundry, and created a service by CUPS command like below:

xs cups bia-backend -p url
Result: 
{
  "name" : "bia-backend",
  "credentials" : {
    "url" : "http://dotnet.backend.com"
  }
}
modules:
  - name: bia.apresentacao-app
    type: html5
    path: app
    requires:
      - name: sapui5
        properties:
          sapui5url: ~{url}
      - name: bia-backend
        group: destinations
        properties:
          name: bia
          url: ~{url}
resources:
  - name: sapui5
    type: configuration
    parameters:
      provider-nid: mta
      provider-id: 'com.sap.ui5.dist.sapui5-dist-xsa.XSAC_UI5_FESV3:sapui5_fesv3'
      version: '>=1.42.0'
  - name: bia-backend
    type: org.cloudfoundry.user-provided-service
    properties:
        bia-backend-service-name: ${service-name}
        url: 'http://dotnet.backend.com' # ${url} did not work
    parameters: 
        service-name: bia-backend

But the problem is that i still need to inform the URL as hardcode inside MTA descriptor of every other applications, and i wasn't able to use ${url} parameter inside MTA descriptor (i tried to use org.cloudfoundry.user-provided-service and org.cloudfoundry.user-existing-service).

resources
  - name: bia-backend
    type: org.cloudfoundry.existing-service # org.cloudfoundry.user-provided-service
    properties:
        bia-backend-service-name: ${service-name}
        url: ${url} #did not work
    parameters: 
        service-name: bia-backend

So how can i reference inside the MTA descriptor, the URL property of credentials on bia-backend service (UPS)? Do i need to use a '.mtaext' and a '.mtad.yaml' archives to change the URL in all apps every time i deploy the application?

My idea was to after we deploy the applications to QAS_SPACE, and transport to production enviroment, use an UUPS command to change the URL in any Enviromment/ORG/SPACE.

Thanks.

Matheus

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Matheus Oliveira Goulart Mar 12 at 11:54 AM
0

Hello guys,

We've solved the issue using a '.mtaext' file during deploy.

SAP answered us that is no way to use a URL configured througth CUPS, so we just created the service by CUPS command with no URL parameter, created the URL parameter inside the MTA file (resource of type org.cloudfoundry.existing-service) and on deploy, we've used the '.mtaext' file to change URL parameter to desired value on target system.

Thanks.

Share
10 |10000 characters needed characters left characters exceeded