cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble Executing abapEnvironmentRunATCCheck with SAP Piper command on Azure DevOps Pipeline

saurabh_chikate
Active Participant
0 Kudos

Dear Experts,

I'm currently working on setting up DevOps for SAP BTP ABAP Environment using the SAP Piper project. I have successfully cached the Piper executable at runtime and can execute Cloud Foundry commands from my pipeline. However, I'm facing a specific challenge when attempting to run the `abapEnvironmentRunATCCheck` command. Despite providing what I believe to be all the necessary parameters for my SAP BTP account, I'm encountering the following error message:

fatal abapEnvironmentRunATCCheck - step execution failed -
Parameters missing. Please provide EITHER the Host of the ABAP server OR the
Cloud Foundry ApiEndpoint, Organization, Space, Service Instance, and a
corresponding Service Key for the Communication Scenario SAP_COM_0510.

Command that I managed to compile from the documentation was as below

bin/piper abapEnvironmentRunATCCheck --verbose --cfOrg
'my-org' --cfSpace 'CF-Space-name' --cfApiEndpoint
'https://api.cf.euXX.hana.ondemand.com/' --username 'myusername' --password
'myPassword' --atcConfig: 'atcconfig.yml'

Please note that the `atcconfig.yml` file is located in the same directory as the pipeline.

I also tried running another version of the same command where username and password of my account was replaced with communication user credentials for both scenarios. This as expected did not help either.

I've consulted SAP documentation, which indicates that the Communication Scenario `SAP_COM_0510` is no longer valid. As a result, I've reconfigured the pipeline to use the new scenario `SAP_COM_0901`. However, I'm uncertain whether the `abapEnvironmentRunATCCheck` command is correctly invoking this new Communication Scenario.

Questions:

1. How can I ensure that the `abapEnvironmentRunATCCheck` command correctly invokes the new Communication Scenario, `SAP_COM_0901`?

2. Are there any specific parameters or additional configurations that I need to adjust for `abapEnvironmentRunATCCheck` ?

I'd greatly appreciate any assistance or insights on resolving this issue and ensuring that the correct Communication Scenario is applied during the execution of the `abapEnvironmentRunATCCheck` command.

Accepted Solutions (1)

Accepted Solutions (1)

DanielMieg
Advisor
Advisor

Hi!

Thanks for your question. I believe you need to add two more parameters: 'cfServiceKeyName' and 'cfServiceInstance'. 'cfServiceInstance' would point to the SAP BTP, ABAP Environment system (the name it has in the BTP Cockpit). 'cfServiceKeyName' would point to the service key for SAP_COM_0901 of the instance specified with 'cfServiceInstance'.

In your setup, the service key must be created beforehand. This can be done in the BTP Cockpit. During the creation of the service key, you need to provide a name and a json configuration. The json configuration should look like this:

{
  "scenario_id": "SAP_COM_0901",
  "type": "basic"
}

In the abapEnvironmentRunATCCheck configuration, you reference the name of the service key.

Please let me know if you have any further questions.

Best regards

Daniel

saurabh_chikate
Active Participant

Hello Daniel,

Thanks for taking time to read through and helping with your response.

Creating a key with scenario details and adding 2 additional parameters solved the issue.

Adding the code below for reference to future readers.

bin/piper abapEnvironmentRunATCCheck --verbose --cfOrg 'MyCFOrg' --cfSpace 'MyCFSpace' --cfApiEndpoint 'https://api.cf.zzzz.hana.ondemand.com/' --username 'zzzz' --password 'zzzz' --atcConfig 'atcconfig.yml' --cfServiceKeyName 'ServiceKeyCreatedwithCOmmScenarioParams' --cfServiceInstance 'ABAPServInstance'
saurabh_chikate
Active Participant
0 Kudos

I am still facing one challenge though. It is related to locating the atcconfig.yml file.

I initially placed the atcconfig.yml file in the same directory as my pipeline, both of which are in the root folder of my project. Additionally, I also tried creating a separate folder named .pipeline and placing the atcconfig.yml file there. Despite these attempts, the issue persisted.

At this point, I believe the location and contents of the atcconfig.yml file are correct, and I've referred to the SAP Piper documentation to ensure that it adheres to the guidelines for writing the file.

Given these efforts, I'm starting to suspect that the issue might be related to pipeline compatibility or other configuration factors that I may have missed. All this is being done on Azure Pipeline and I keep on seeing document references which are very specific to Jenkins.

Here is the file content snapshot.

objectset:
softwarecomponents:
- name: ZAZ_TEST001
packages:
- name: ZAZ_TEST001

Answers (2)

Answers (2)

DanielMieg
Advisor
Advisor

Hi!

What are the error messages in the pipeline log?

I have not been able to test the pipeline steps on Azure yet.

On Jenkins, the file must be in the pipeline's root folder. The pipeline files get copied to the workspace of the Jenkins job during the runtime.

