cancel
Showing results for 
Search instead for 
Did you mean: 
jannes_schofeld
Employee
Employee

Currently the "Developing with SAP Extension Suite" Learning Journey has some limitations, because code snippets required in some of the exercises are yet to be included. This blog post provides the snippets for the individual exercises in unit 4 to unit 6 until they are included in the official Learning Journey.

See also Code snippets for the "Developing with SAP Extension Suite" Learning Journey Unit 1 to Unit 3

 

Exercise: Deploy SAP BTP Cloud Foundry Applications Manually

URL for API_BUSINESS_PARTNER destination

https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/

xsappname in generated xs-security.json

risk-management-<YOURDEVSPACE>

Make sure to replace <YOURDEVSPACE> with your dev-space name.

Additional lines for package.json requires section

 

"xsuaa": {
    "kind": "xsuaa"
}

 

 

New requires section of package.json file

Note: Lines starting with //### BEGIN OF INSERT and ending with //### END OF INSERT have been added to the previous version of the section. Lines starting with //### BEGIN OF DELETE and ending with //### END OF DELETE need to be removed from the section.

 

{
    ...
    ...
    "cds": {
        "requires": {
            "API_BUSINESS_PARTNER": {
                "kind": "odata",
                "model": "srv/external/API_BUSINESS_PARTNER",
                //### BEGIN OF DELETE
                "credentials": {
                    "url": "https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/"
                },
                //### END OF DELETE
                //### BEGIN OF INSERT
                "[development]": {
                    "credentials": {
                        "url": "https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/"
                    }
                },
                "[production]": {
                    "credentials": {
                        "destination": "API_BUSINESS_PARTNER"
                    }
                }
                //### END OF INSERT
            },
            "db": {
                "kind": "sql"
            },
            "xsuaa": {
                "kind": "xsuaa"
            }
        },
        "hana": {
            "deploy-format": "hdbtable"
        }
    }
}

 

 

 New resource in mta.yaml file

 

# ------------------------------------------------------------
- name: risk-management-destination-service
# ------------------------------------------------------------
  type: org.cloudfoundry.managed-service
  parameters:
    service: destination
    service-plan: lite

 

 

Exercise: Define Restrictions and Roles in CDS

New content of srv/risk-service.cds file

Note: Lines starting with //### BEGIN OF INSERT and ending with //### END OF INSERT have been added to the previous version of the file. Lines starting with //### BEGIN OF DELETE and ending with //### END OF DELETE need to be removed from the file.

 

using {riskmanagement as rm} from '../db/schema';

/**
 * For serving end users
 */
service RiskService @(path : 'service/risk') {
//### BEGIN OF DELETE
  entity Risks as projection on rm.Risks;
//### END OF DELETE
//### BEGIN OF INSERT
  entity Risks @(restrict : [
            {
                grant : [ 'READ' ],
                to : [ 'RiskViewer' ]
            },
            {
                grant : [ '*' ],
                to : [ 'RiskManager' ]
            }
        ]) as projection on rm.Risks;
//### END OF INSERT
    annotate Risks with @odata.draft.enabled;
//### BEGIN OF DELETE
  entity Mitigations as projection on rm.Mitigations;
//### END OF DELETE
//### BEGIN OF INSERT
  entity Mitigations @(restrict : [
            {
                grant : [ 'READ' ],
                to : [ 'RiskViewer' ]
            },
            {
                grant : [ '*' ],
                to : [ 'RiskManager' ]
            }
        ]) as projection on rm.Mitigations;
//### END OF INSERT
    annotate Mitigations with @odata.draft.enabled;
  entity BusinessPartners as projection on rm.BusinessPartners;
}

 

 

Code for .cdsrc file

 

{
  "[development]": {
    "auth": {
      "passport": {
        "strategy": "mock",
        "users": {
          "risk.viewer@tester.sap.com": {
            "password": "initial",
            "ID": "riskviewer",
            "userAttributes": {
              "email": "risk.viewer@tester.sap.com"
            },
            "roles": ["RiskViewer"]
          },
          "risk.manager@tester.sap.com": {
            "password": "initial",
            "ID": "riskmanager",
            "userAttributes": {
              "email": "risk.manager@tester.sap.com"
            },
            "roles": ["RiskManager"]
          }
        }
      }
    }
  }
}

 

 

Exercise: Set Up SAP Authorization and Trust Management

Command to install hdb module and add it as dependency to package.json file

npm i --save  @sap/xssec  @sap/xsenv

Command to compile project to xs-security.json file

