none
how to create a secret in Docker Secret and access it in C# console application? RRS feed

  • Question

  • As I have to store a key in docker and access it in c# console application.

    I have tried with Azure cloud, I am searching for another approach.

    Please help me out as soon as possible.

    Wednesday, March 18, 2020 11:20 AM

All replies

  • I have seen docker being mentioned and used in ASP.NET forums. Maybe, you should try posting there.

    http://forums.asp.net/

    Wednesday, March 18, 2020 1:21 PM
  • I would set it in docker-compose.yml so the code can read it from corresponding call to Environment.GetEnvironmentVariable() .

    It's convenient to test in command line directly too, just use "SET" command in command prompt to set that key.

    Thursday, March 19, 2020 3:05 AM
  • Hi Nikita,

    Thank you for posting here.

    You can try this nuget package: microsoft/Docker.DotNet.

    But I don't have Docker, so I haven't tested it.

    If it doesn't meet your needs, you can ask questions about Docker under the docker tag of stackoverflow or the Docker Community Forums, and they should be able to provide you with more professional solutions.

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 19, 2020 3:30 AM
  • Can you provide me full solution, how to invoke the docker key in c# console application.

    Friday, March 20, 2020 7:35 AM
  • Hi Nikita,

    I'm sorry I'm not familiar with Docker. I think questions about Docker should be easier to answer in Docker related forums.

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 20, 2020 9:35 AM