# How to generate environment.yaml file for downloading config using Monaco

**URL:** <https://community.dynatrace.com/t/how-to-generate-environment-yaml-file-for-downloading-config-using-monaco/39054>\
**Category:** Open Q&A\
**Tags:** monaco\
**Created:** [March 28, 2023, 3:33pm UTC](https://community.dynatrace.com/t/how-to-generate-environment-yaml-file-for-downloading-config-using-monaco/39054 "2023-03-28T15:33:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanveer](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@Tanveer](https://community.dynatrace.com/u/Tanveer)\
**Post date:** [March 28, 2023, 3:33pm UTC](https://community.dynatrace.com/t/how-to-generate-environment-yaml-file-for-downloading-config-using-monaco/39054/1 "2023-03-28T15:33:05Z")

</div>

I am fairly new to DT and need help on API token mentioned in environment.yaml file, I am trying to configure Monaco and would like to know how to generate this please

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [March 28, 2023, 4:03pm UTC](https://community.dynatrace.com/t/how-to-generate-environment-yaml-file-for-downloading-config-using-monaco/39054/2 "2023-03-28T16:03:47Z")

</div>

Hi,

You have more than one way to do it but one example would be:

---------------------------------------------------------------

name\_environment:  
&nbsp; &nbsp; - name: “name”  
&nbsp; &nbsp; - env-url: "https://{environmentid}.live.dynatrace.com&nbsp;"  
&nbsp; &nbsp; - env-token-name: “API\_TOKEN”

---------------------------------------------------------------

And you can execute “monaco download -e environments.yaml” to download entire environment configuration or “monaco download -e environments.yaml --specific-api some\_api” to download specific API.

Best regards

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [March 28, 2023, 5:49pm UTC](https://community.dynatrace.com/t/how-to-generate-environment-yaml-file-for-downloading-config-using-monaco/39054/3 "2023-03-28T17:49:58Z")

</div>

Hi&nbsp;[@Tanveer](https://community.dynatrace.com/user/61266),

For token generation, yellow roles are the minimum, red is a wider sope.

 ![Mizs_0-1680025590383.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/a9634850c889b48a97c6c5ee6be7597c410eb9aa.png)

Some documentaiton about the required token roles:

[Deploy your first configuration | Dynatrace Docs](https://www.dynatrace.com/support/help/manage/configuration-as-code/manage-configuration)

[Configuration types and token permissions | Monaco (dynatrace.github.io)](https://dynatrace.github.io/dynatrace-configuration-as-code/configuration/configTypes_tokenPermissions/)

I hope it helps.

Best regards,

Mizső

---

<div class="post-metadata">

**Author:** ![Tanveer](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@Tanveer](https://community.dynatrace.com/u/Tanveer)\
**Post date:** [March 28, 2023, 9:32pm UTC](https://community.dynatrace.com/t/how-to-generate-environment-yaml-file-for-downloading-config-using-monaco/39054/4 "2023-03-28T21:32:59Z")

</div>

Many thanks Mizso, this is what I was looking for

---

<div class="post-metadata">

**Author:** ![Tanveer](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@Tanveer](https://community.dynatrace.com/u/Tanveer)\
**Post date:** [March 28, 2023, 10:03pm UTC](https://community.dynatrace.com/t/how-to-generate-environment-yaml-file-for-downloading-config-using-monaco/39054/5 "2023-03-28T22:03:45Z")

</div>

I have followed this [Install Dynatrace Configuration as Code via Monaco — Dynatrace Docs](https://www.dynatrace.com/support/help/manage/configuration-as-code/installation#tabgroup--configuration-as-code-os--windows)&nbsp;and getting below error while running monaco.exe

![Tanveer_0-1680041015523.png](https://global.discourse-cdn.com/dynatrace/original/2X/2/26cc53b4ba9ed45110108646595463f29ca71f96.png)

---

<div class="post-metadata">

**Author:** ![manisundaram](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@manisundaram](https://community.dynatrace.com/u/manisundaram)\
**Post date:** [March 29, 2023, 4:26am UTC](https://community.dynatrace.com/t/how-to-generate-environment-yaml-file-for-downloading-config-using-monaco/39054/6 "2023-03-29T04:26:27Z")

</div>

[@Tanveer](https://community.dynatrace.com/user/61266)&nbsp;I am not sure if you referred this documentation  
[https://dynatrace.github.io/dynatrace-configuration-as-code/commands/downloading-configuration](https://dynatrace.github.io/dynatrace-configuration-as-code/commands/downloading-configuration)

1. Enable CLI 2.0 by adding an environment variable called NEW\_CLI with a non-empty value other than 0.

export NEW\_CLI=1

I think this should solve your problem

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [March 29, 2023, 7:12am UTC](https://community.dynatrace.com/t/how-to-generate-environment-yaml-file-for-downloading-config-using-monaco/39054/7 "2023-03-29T07:12:48Z")

</div>

Hi,

Or “$env:NEW\_CLI=1” if you are in powershell / Windows.

Best regards

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [March 29, 2023, 11:16am UTC](https://community.dynatrace.com/t/how-to-generate-environment-yaml-file-for-downloading-config-using-monaco/39054/8 "2023-03-29T11:16:10Z")

</div>

Hi&nbsp;[@Tanveer](https://community.dynatrace.com/user/61266),

Instead v1 use the v2 and you do not need to deal with CLI configuration. (and v2 has an official support comapared v1).

Then you can run this command:

monaco download manifest manifest.yaml your\_environment

I hope it helps.

Best regards,

Mizső
