# Monaco error regarding env-token-name

**URL:** <https://community.dynatrace.com/t/monaco-error-regarding-env-token-name/37074>\
**Category:** Open Q&A\
**Tags:** dynatrace-saas, monaco\
**Created:** [October 30, 2022, 7:41am UTC](https://community.dynatrace.com/t/monaco-error-regarding-env-token-name/37074 "2022-10-30T07:41:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sahil2308](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sahil2308](https://community.dynatrace.com/u/Sahil2308)\
**Post date:** [October 30, 2022, 7:41am UTC](https://community.dynatrace.com/t/monaco-error-regarding-env-token-name/37074/1 "2022-10-30T07:41:12Z")

</div>

Output from cmd : “monaco --environments=environments.yaml -p=auto-tagging”

2022-10-30 12:55:32 INFO Dynatrace Monitoring as Code v1.8.5  
2022-10-30 12:55:32 INFO Executing projects in this order:  
2022-10-30 12:55:32 INFO 1: auto-tagging (0 configs)  
2022-10-30 12:55:32 INFO Processing environment test1…  
2022-10-30 12:55:32 INFO Deployment summary:  
2022-10-30 12:55:32 ERROR Deployment to test1 failed with error!  
2022-10-30 12:55:32 ERROR environment variable Monaco\_Test not found  
2022-10-30 12:55:32 ERROR errors during deployment! Check log

This is my environments.yaml file:

test1:- name: “test1”- env-url: “https://\*\*\*\*\*\*\*.live.dynatrace.com”- env-token-name: “Monaco\_Test”

Can anyone please guide me how to set the token in environments.yaml file, am I doing it correctly? I have created the token in Saas with required permissions.

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [October 30, 2022, 9:21am UTC](https://community.dynatrace.com/t/monaco-error-regarding-env-token-name/37074/2 "2022-10-30T09:21:14Z")

</div>

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

You need to add the token to your system as environment variable as explained in the [documentation](https://dynatrace-oss.github.io/dynatrace-monitoring-as-code/commands/deploying-projects#running-the-tool)

![Yosi_Neuman_1-1667121641054.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/8c11664d7e3d65bbecb3ba5bbe2146ac824e7800.png)

HTH

Yos

---

<div class="post-metadata">

**Author:** ![Sahil2308](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sahil2308](https://community.dynatrace.com/u/Sahil2308)\
**Post date:** [October 30, 2022, 9:40am UTC](https://community.dynatrace.com/t/monaco-error-regarding-env-token-name/37074/3 "2022-10-30T09:40:10Z")

</div>

Hi [@Yosi\_Neuman](https://community.dynatrace.com/user/6931)&nbsp;,

Yes I did mention the API token name in environments.yaml file.

This is my environments.yaml file:

test1:-&nbsp;name:&nbsp;“test1”-&nbsp;env-url:&nbsp;“https://\*\*\*\*\*\*\*.live.dynatrace.com”-&nbsp;env-token-name:&nbsp;“Monaco\_Test”

Here “Monaco\_Test” is my API token name created in Dynatrace

Do I need to specify the value itself somewhere in yaml?

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [October 30, 2022, 10:55am UTC](https://community.dynatrace.com/t/monaco-error-regarding-env-token-name/37074/4 "2022-10-30T10:55:37Z")

</div>

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

You need to add the token name and value in your system environment variable settings

![Yosi_Neuman_1-1667127313084.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/2/62f6757e02d676e034493ecbe2a6983a13e7c11b.png)

 ![Yosi_Neuman_0-1667127250754.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/6/56b63fd73f184b04b7af44d5aeb302cd25ee9f42.png)

HTH

Yos

---

<div class="post-metadata">

**Author:** ![Sahil2308](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sahil2308](https://community.dynatrace.com/u/Sahil2308)\
**Post date:** [October 30, 2022, 12:53pm UTC](https://community.dynatrace.com/t/monaco-error-regarding-env-token-name/37074/5 "2022-10-30T12:53:13Z")

</div>

Hi&nbsp;[@Yosi\_Neuman](https://community.dynatrace.com/user/6931)&nbsp;,

Thanks for the help, this indeed resolved my issue 🙂 . I am using Ubuntu so I hve set the env in /etc/environment file.

I have run the cmd: “monaco -e=environments.yaml -p=auto-tag1”

o/p:

You are currently using the old CLI structure which will be used by  
default until monaco version 2.0.0

Check out the beta of the new CLI by adding the environment variable  
“NEW\_CLI”.

We can’t wait for your feedback.

2022-10-30 18:17:14 INFO Dynatrace Monitoring as Code v1.8.5  
2022-10-30 18:17:15 INFO Executing projects in this order:  
2022-10-30 18:17:15 INFO 1: auto-tag1 (0 configs)  
2022-10-30 18:17:15 INFO Processing environment test1…  
2022-10-30 18:17:15 INFO Processing project auto-tag1…  
2022-10-30 18:17:15 INFO Deployment summary:  
2022-10-30 18:17:15 INFO Deployment finished without errors  
2022-10-30 18:17:15 INFO There is no delete file delete.yaml found in delete.yaml. Skipping delete config.

But I cannot see the changes(creation of auto-tagging rule) in Tenant.

This is my file dir:

root@sahil-VirtualBox:/opt/monacoDir1# tree .  
.  
├── auto-tag1  
│&nbsp;&nbsp; ├── auto-tag.yaml  
│&nbsp;&nbsp; └── Host-Group-Name.json  
├── environments.yaml  
├── monaco  
└── README.md

**contents of auto-tag.yaml file:**

config:- Host-Group-Name: “Host-Group-Name.json”  
Host-Group-Name:- name: "Resistance is futile!" **contents of Host-Group-Name.json file:** {  
“name”: “{{ .name }}”,  
“rules”: [  
{  
“type”: “HOST”,  
“enabled”: true,  
“valueFormat”: “MonacoTest”,  
“propagationTypes”: [],  
“conditions”: [  
{  
“key”: {  
“attribute”: “HOST\_DETECTED\_NAME”  
},  
“comparisonInfo”: {  
“type”: “STRING”,  
“operator”: “EQUALS”,  
“value”: “AZSG-D-DTS3W”,  
“negate”: false,  
“caseSensitive”: true  
}  
}  
]  
}  
]  
}Everything seems alright&nbsp;:thinking:.

---

<div class="post-metadata">

**Author:** ![Sahil2308](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sahil2308](https://community.dynatrace.com/u/Sahil2308)\
**Post date:** [November 1, 2022, 5:59am UTC](https://community.dynatrace.com/t/monaco-error-regarding-env-token-name/37074/6 "2022-11-01T05:59:26Z")

</div>

Hey, thanks for the help, got the issue resolved.&nbsp;:blush:
