# How to deploy a Dynatrace Custom App using GitHub Actions?

**URL:** <https://community.dynatrace.com/t/how-to-deploy-a-dynatrace-custom-app-using-github-actions/45450>\
**Category:** Developer Q&A Forum\
**Tags:** custom-actions, custom-app, workflows\
**Created:** [May 6, 2024, 2:28pm UTC](https://community.dynatrace.com/t/how-to-deploy-a-dynatrace-custom-app-using-github-actions/45450 "2024-05-06T14:28:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaximilianoML](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maximilianoml/32/25038_2.png) [@MaximilianoML](https://community.dynatrace.com/u/MaximilianoML)\
**Post date:** [May 6, 2024, 2:28pm UTC](https://community.dynatrace.com/t/how-to-deploy-a-dynatrace-custom-app-using-github-actions/45450/1 "2024-05-06T14:28:14Z")

</div>

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](https://global.discourse-cdn.com/dynatrace/original/3X/6/7/6742678c84a312fb74e68e11d9e0fce70007966f.png)

That’s the step.

---

<div class="post-metadata">

**Author:** ![PennyScully](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pennyscully/32/32029_2.png) [@PennyScully](https://community.dynatrace.com/u/PennyScully)\
**Post date:** [May 6, 2024, 2:51pm UTC](https://community.dynatrace.com/t/how-to-deploy-a-dynatrace-custom-app-using-github-actions/45450/2 "2024-05-06T14:51:35Z")

</div>

Hi&nbsp;[@MaximilianoML](https://community.dynatrace.com/user/73851)

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:&nbsp;[https://www.dynatrace.com/news/blog/tailored-access-management-part-2-onboard-users-to-grail-and-app…](https://www.dynatrace.com/news/blog/tailored-access-management-part-2-onboard-users-to-grail-and-appengine/)

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

---

<div class="post-metadata">

**Author:** ![MaximilianoML](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maximilianoml/32/25038_2.png) [@MaximilianoML](https://community.dynatrace.com/u/MaximilianoML)\
**Post date:** [May 6, 2024, 3:00pm UTC](https://community.dynatrace.com/t/how-to-deploy-a-dynatrace-custom-app-using-github-actions/45450/3 "2024-05-06T15:00:08Z")

</div>

Hello,&nbsp;[@PennyScully](https://community.dynatrace.com/user/49766)!

First, thank you for your fast response!

I already have this permission, and&nbsp;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.

---

<div class="post-metadata">

**Author:** ![sinisa\_zubic](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sinisa_zubic/32/32498_2.png) [@sinisa\_zubic](https://community.dynatrace.com/u/sinisa_zubic)\
**Post date:** [May 8, 2024, 8:13am UTC](https://community.dynatrace.com/t/how-to-deploy-a-dynatrace-custom-app-using-github-actions/45450/4 "2024-05-08T08:13:42Z")

</div>

Hi&nbsp;[@MaximilianoML](https://community.dynatrace.com/user/73851)

I assume you run the&nbsp; **npm run deploy** &nbsp;within the GitHub action.

To deploy you need to authenticate using an oauth Client and set the **DT\_APP\_OAUTH\_CLIENT\_ID** &nbsp;and&nbsp; **DT\_APP\_OAUTH\_CLIENT\_SECRET** &nbsp;environment variables.

Following are the docs that will help you:

- [How to create OAuth client](https://developer.dynatrace.com/develop/access-platform-apis-from-outside/#create-an-oauth-client)
- [Dynatrace App Toolkit configuration](https://developer.dynatrace.com/reference/app-toolkit/configuration/#environment-variables)

Let me know if it works for you.

Best  
Sini

---

<div class="post-metadata">

**Author:** ![DaveOps](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@DaveOps](https://community.dynatrace.com/u/DaveOps)\
**Post date:** [August 13, 2024, 9:07am UTC](https://community.dynatrace.com/t/how-to-deploy-a-dynatrace-custom-app-using-github-actions/45450/5 "2024-08-13T09:07:29Z")

</div>

I have a similar issue:

- script: npm run deploydisplayName: 'Deploy Application’env:DT\_APP\_OAUTH\_CLIENT\_ID: $(DT\_APP\_OAUTH\_CLIENT\_ID)DT\_APP\_OAUTH\_CLIENT\_SECRET: $(DT\_APP\_OAUTH\_CLIENT\_SECRET)

```javascript
> 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:

```javascript
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

```

---

<div class="post-metadata">

**Author:** ![sinisa\_zubic](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sinisa_zubic/32/32498_2.png) [@sinisa\_zubic](https://community.dynatrace.com/u/sinisa_zubic)\
**Post date:** [August 22, 2024, 8:27am UTC](https://community.dynatrace.com/t/how-to-deploy-a-dynatrace-custom-app-using-github-actions/45450/6 "2024-08-22T08:27:02Z")

</div>

Hi [@DaveOps](https://community.dynatrace.com/user/78577)

Please create a support ticket via&nbsp;[https://one.dynatrace.com/hc/en-us/requests](https://one.dynatrace.com/hc/en-us/requests)&nbsp;. Tech support will help you with this issue.

Best,  
Sini