saurabh_chikate
Active Participant
0 Kudos

Thanks for your reply Daniel,

Pipeline configuration and Piper commands are placed to into azure-pipeline.yml. atcconfig.yml file is as well in the same directory.

Below is the structure of repository root directory.

Error we encountered is as below. Please have a look at line number 09

01 debug abapEnvironmentRunATCCheck - --------------------------------
02 debug abapEnvironmentRunATCCheck - --> GET request to https://replacedByDummyURL.hana.ondemand.com/sap/bc/adt/api/atc/runs/0000000000000000000000000000000...
03 debug abapEnvironmentRunATCCheck - headers: map[Accept:[application/vnd.sap.atc.run.v1+xml] Authorization:[<set>] X-Csrf-Token:[fetch]]
04 debug abapEnvironmentRunATCCheck - cookies:
05 debug abapEnvironmentRunATCCheck - --------------------------------
06 debug abapEnvironmentRunATCCheck - <-- response 200 https://replacedByDummyURL.hana.ondemand.com/sap/bc/adt/api/atc/runs/0000000000000000000000000000000... (240.5ms)
07 debug abapEnvironmentRunATCCheck - --------------------------------
08 info abapEnvironmentRunATCCheck - fatal error: errorDetails{"category":"undefined","correlationId":"https://replacedByDummyAzureRepoURL/_build/results?buildId=215493","error":"No configuration provided - please provide either an ATC configuration file or a repository configuration file","library":"SAP/jenkins-library","message":"step execution failed","result":"failure","stepName":"abapEnvironmentRunATCCheck","time":"2023-10-26T09:03:33.843905691Z"}
09 fatal abapEnvironmentRunATCCheck - step execution failed - No configuration provided - please provide either an ATC configuration file or a repository configuration file
10 info abapEnvironmentRunATCCheck - Step telemetry data:{"StepStartTime":"2023-10-26 09:03:30.522247701 +0000 UTC","PipelineURLHash":"2cc70b6d699a7d01de604b9c25a4ce0df3a6255c","BuildURLHash":"264cf95c22b883639f1c7494a999026570920946","StageName":"CreateABAPEnvironmentSystem","StepName":"abapEnvironmentRunATCCheck","ErrorCode":"1","StepDuration":"3323","ErrorCategory":"undefined","CorrelationID":"https://replacedByDummyAzureRepoURL/_build/results?buildId=215493","PiperCommitHash":"5f4cd838cfd4fc7825c0587d6b432808dc97b3f0","ErrorDetail":{"category":"undefined","correlationId":"https://replacedByDummyAzureRepoURL/_build/results?buildId=215493","error":"No configuration provided - please provide either an ATC configuration file or a repository configuration file","library":"SAP/jenkins-library","message":"step execution failed","result":"failure","stepName":"abapEnvironmentRunATCCheck","time":"2023-10-26T09:03:33.843905691Z"}}
11 debug abapEnvironmentRunATCCheck - Sending telemetry data
12 debug abapEnvironmentRunATCCheck - no trusted certs found / using default transport / insecure skip set to true / : continuing with existing tls config
13 debug abapEnvironmentRunATCCheck - Transport timeout: 3m0s, max request duration: 5s
14 debug abapEnvironmentRunATCCheck - --------------------------------
15 debug abapEnvironmentRunATCCheck - --> GET request to https://webanalytics.cfapps.eu10.hana.ondemand.com/tracker/log?action_name=Piper+Library+OS&custom10...
16 debug abapEnvironmentRunATCCheck - headers: map[]
17 debug abapEnvironmentRunATCCheck - cookies:
18 debug abapEnvironmentRunATCCheck - --------------------------------
19 debug abapEnvironmentRunATCCheck - <-- response 204 https://webanalytics.cfapps.eu10.hana.ondemand.com/tracker/log?action_name=Piper+Library+OS&custom10... (102.18ms)
20 debug abapEnvironmentRunATCCheck - --------------------------------
What I have tried
  1. I tried placing file inside .pipeline folder as well just to be sure but it does not seem to work.
  2. Tried renaming the file name parameter in the pipeline code keeping the actual name same. Here I got error telling me the file is not found. It tells that the file is readable by pipeline but it could not understand the ATC Check config that is given in the file. File config syntax is referred from SAP Piper documentation referring to ATC Check command. I have also tried multiple combinations of parameters to no avail.
objectset:
softwarecomponents:
- name: ZAZ_TEST001
packages:
- name: ZAZ_TEST001
Thanks again for your time and any insights on this would be appreciated.
DanielMieg
Advisor
Advisor
0 Kudos

Hi, could you try the following format (see samples)?

Please also reference the atcConfig.yml file in the config.yml file.

atcobjects:
  softwarecomponent:
    - name: "/NAMESPC/COMPONENTA"
    - name: "/NAMESPC/COMPONENTB"