1. Gururaja Udupa
  2. PowerServer
  3. Friday, 5 April 2024 11:36 AM UTC

In PowerServer, the Application.JSON file contains values such as the application name and the DB connection password. We need to use these values from the environment variables within the container. Are there any techniques available to accomplish this?

Thanks,
Gururaja Udupa

 

Gururaja Udupa Accepted Answer Pending Moderation
  1. Thursday, 18 April 2024 06:45 AM UTC
  2. PowerServer
  3. # 1

Thanks, Logan, for your KB article. 

 

We tried to incorporate the code changes mentioned in the link. While compiling we are getting some errors. looks like some parts of the code were removed while displaying as HTML (ex. < > symbols are considered as a HTML tag)

code example:

"public async override Task> GetConnectionsAsync("

 

Could you please attach a both the classes code as a text file, so that we can include in our project and test once.

 

Thanks,

Gururaja Udupa

 
Comment
  1. Logan Liu @Appeon
  2. Thursday, 18 April 2024 07:09 AM UTC
Sorry. We have fixed < > symbols issues there. Please refresh this page.

Regards, Logan

  1. Helpful
  1. Gururaja Udupa
  2. Friday, 19 April 2024 12:10 PM UTC
Thanks, Logan for the quick response.



We included these code changes in our code base and testing unit testing is in progress. Once it is completed, I will update you on the status.



Thanks

Gururaja Udupa
  1. Helpful
There are no comments made yet.
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 17 April 2024 09:40 AM UTC
  2. PowerServer
  3. # 2

Hi Gururaja,

I have created a KB on how to change the database password while Web API is already running, please refer to:

How to change database password in the cache dynamically when Web API is running | Appeon

Regards, Logan

Comment
There are no comments made yet.
Gururaja Udupa Accepted Answer Pending Moderation
  1. Monday, 15 April 2024 14:37 PM UTC
  2. PowerServer
  3. # 3

 

Thanks, Mike, for the response. 

We've set up a config map in Azure for Application.Json with the aim that any changes to the DB password can automatically reflect in the application without needing a container restart. While the changes to the DB password in the config map successfully updated the Application.Json file, they didn't reflect in the PowerServer.

Any suggestion on how we can reload the configuration?

Thanks,

Gururaja Udupa

 

 

Comment
  1. mike S
  2. Monday, 15 April 2024 17:52 PM UTC
you need to either restart the container, or change the C# application to read the password every single time it connects, which will slow things down a bit.



a better option if you change your passwords a lot, is to setup both the user name and password in env variables and change both of them. that way you can setup an overlap so they are both good for a period of time. If you setup your container app to auto shut down when not in use then it probably will get the new username/password on a nightly basis.







  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Friday, 5 April 2024 12:11 PM UTC
  2. PowerServer
  3. # 4

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.