cds compile srv --to xsuaa >xs-security.json

Additional lines for risk-management-xsuaa resource in mta.yaml file

 

     config:
       xsappname: 'risk-management-${space}'
       role-collections:
        - name: 'RiskManager-${space}'
          description: Manage Risks
          role-template-references:
          - $XSAPPNAME.RiskManager
        - name: 'RiskViewer-${space}'
          description: View Risks
          role-template-references:
          - $XSAPPNAME.RiskViewer

 

 

Exercise: Create an Application Router

Command to get the required Node.js version

cat node_modules/@sap/approuter/package.json | grep '"node"'

Lines to be added and removed in approuter/package.json file

Note: Lines starting with //### BEGIN OF INSERT and ending with //### END OF INSERT have been added to the previous version of the file. Lines starting with //### BEGIN OF DELETE and ending with //### END OF DELETE need to be removed from the file.

 

 

{
"name": "approuter",
...
"scripts": {
//### BEGIN OF DELETE
    "test": "echo \"Error: no test specified\" && exit 1"
//### END OF DELETE
//### BEGIN OF INSERT
    "start": "node node_modules/@sap/approuter/approuter.js"
//### END OF INSERT
},
...
"dependencies": {
    "@sap/approuter": "^8.5.5"
//### BEGIN OF DELETE
}
//### END OF DELETE
//### BEGIN OF INSERT
},
"engines": {
    "node": "^14.0.0"
}
//### END OF INSERT
}

 

 

 Content for xs-app.json file

 

{
  "welcomeFile": "/app/risks/webapp/index.html",
  "authenticationMethod": "route",
  "sessionTimeout": 30,
  "logout": {
    "logoutEndpoint": "/do/logout",
    "logoutPage": "/"
  },
  "routes": [
    {
      "source": "^/app/(.*)$",
      "target": "$1",
      "localDir": "resources",
      "authenticationType": "xsuaa"
    },
    {
      "source": "^/service/(.*)$",
      "destination": "srv-binding",
      "authenticationType": "xsuaa"
    }
  ]
}

 

 

Exercise: Add Approuter to MTA

Additional lines for mta.yaml file

 

 

