# What oauth scope is needed to run an app function?

**URL:** <https://community.dynatrace.com/t/what-oauth-scope-is-needed-to-run-an-app-function/37677>\
**Category:** Developer Q&A Forum\
**Tags:** app-functions\
**Created:** [December 13, 2022, 11:46am UTC](https://community.dynatrace.com/t/what-oauth-scope-is-needed-to-run-an-app-function/37677 "2022-12-13T11:46:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Radoslaw\_Szulgo](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radoslaw_szulgo/32/1977_2.png) [@Radoslaw\_Szulgo](https://community.dynatrace.com/u/Radoslaw_Szulgo)\
**Post date:** [December 13, 2022, 11:46am UTC](https://community.dynatrace.com/t/what-oauth-scope-is-needed-to-run-an-app-function/37677/1 "2022-12-13T11:46:20Z")

</div>

I can’t find in the documentation the scope needed in the configuration to run an app function. I guess that’s a reason why I get 403 in the app when trying to call it?

---

<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:** [December 13, 2022, 12:34pm UTC](https://community.dynatrace.com/t/what-oauth-scope-is-needed-to-run-an-app-function/37677/2 "2022-12-13T12:34:43Z")

</div>

as long as you user has the policy&nbsp;app-engine:functions:run and app-engine:apps:run&nbsp;you should be covered. I never had to any scopes when I wanted to call the functions.

How do you call your function? do you do it with fetch(\<relative url\>) or with functions.call(\<function name\>)

---

<div class="post-metadata">

**Author:** ![michal\_zawislak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michal_zawislak/32/13613_2.png) [@michal\_zawislak](https://community.dynatrace.com/u/michal_zawislak)\
**Post date:** [December 13, 2022, 1:56pm UTC](https://community.dynatrace.com/t/what-oauth-scope-is-needed-to-run-an-app-function/37677/3 "2022-12-13T13:56:56Z")

</div>

Hi Radosław,

In addition to what Sinisa wrote; apps might require additional scopes that are necessary for them to work properly. Those scopes are defined in _app.config.ts_. Here’s an Automations app example:

 ![2022-12-13 14_56_10-Clipboard.png](https://global.discourse-cdn.com/dynatrace/original/2X/3/31ba5de1f2733b947325cf3e2c8ada9ef321a31c.png)

More details about the _scopes_ setting:&nbsp;[https://developer.dynatrace.com/reference/app-toolkit/configuration/#app-options](https://developer.dynatrace.com/reference/app-toolkit/configuration/#app-options)

---

<div class="post-metadata">

**Author:** ![Radoslaw\_Szulgo](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radoslaw_szulgo/32/1977_2.png) [@Radoslaw\_Szulgo](https://community.dynatrace.com/u/Radoslaw_Szulgo)\
**Post date:** [December 13, 2022, 6:27pm UTC](https://community.dynatrace.com/t/what-oauth-scope-is-needed-to-run-an-app-function/37677/4 "2022-12-13T18:27:26Z")

</div>

That’s what I needed! I had to just add:

```auto
app-engine:apps:run
environment-api:credentials:read

```

[@sinisa\_zubic](https://community.dynatrace.com/user/38283) any plans to add it to the Dynatrace Developer portal?

---

<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:** [December 13, 2022, 6:37pm UTC](https://community.dynatrace.com/t/what-oauth-scope-is-needed-to-run-an-app-function/37677/5 "2022-12-13T18:37:38Z")

</div>

it is already in Dynatrace Developer in the SDK documentation. e.g. when you use the getCredentials function you can see the needed scope:&nbsp;[Classic environment v2 | Dynatrace Developer](https://developer.dynatrace.com/reference/sdks/client-classic-environment-v2/#getcredentials)

also you see for which call you need the app-engine:apps:run scope, e.g. here:&nbsp;[AppEngine - registry | Dynatrace Developer](https://developer.dynatrace.com/reference/sdks/client-app-engine-registry/#getapp)

There are ideas for improvement, but no timeline
