web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Unable to access envir...
Copilot Studio
Suggested Answer

Unable to access environment variables in an agent

(1) ShareShare
ReportReport
Posted on by 16
Hi,
 
I have created a string environment variable to store a storage account name in my solution in Power Apps. I have an agent in the same solution where I want to access the environment variable. But I do not see the variable under the Environment or System variables section. I have tried to remove and readd the variable to the solution and try this in incognito browser. 
 
What am I missing?
 
Thanks,
Nihar Dalai.
Categories:
I have the same question (0)
  • Prasad-MSFT Profile Picture
    Microsoft Employee on at
    Why You Don’t See the Environment Variable
    • Environment variables created in Power Apps solutions are not always immediately available to Copilot Studio agents or flows.
    • Sometimes, there is a delay in propagation, or the variable is not surfaced in the Copilot Studio UI.
    • Only environment variables of type “Environment variable (string)” and set to “Current Value” are accessible at runtime.
    • If the variable is not referenced in a flow or app, it may not appear in the variable picker.
    What to Do
    Check Variable Type and Value
    • Ensure the variable is of type “Environment variable (string).”
    • Set a “Current Value” (not just a default value).
    Publish All Customizations
    • In Power Apps, go to your solution and “Publish all customizations.”
    Refresh Copilot Studio
    • Wait a few minutes, then refresh Copilot Studio (or try a new browser/incognito window).
    Reference in a Flow
    • If you still don’t see it, try referencing the environment variable in a Power Automate flow in the same solution. Sometimes this “activates” the variable for other components.
    Check Permissions
    • Make sure you have the right permissions in the environment.
  • Suggested answer
    Valantis Profile Picture
    6,735 on at
     
    Environment variables in Copilot Studio don't appear automatically in the Environment/System variables section until you reference them inside a topic. That's likely why you don't see it.
     
    Here's how to access it:
    1. Open a topic in your agent
    2. Add a Set variable value node or any node that uses variables
    3. Open the variable picker and look for the Environment section  your variable should appear there
    4. Once referenced in a topic, it shows up in the Variables panel on the right side
     
    A few things from Microsoft docs to check:
     
    Environment variables are read-only in Copilot Studio you can read them but not modify them from within the agent. Make sure you have a Current Value set on the variable in Power Apps (not just a Default Value). Default Value alone is not always used at runtime.
     
    Also confirm the environment variable is in the same solution as your agent. If it's in a different solution, it may appear in the picker but won't reliably deploy to target environments.
     
    After making any changes to the environment variable value, you need to republish the agent for the new value to take effect at runtime.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

     
  • ND-20051403-0 Profile Picture
    16 on at
    Thank you both for your response. I have tried all the below and still no luck.
     
    1. I have confirmed it is a text environment variable with both a default value and a current value.
    2. It is in the same environment and solution as my agent.
    3. I have published all customizations after creating the variable.
    4. Waited a few mins and tried to access environment variables in an incognito browser.
    5. Tried accessing it in the Greeting topic of the agent as below. Dont see it.
     
     
    6. I can see the environment variable as a parameter in a flow. Tried using it there. Came back to the topic and still dont see it.
     
    Any thoughts what might still be missing?
     
    Thanks,
    Nihar Dalai.
  • Prasad-MSFT Profile Picture
    Microsoft Employee on at
    Hi 

    Thanks for confirming all the checks. Since the environment variable is visible in Power Automate but not in Copilot Studio, this may be a Copilot Studio sync/propagation issue rather than a configuration problem.

    You can try:

    • Creating a new text environment variable and checking if that appears
    • Testing with a new agent in the same solution/environment
    • Republishing the agent after re-adding the variable

    If the issue still persists, it is likely a product limitation/UI issue in Copilot Studio, especially since the variable is already accessible in flows.

  • ND-20051403-0 Profile Picture
    16 on at
    Thanks for your response Prasad. I have tried all the steps you mentioned and still no luck.
     
    It looks like a big limitation. We are trying to deploy to Prod and I cannot use my blob storage connectors as tools in my agent because the blob storage account differs per environment. I am pretty sure there must be others using Copilot Studio facing similar issues. 
     
    Would you know if this is something on the cards for the Copilot Studio Dev Team?
     
    Regards,
    Nihar Dalai.
  • Prasad-MSFT Profile Picture
    Microsoft Employee on at
    Hi  We have highlighted this concern to the Copilot Engineering team and have raised a bug for further investigation. Once we receive any updates, we will keep you informed. Thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 277

#2
11manish Profile Picture

11manish 206

#3
sannavajjala87 Profile Picture

sannavajjala87 156 Super User 2026 Season 1

Last 30 days Overall leaderboard