Deploy ASP.Net COre app on docker container over HTTPS

Harshanand Wankhede 11 Reputation points
2022-08-23T19:02:14.983+00:00

Hi,

We are trying to deploy ASP.Net core web app on docker container which is configured to listen on port 443 over HTTPS. It is giving "No Certificate found" error but we have certificate on Azure Key vault. Can someone know how to use SSL certificate from Azure Key Vault with ASP.Net core app .

Thanks in Advance.

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,115 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,370 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,158 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,875 questions
{count} vote

3 answers

Sort by: Most helpful
  1. Shweta Mathur 27,381 Reputation points Microsoft Employee
    2022-08-25T09:11:17.537+00:00

    Hi @Harshanand Wankhede ,

    Thanks for reaching out.

    I understand you are getting error while deploying the ASP.Net core applications with Docker over HTTPS

    Docker needs a certificate to process HTTPS requests.
    Below are the steps you required to deploy the ASP.net core with docker are:

    1. Create the certificate. Make sure to set the password to use the certificate with docker.
    2. Provide the certificate to the docker image.

    Reference sample: https://github.com/dotnet/dotnet-docker/blob/main/samples/run-aspnetcore-https-development.md
    https://learn.microsoft.com/en-us/aspnet/core/security/docker-compose-https?view=aspnetcore-6.0

    Hope this will help.

    Thanks,
    Shweta

    -----------------------------

    Please remember to "Accept Answer" if answer helped you.

    0 comments No comments

  2. Yogi 346 Reputation points
    2022-09-04T11:08:32.043+00:00

    You have to use volumes in docker-compose.yml to point out the location of ssl certificate. This tutorial will help you - Deploy a Docker based ASP.NET Core app to Azure

    0 comments No comments

  3. Bruce (SqlWork.com) 55,686 Reputation points
    2022-09-04T15:07:20.017+00:00

    While you can store a ssl certificate in azure key value, docker does not directly support this. You need to export the certificate to the proper location for docker.

    0 comments No comments