# --------------------  APPROUTER -----------------------------
- name: risk-management-approuter
  # ------------------------------------------------------------
  type: nodejs
  path: approuter
  requires:
    - name: risk-management-xsuaa
    - name: srv-api
      group: destinations
      properties:
        forwardAuthToken: true
        strictSSL: true
        name: srv-binding
        url: "~{srv-url}"
  build-parameters:
    requires:
      - name: risk-management-app
        artifacts:
          - ./*
        target-path: resources
# --------------------  UI -----------------------------------
- name: risk-management-app
  # ------------------------------------------------------------
  type: html5
  path: app
  build-parameters:
    supported-platforms: []

 

 

Exercise: Configure the Stages of a CI/CD Pipeline

New content for .pipeline/config.yml file

 

###
# This file configures the project “Piper” pipeline of your project.
# For a reference of the configuration concept and available options, please have a look into its documentation.
#
# The documentation for the most recent pipeline version can always be found at:
#    https://sap.github.io/jenkins-library/
#
# This is a YAML-file. YAML is an indentation-sensitive file format. Please make sure to properly indent changes to it.
###

### General project setup
---
general:
  pipeline: "sap-cloud-sdk"
  buildTool: "mta"
stages:
  Build:
    mavenExecuteStaticCodeChecks: false
    npmExecuteLint: false
  Additional Unit Tests:
    npmExecuteScripts: false
    karmaExecuteTests: false
  Release:
    cloudFoundryDeploy: true
    tmsUpload: false
steps:
  cloudFoundryDeploy:
    cloudFoundry:
      apiEndpoint: "https://api.cf.eu10.hana.ondemand.com"
      org: "myOrg"
      space: "mySpace"
      credentialsId: "myDeploymentCredentialsId" # set this to 'cfdeploy'
      appName: ""
    mtaDeployParameters: "-f --version-rule ALL"
  artifactPrepareVersion:
    versioningType: "cloud_noTag"

 

 

 

50 Comments
GnanaV
Member

@jannes_schofeld , The link to your blog-post, on code-snippets for units 1-3 is broken ( It says 'Article not found'). 

I was able to access it last week, Also in today's 'Prep for Certification' session, when you clicked, it worked 😳... 

Can you please help me?

Thanks,

Gnana

Katherine_K
Employee
Employee

Hi @GnanaV 

thank you for your query. We have asked the author to look into this.

In parallel, there are known errors on the learning site in relation to links - this may or may not be connected to your query. Our developers are currently working on this on the back-end.

Best regards,

Katherine

GnanaV
Member

Thanks @Katherine_K .

Cheers,

Gnana

binla
Member

Hello @Katherine_K, is there any update about "Unit 1 to Unit 3" link? this link is still broken. Thank you.

Katherine_K
Employee
Employee

Hi @binla 

thank you for your query and sorry to keep you waiting.

I am still awaiting the outcome from the logged ticket. In the meantime, can you please try the links below:

https://groups.community.sap.com/t5/sap-btp-learning/code-snippets-for-the-quot-developing-with-sap-...

https://groups.community.sap.com/t5/sap-btp-learning/code-snippets-for-the-quot-developing-with-sap-...

Please also note: when signed in (profile on top right banner) all links work correctly.

Best regards,

Katherine

keinhoff
Member

Hi @Katherine_K ,

I also started the journey today and stumbled upon missing code snippets in the trainer module. Unfortunately in the first unit with coding thgere are missing some lines in the screenshot and tried to find the snippets to copy them. The link you offered for units 1 - 3 is still not working 😞

keinhoff_0-1639146173418.png

 

 

binla
Member

@Katherine_K 

Thanks for your answer. I've already logged in but the link still not working as screenshot.

binla_0-1639149257035.png

 

Katherine_K
Employee
Employee

Hi @keinhoff and @binla 

I've been informed from the community team that the content is now available. 

Can you please check again? Apologies for the inconvenience.

Thank you,

Katherine

binla
Member

@Katherine_K  it work now, thank you.

vickyokrm
Member

The role assignment  was performed over the 'Default identity provider' in Unit 5. However this option was disabled on my trail account. Nevertheless, i was able to do the role collection assignment under security->users. After restarting the app router the authentication was successful.

vickyokrm_0-1639218710306.png

 

Richie
Employee
Employee

Hi All,

I have an issue with the deployment step. Here is my output from cf push:

npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/yallist/-/yallis... failed, reason: getaddrinfo ENOTFOUND nginx-redirector.repo-cache.svc.cluster.local
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the

I dont think its reallymy network as I have tried with and without being connected to corporate network. I found this blog and tried a npm cache clean --force but does not seem to help: https://answers.sap.com/questions/13431881/building-of-cap-project-fails-npm-registry-sapcds.html

Anyone else facing similar issues?

 

Katherine_K
Employee
Employee

Hi @Richie 

thank you for your query with the development step.

I will leave your question open and search for an expert to support you.

Best regards,

Katherine

Katherine_K
Employee
Employee

Hi again @Richie 

so far, the experts here cannot replicate the error - and suggested that it is a network error on your side. I will let you know if I hear more.

Best regards,

Katherine

Richie
Employee
Employee

Hi Kathrine,

I have asked my colleagues to test the url http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/yallist/-/yallis...but it does not work for them either, so I doubt highly its a network error.

Thanks,

Richie

Katherine_K
Employee
Employee

OK thanks for the quick reply @Richie - I'm going to ask them to keep looking into this.

@jannes_schofeld @markushaug @Illya 

Thank you,
Katherine

vickyokrm
Member

This learning journey and materials helped me to pass this certification. Thanks everyone. Happy Learning!

Ninja
Member

Congratulations @ vickyokrm !!

Could you confirm you used any other study material apart from this , will help others who are preparing to plan to go for this certification . 

Regards, Ninja

 

Margit_Wagner
Employee
Employee

Hi vickyokrm,
Congratulations on passing the exam! 
Kind regards
Margit

Richie
Employee
Employee

Hi @Katherine_K , 

Any joy on a fix for my issue?

@vickyokrm did you have any issues using the cf push command during your training?

Richie
Employee
Employee
Margit_Wagner
Employee
Employee

Hi @Richie 

I informed our experts who will revert back to you 
Kind regards
Margit

markushaug
Employee
Employee

Hi  @Richie ,

I just want to have a look at your package-lock.json.

It's in your projects root folder next to package.json. Please search for "yallist" and send me the entries.

 

BR,

Markus

dhrubajyoti
Employee
Employee

 

​I have the same exact problem. My MTA also fails.

I am going through the CLD200 documentation stepwise and building the sample application.


It has been working properly, until I get to the Manual Deployment chapter.

 

Issue#1: The cf push command from page #156 from the document keeps failing. When I run the cf push command, I get the below error:

user: risk-management $ cf push

Pushing apps risk-management-srv, risk-management-db-deployer to org 20afb725trial / space dev as dhrubajyoti.basak@sap.com...

Applying manifest file /home/user/projects/risk-management/manifest.yml...

Manifest applied

Packaging files to upload...

Uploading files...

9.24 KiB / 9.24 KiB 100.00% 1s

 

Waiting for API to complete processing files...

 

Staging app and tracing logs...

Downloading nodejs_buildpack...

Downloaded nodejs_buildpack

Cell 5ddf71ab-938b-4a0b-bfba-5933153fd5a9 creating container for instance cc92ccaf-1a67-403e-8b7a-66172f1e59ea

Cell 5ddf71ab-938b-4a0b-bfba-5933153fd5a9 successfully created container for instance cc92ccaf-1a67-403e-8b7a-66172f1e59ea

Downloading app package...

Downloaded app package (327.8K)

-----> Nodejs Buildpack version 1.7.63

-----> Installing binaries

engines.node (package.json): >=12.18

engines.npm (package.json): unspecified (use default)

**WARNING** Dangerous semver range (>) in engines.node. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html

-----> Installing node 16.11.1

Copy [/tmp/buildpacks/b5d6a61786998958022dd900561c3bef/dependencies/b1672274bee4660a04596e3593464719/node_16.11.1_linux_x64_cflinuxfs3_beefe428.tgz]

Using default npm version: 8.0.0

-----> Installing yarn 1.22.17

Copy [/tmp/buildpacks/b5d6a61786998958022dd900561c3bef/dependencies/4984aeaaf5967be21b1e442d431a1957/yarn_1.22.17_linux_noarch_any-stack_08892f64.tgz]

Installed yarn 1.22.17

-----> Creating runtime environment

PRO TIP: It is recommended to vendor the application's Node.js dependencies

Visit http://docs.cloudfoundry.org/buildpacks/node/index.html#vendoring

NODE_ENV=production

NODE_HOME=/tmp/contents3826178700/deps/0/node

NODE_MODULES_CACHE=true

NODE_VERBOSE=false

NPM_CONFIG_LOGLEVEL=error

NPM_CONFIG_PRODUCTION=true

-----> Building dependencies

Installing node modules (package.json + package-lock.json)

npm notice

npm notice New minor version of npm available! 8.0.0 -> 8.3.0

npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.3.0

npm notice Run `npm install -g npm@8.3.0` to update!

npm notice

npm ERR! code ENOTFOUND

npm ERR! syscall getaddrinfo

npm ERR! errno ENOTFOUND

npm ERR! network request to http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/yallist/-/yallis... failed, reason: getaddrinfo ENOTFOUND nginx-redirector.repo-cache.svc.cluster.local

npm ERR! network This is a problem related to network connectivity.

npm ERR! network In most cases you are behind a proxy or have bad network settings.

npm ERR! network

npm ERR! network If you are behind a proxy, please make sure that the

npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in:

npm ERR! /tmp/cache/final/.npm/_logs/2022-01-12T16_47_09_948Z-debug.log

**ERROR** Unable to build dependencies: exit status 1

BuildpackCompileFailed - App staging failed in the buildpack compile phase

FAILED

 


Issue #2: I am also facing issues with the MTA build process. When I run the command “mbt build -t ./”, it also fails with the below error:

user: risk-management $ mbt build -t ./

[2022-01-12 20:00:41] INFO Cloud MTA Build Tool version 1.2.7

[2022-01-12 20:00:41] INFO generating the "Makefile_20220112200041.mta" file...

[2022-01-12 20:00:41] INFO done

[2022-01-12 20:00:41] INFO executing the "make -f Makefile_20220112200041.mta p=cf mtar= strict=true mode= t=\"./\"" command...

[2022-01-12 20:00:41] INFO validating the MTA project

[2022-01-12 20:00:41] INFO running the "before-all" build...

[2022-01-12 20:00:41] INFO executing the "npm ci" command...

npm WARN prepare removing existing node_modules/ before installation

npm ERR! cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.

npm ERR!

npm ERR!

npm ERR! Missing: hdb@^0.18.3

npm ERR!

 

npm ERR! A complete log of this run can be found in:

npm ERR! /home/user/.npm/_logs/2022-01-12T20_00_42_587Z-debug.log

[2022-01-12 20:00:42] ERROR the "before-all"" build failed: could not execute the "npm ci" command: exit status 1

make: *** [Makefile_20220112200041.mta:28: pre_build] Error 1

Error: could not build the MTA project: could not execute the "make -f Makefile_20220112200041.mta p=cf mtar= strict=true mode= t=\"./\"" command: exit status 2

Richie
Employee
Employee

Hi @dhrubajyoti ,

Unfortunately I have not got a resolution to this yet. @Margit_Wagner  is looking into this for us are there are more and more people with the same issue. If you find something please report back here :-).

Richie

jannes_schofeld
Employee
Employee

Hi @dhrubajyoti ,

let's try to find the solution within the question that you opened: https://groups.community.sap.com/t5/sap-btp-learning/cld200-manual-deployment-keeps-erroring-out/qaq... 

Best regards,

Jannes

Margit_Wagner
Employee
Employee

Hi @dhrubajyoti and Hi @Richie 
We have received your request and are in the process of evaluating the problem 
Please be assured that we are proactive in the problem-solving process and will do whatever we can to offer a quick sustainable solution that fixes the problem, so that you can proceed with your learnings
Kind regards
Margit

 

knittedman007
Employee
Employee

I think the issue with the npm issue is related to the node/npm version.  I had a similar problem with a very similar error on one system, but it worked fine on another - the only difference was the node installation.  The failing system had node 17.01, with npm 8.1.0.  If I reverted to node 12.16.1 (npm 7.0.10) it works fine.

So I think something has broken with newer node/npm installs.

k_Rituraj
Employee
Employee

Hi,

I am using a trial account & following the extension suite learning journey.

In unit 4, when I am using cf push command to deploy, I am getting this error Routes quota exceeded for the organization. Can anyone provide some hint or suggestion?

k_Rituraj_0-1642149645937.png

In my trial account, I have below subscriptions 

k_Rituraj_1-1642149690406.png

Regards

KR

jannes_schofeld
Employee
Employee

Hi @k_Rituraj ,

did you try to follow the suggestions from this community question: https://answers.sap.com/questions/556246/cloud-foundry-trial--you-have-exceeded-the-total-r.html ?

Especially checking the existing routes within your dev space in the BTP Cockpit?

Best regards,

Jannes

Illya
Employee
Employee

Dear @k_Rituraj 
please check in your trial subaccount the quota assigned to Clound Foundry. It has to be something between 1 or 4 units (GB)

Illya_0-1642152148160.png

If "0 of 0GB Memory" appears you need to entitle (Entitlements) at least 1 unit (GB) for Cloud Foundry Runtime.

BR,
Illya

Richie
Employee
Employee

Hi    @dhrubajyot @Margit_Wagner @knittedman007 ,

I ran the cf push again this morning and everything now appears to be working. I did not change anything so as  @knittedman007  mentioned something must have been broken with node/npm. 

k_Rituraj
Employee
Employee

Dear @Illya ,

Yes, you are right it shows 0 out of 0.

I changed it & it started working

Regards

KR

jannes_schofeld
Employee
Employee

Hi @k_Rituraj ,

Edit: Just saw that you got it running already. Great! Keeping the following summary in the thread, in case someone else experiences the same issue.

On the subaccount level within the BTP Cockpit, there is the Entitlements area. In the Entitlements make sure, that the required entitlements are assigned to the subaccount (see following screenshot):

Screenshot 2022-01-14 at 14.46.39.png

If you need to change entitlements, use the Configure Entitlements button and adjust them:

Screenshot 2022-01-14 at 14.46.50.png

When you have all the required entitlements on your subaccount, navigate to the Cloud Foundry > Quota Plans section and make sure, there is a quota plan that contains the required quota and is assigned to your Cloud Foundry Space (usually dev). If the quota plan does not have the required amount of memory or routes, adjust it or create a new plan.

Screenshot 2022-01-14 at 14.47.30.png

Usually these things are preconfigured in the BTP trial account.

Best regards,

Jannes

 

Christer
Employee
Employee

Hi,

I've copied the "Add Approuter to MTA" section but I get errors in the mta.yaml like this (get it for "path" and "build-parameters" in the added section):

Christer_0-1642580088163.png

How to solve it?

BR

Christer Hedström

jannes_schofeld
Employee
Employee

Hi @Christer ,

please make sure to add the approuter module within the  modules: section of your mta.yaml file. I think in your case you have added it to the resources: section - but the approuter is a component of your overall multi-target application that you are deploying using the mta.yaml file. 

Best regards,

Jannes

Christer
Employee
Employee

Ah, ok... Yes, it works now (after I moved it to the correct section. Thanks!

BR

Christer

Animatron
Member

@Richie I'm facing the same issue since two weeks now and is doesnt seem to better.

Is there a solution to this problem yet or has this completely to do something with my settings? 

Best Regards, 

Benjamin 

jannes_schofeld
Employee
Employee

Hi @Animatron ,

could you please have a look into this question / thread, try out the suggested steps and then post your results there? 

https://groups.community.sap.com/t5/sap-btp-learning/cld200-manual-deployment-keeps-erroring-out/qaq...

Thanks and regards,

Jannes

Animatron
Member

Hi @jannes_schofeld , 

I followed the instruction you've mentioned. 

Unfortunately this didnt solve the issue, I was still getting the error. 

What did solve the issue was to completely undeploy and redeploy the application. 

I am not sure why but the error is now gone and we were able to deploy the app. 

Thank you very much and best regards 

Benjamin 

Dino
Member

Hi @Animatron ,

I found a solution today.
I had to set the node/npm versions in package.json:

  "engines": {
    "node""16.11.1",
    "npm""8.0.0"
  }
Hope this helps for you too.

Best regards,
Dino

would still be good if the final solution can be published on github. It is a good tutorial to navigate.

I know there is one here, but it has too many branches and lack of documentation obviously.

https://github.com/SAP-samples/cloud-cap-risk-management

 

k_Rituraj
Employee
Employee

Hi ,

While accessing CI CD application I am getting below popup.Also + button to add repositories is greyed out.

k_Rituraj_0-1643616593277.png

When I check role collection , I have necessary roles assigned to my user.

k_Rituraj_1-1643616674744.png

 

Can any one suggest what could have gone wrong.

Thanks & Regards

KR

Dino
Member

Hi @k_Rituraj ,

in the screenshot I only see that the roles are assigned to the role collections. You need to assign your user to the role collections.
If you use a custom IdP you can add the User Group or you need to add your user to the 'Users' list.
Can you check if you have done this?

image.png

If you have done this I don't know what goes wrong. Did you try to re-login with an 'inPrivate' tab? Maybe there is something in the browser cache?

Best regards,
Dino

k_Rituraj
Employee
Employee

Hi @Dino 

Yes, I did that, Still this error is coming.

k_Rituraj_1-1643617730504.png

 

 

Dino
Member

Hi @k_Rituraj ,

Did you try to re-login with an 'inPrivate' tab? Maybe there is something in the browser cache?

k_Rituraj
Employee
Employee

Thanks @Dino , Yes it was browser cache issue. It worked now

DustinWilson
Employee
Employee

resolved

DustinWilson
Employee
Employee

In the section Add the UI and Approuter Module to the MTA and the step cf deploy risk-management3_1.0.0.mtar(my build is risk-management3) - I get this error:
Service operation failed: Controller operation failed: 502 Updating service "risk-management-xsuaa" failed: Bad Gateway: CF-ServiceBrokerBadResponse(10001): Service broker error: Service broker xsuaa failed with: org.springframework.cloud.servicebroker.exception.ServiceBrokerException: Error updating application risk-management-dev!t65441 (Cannot change AppId with update. Old AppId: risk-management-risk-management3!t65441 New AppId: risk-management-dev!t65441)

I cannot seem to get past this issue.

howiehu
Member

@jannes_schofeld 

Hi, my trial subaccount must to use 'cf login --sso' with a one-time-passcode to log in to the cloud foundry.

How can I set it up in CI/CD's credential?

jannes_schofeld
Employee
Employee

Hi @DustinWilson ,

the issue seems to be, that there is an existing service instance risk-management-xsuaa in your account (you have created that one in the previous exercises manually).

Now during the automatic deployment using the mta.yaml descriptor file, the system tries to update that service instance using the given configurations. The configurations are as follows:

config:
       xsappname: 'risk-management-${space}'
       role-collections:
        - name: 'RiskManager-${space}'
          description: Manage Risks
          role-template-references:
          - $XSAPPNAME.RiskManager
        - name: 'RiskViewer-${space}'
          description: View Risks
          role-template-references:
          - $XSAPPNAME.RiskViewer

Basically that means, the xsappname that is defined here needs to be the same that has been used previously when creating the XSUAA service instance (with the xs-security.json file). So to resolve the issue, either adjust the xsappname parameter in the mta.yaml file to match the xsappname that was defined in the xs-security.json during manual setup or remove the existing xsuaa service instance from your BTP account, which means that a new service instance will be created during mta deployment.

Hope this helps. Best regards,

Jannes