Zum Hauptinhalt gehen

Can server workflows access app settings or environment variables on the server they run from?

Kommentare

7 Kommentare

  • Ken Lyon

    Hi Austin, thanks for your question.

     

    Workflow Server is written in .NET Core, so it doesn't have the direct access to things like appSettings in web.config that you might be thinking of. However, we achieve a similar thing using a number of json files.

     

    For example, you can store database connection strings in a json file, as described here.

     

    Did you want to add extra settings for your own custom activity?

    0
  • Permanently deleted user

    I am trying to pull my authorization token from the web config. I will look into the JSON option but it looks like that is mainly for database connection strings.

    0
  • Permanently deleted user

    The authorization token could then be used in a web request header.

    0
  • Ken Lyon

    The json file can contain any values, although our documentation focuses on database connection strings as that's the most common case for users to need to edit the file.

     

    I wonder if there might be another way to deal with authorization tokens instead of storing them in a file, though. What service is the token used for?

    0
  • Permanently deleted user

    We have an internal service that does, among other things, generates an e-mail with parameters supplied by the workflow. There is some other things it does in the background to control who the e-mail is sent to. It worked great in the old workflow.

    0
  • Permanently deleted user

    Hi Austin,

     

    I think the Read File activity could probably get the job done. That should be able to read a config or json file from the workflow server as text, and then we can try to parse values out of it. Parsing values will be a lot easier if you use json. For example, if you save this content to a new file at C:\ProgramData\Geocortex\Workflow\configsettings.json:

    { "MyAppToken": "abcdef", "SomeOtherValue": "ghijkl" }

     

    Then you can run a Parse JSON activity, and pass in the value from Read File as an input (eg =$readFile1.text). From the Parse JSON result, you can get your values using the format =$parseJson1.result.MyAppToken

     

    There aren't any workflow activities yet for parsing xml yet, so getting values out of a web.config this way would be trickier/uglier. You could probably use String.split or some other method like that to isolate the necessary value.

    0
  • Robert Pincus

    I am trying to do the same thing, but I am getting a " Cross-Origin Request Blocked" error. I setup up security in our organizational AGO to allow origins. But it still fails. Any thoughts?

     

    Robert

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.