Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Local Folder Path in ax 365

Posted on by 230

Hi All,

In 2012 we could use local folder path in our code for specifying any file. As we are upgrading to ax 365 how do we handle the file folder path. I read that the local file folder is being deprecated. Please revert with any suggestions.

Thanks

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: Local Folder Path in ax 365

    I'm still not sure if you understand. AX uses the storage for files, so you can store your certificate there.

    Regarding your error, it says that the path you provided is in an invalid format, therefore you should review it. I can't help you with it because you didn't share it with us. I hope you're not using a local path on your PC in X++ - we discussed before why it can't work.

  • Krishnendu Profile Picture
    Krishnendu 230 on at
    RE: Local Folder Path in ax 365

    Ok so we wont have access to that storage account which is owned by Microsoft to store our files.....

    to check the feasibility I uploaded a file in azure storage and tried to acess the url in my code,

    My AX code passes the certificate path password and service url to the .net code.

    which throws an error the given path format is not supported.

    I don't want to use azure certificate store (which is again paid) until there is no other workaround.

    public ExchangeRateWSClient(string certificateFilePath, string certificateFilePassword, string serviceUrl)

           {

               try

               {

                   currencyPairList = new List<string>();

                   clientCert = new X509Certificate2(certificateFilePath, certificateFilePassword);

                   serviceEndpointAddress = serviceUrl;

                   pollInterval = 5000;

               }

               catch (Exception e)

               {

                   throw new Exception(string.Format(e.Message));

               }

           }

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: Local Folder Path in ax 365

    Yes, every production environment has its own internal storage, which can be used for storing files attached to records, for example.

    But it doesn't mean that you get a storage with which you can do anything you like.

    Pricing applies if you use your own Azure subscription. I'm talking about the subscription owned by Microsoft, where they deploy your production environment.

  • Krishnendu Profile Picture
    Krishnendu 230 on at
    RE: Local Folder Path in ax 365

    Hi martin

    You mean to say out of box one default azure storage accounts comes with every production environment? because I don't want to suggest a solution which includes pricing for the customer only for using a single certificate

    I could see azure.microsoft.com/.../files where the prices are mentioned.

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: Local Folder Path in ax 365

    You could use your own storage (which you would pay for), but why, if you your production environment already comes with a bloc storage for storing files? That's where files are stored if you configure document management to use Azure storage. You can use it from your code too, if you want.

  • Krishnendu Profile Picture
    Krishnendu 230 on at
    RE: Local Folder Path in ax 365

    Hi martin

    My certificate file is static, can I use azure storage like Files and use the file url in my code,  is there any pricing factor which comes if we use azure storage account

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: Local Folder Path in ax 365

    What was bad design even in AX 2012, because it wasn't prepared for a clustered AOS. And it's impossible in AX 7, because you don't have access to production servers.

    Storing files in database used to be very common (think about product images, for example), although Microsoft now tries to put files to a separate storage rather than to the database (the database has a limited size).

    To upload a file, you can use File::GetFileFromUser(). It returns FileUploadResultBase, which will give you the data as a stream. If you want to store it as a container, use the Binary class (constructFromMemoryStream() and getContainer()).

  • Krishnendu Profile Picture
    Krishnendu 230 on at
    RE: Local Folder Path in ax 365

    Ok... fyi In 2012 it was stored in the machine where the AOS server was installed.

    could you please elaborate on how to store the certificate in database..as in any table ?

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: Local Folder Path in ax 365

    The discussion wasn't about changing or deleting either.

    Okay, you have a local path in a table, but which computer does it refer to? One of several servers running the AOS? Your computer (so it's invalid for any other user)? Some server in your network unknown and not accessible to the web application in Azure?

    In either case, it won't work. You must address the problem differently. Why don't you simply store the certificate in the database or in the blob storage?

  • Krishnendu Profile Picture
    Krishnendu 230 on at
    RE: Local Folder Path in ax 365

    I martin thanks for the prompt response,

    In my scenario the File is not being changed or deleted I am trying to acess a certificate file path that I am storing in system parameters table for exchange rates import.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans