# Token resource value not being synced to current value when using variable

**URL:** <https://community.postman.com/t/token-resource-value-not-being-synced-to-current-value-when-using-variable/7464>\
**Category:** Help Hub\
**Tags:** variables, collections\
**Created:** [August 27, 2019, 8:57pm UTC](https://community.postman.com/t/token-resource-value-not-being-synced-to-current-value-when-using-variable/7464 "2019-08-27T20:57:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phydeauxman](https://avatars.discourse-cdn.com/v4/letter/p/7993a0/32.png) [@phydeauxman](https://community.postman.com/u/phydeauxman)\
**Post date:** [August 27, 2019, 8:57pm UTC](https://community.postman.com/t/token-resource-value-not-being-synced-to-current-value-when-using-variable/7464/1 "2019-08-27T20:57:33Z")

</div>

I have a POST to get Bearer token for Azure Commercial Resource Manager. I am trying to use variables as much as possible so that I can use the query across subscriptions, tenants, and environments. When I use a variable for the “resource” key, I get a Bearer token but the value for resource returned to me is a string of numbers instead of the value that I passed it. If I take the value I am storing inside the “INITIAL” field for the variable and hard code that into the resource key value, everything works as expected.

**To Reproduce**  
Steps to reproduce the behavior:

1. Create POST to https://{{aad\_endpoint}}/{{tenant\_Id}}/oauth2/token’ with the following keys:

- grant\_type : client\_credentials
- client\_id : {{sp\_client\_Id}}
- client\_secret : {{sp\_client\_Key}}
- resource : {{arm\_Resource\_Url}}

1. Create the following variables:

- aad\_endpoint : [login.microsoftonline.com](http://login.microsoftonline.com)
- tenant\_Id : \<Azure\_Tenant\_ID\>
- sp\_client\_Id : \<Azure\_application\_ID\>
- sp\_client\_Key : \<Key\_for\_application\>
- arm\_Resource\_Url : [https://management.core.windows.net/](https://management.core.windows.net/)

1. Execute POST  
 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/d/d010ff5c28b777664a17807136cf46e8f2ea91a5.png)

2. Replace resource key value with hard coded value and re-send POST  

3. Token returned is correct but value not written to CURRENT:  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/3/7/37b256f17a7a7751e26107c77a449097d555a7a4.png)

**Expected behavior**  
Expect resource value returned with token to reflect the resource that the token is for
