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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Azure blob storage code not working in test environment

(0) ShareShare
ReportReport
Posted on by 1,552
Hi,
I've made some code in my dev environment to export an entity then send the file to azure and it's working very well.
The code is deployed to a test environment. And the azure part is not working anymore.
i've used the same storage key and storage account that i used in dev and i'm wondering why it's not working. 
I'm pretty sure it fails at this line of code (i can't debug in Test environment right now)
  Microsoft.WindowsAzure.Storage.Auth.StorageCredentials  storageCredentials  = new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials('StorageAccountName', 'StorageKey');

i tried to put a wrong storage key in dev machine and it failed at this line of code
but i couldn't catch the error.

1. Why it's not working in my test environment even though it's working in dev? 

2. how can i catch such error at this line? if there was an error. so currently when i put a wrong storage key it reaches the line that i mentioned above and then exits the code. I tried to put try and catch but couldn't know how to get the error message. Any idea how can i catch it? 
I have the same question (0)
  • Martin Dráb Profile Picture
    237,985 Most Valuable Professional on at

    How did you determine that it failed at this line?

    Didn't you get an exception? If so, what is its type and what is the error message?

    What do you mean by "couldn't catch the error"? Maybe you're trying to catch Exception::Error instead of Exception::CLRError (or System.Exception).

  • junior AX Profile Picture
    1,552 on at

    Hi Martin,

    I'm 90% sure it fails there.. and i know that because i traced code and i think it fails there.

    It seems i didn't catch system.Exception in my code that's why i can't see why it fails.

    so i need to add it and release code to test environment again

    If i export UAT DB to my dev machine... willl i be able to debug the error?

    or i need to connect my DEV environment to the test database in order to know?

  • Suggested answer
    Martin Dráb Profile Picture
    237,985 Most Valuable Professional on at

    Both approaches should work, if the difference in behavior is caused by a difference in data (and not the configuration of the environment, for example).

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans