cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to deploy a Dynatrace Custom App using GitHub Actions?

MaximilianoML
Helper

Hello colleagues, I'm having a problem deploying my Custom App via GitHub Actions.
The code is stuck in the authentication step, I'm using node.js v20 as indicated. If you can help me, I would really appreciate it!

73fa286a-1614-4b43-9065-9a8379b7a84a.png

That's the step.

Fullstack developer | Tech Lover
5 REPLIES 5

PennyScully
Dynatrace Helper
Dynatrace Helper

Hi @MaximilianoML 

As a first step it would be good to check you have the proper policies & permissions assigned. Please make sure you have the policy AppEngine developer and AppEngine user policy assigned. For more information, please have a look at this blog: https://www.dynatrace.com/news/blog/tailored-access-management-part-2-onboard-users-to-grail-and-app...

It could be that you are missing the permission "app-engine:apps:install"

 

If this doesn't help your situation, let us know and share more information about the error, so that we can help you further.

 

Best,
Penny

Hello, @PennyScully!

First, thank you for your fast response! 

I already have this permission, and I have already performed other Deploys manually via CLI, but I want to automate this using GitHub Actions, with .yml, but the code is waiting for authentication but it should be done through the Browser, and this is my problem, I would like to know how to solve this.

Fullstack developer | Tech Lover

sinisa_zubic
Dynatrace Champion
Dynatrace Champion

Hi @MaximilianoML 

I assume you run the npm run deploy within the GitHub action.

To deploy you need to authenticate using an oauth Client and set the DT_APP_OAUTH_CLIENT_ID and DT_APP_OAUTH_CLIENT_SECRET environment variables.

Following are the docs that will help you:

Let me know if it works for you. 

 

Best
Sini

DaveOps
Contributor

I have a similar issue:

- script: npm run deploy
displayName: 'Deploy Application'
env:
DT_APP_OAUTH_CLIENT_ID: $(DT_APP_OAUTH_CLIENT_ID)
DT_APP_OAUTH_CLIENT_SECRET: $(DT_APP_OAUTH_CLIENT_SECRET)



 

> dt-app deploy

- Building your app
- Building...
✔ App is built
- Deploying the app
Error: Error while connecting to the app registry
Forbidden

Authentication failed!

Please make sure that:
* The provided client ID and the secret are correct.
* The provided client ID has needed scopes.

Deploy scopes:
* app-engine:apps:run
* app-engine:apps:install
* app-engine:apps:delete

Uninstall scopes:
* app-engine:apps:delete

Telemetry scopes:
* app-engine:apps:run

Development server needs all the scopes specified in the app.config.

For more details on how you can configure authentication, see https://dt-url.net/qw024j8

 

 
When testing the oauth api manually:

curl --location --request POST 'https://sso.dynatrace.com/sso/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=xx' \
--data-urlencode 'client_secret=yy'

{"scope":"app-engine:apps:install","token_type":"Bearer","expires_in":300,"access_token":"e

Hi @DaveOps 

Please create a support ticket via https://one.dynatrace.com/hc/en-us/requests . Tech support will help you with this issue.

Best,
Sini

Featured Posts