All Projects → n3wt0n → AzureWebAppSSLManager

n3wt0n / AzureWebAppSSLManager

Licence: MIT license
Acquires and manages free SSL certificates for Azure Web App and Azure Functions applications.

Programming Languages

C#
18002 projects
Batchfile
5799 projects
shell
77523 projects

Projects that are alternatives of or similar to AzureWebAppSSLManager

Acme Client
Let's Encrypt / ACME client written in PHP for the CLI.
Stars: ✭ 337 (+381.43%)
Mutual labels:  letsencrypt, ssl, certificates, acme
Certify
SSL Certificate Manager UI for Windows, powered by Let's Encrypt. Download from certifytheweb.com
Stars: ✭ 1,075 (+1435.71%)
Mutual labels:  letsencrypt, ssl, certificates, acme
Certificaat
General-purpose ACME client
Stars: ✭ 88 (+25.71%)
Mutual labels:  letsencrypt, ssl, certificates, acme
Win Acme
A simple ACME client for Windows (for use with Let's Encrypt et al.)
Stars: ✭ 4,305 (+6050%)
Mutual labels:  letsencrypt, certificates, acme
acme-companion
Automated ACME SSL certificate generation for nginx-proxy
Stars: ✭ 6,434 (+9091.43%)
Mutual labels:  letsencrypt, ssl, acme
Openshift Acme
ACME Controller for OpenShift and Kubernetes Cluster. (Supports e.g. Let's Encrypt)
Stars: ✭ 287 (+310%)
Mutual labels:  letsencrypt, certificates, acme
docker-nginx-certbot
Automatically create and renew website certificates for free using the Let's Encrypt certificate authority.
Stars: ✭ 367 (+424.29%)
Mutual labels:  letsencrypt, ssl, acme
Acmetool
🔒 acmetool, an automatic certificate acquisition tool for ACME (Let's Encrypt)
Stars: ✭ 1,882 (+2588.57%)
Mutual labels:  letsencrypt, ssl, acme
Ssl Proxy
🔒 Simple zero-config SSL reverse proxy with real autogenerated certificates (LetsEncrypt, self-signed, provided)
Stars: ✭ 427 (+510%)
Mutual labels:  letsencrypt, ssl, certificates
Greenlock
Automatic SSL renewal for NodeJS
Stars: ✭ 30 (-57.14%)
Mutual labels:  letsencrypt, ssl, acme
Letscertbot
Let's Certbot is a tool builds automated scripts base on Certbot for obtaining, renewing, deploying SSL certificates.
Stars: ✭ 84 (+20%)
Mutual labels:  letsencrypt, certificates, acme
ACMECert
PHP client library for Let's Encrypt (ACME v2 - RFC 8555)
Stars: ✭ 83 (+18.57%)
Mutual labels:  letsencrypt, ssl, acme
acm
Automatic wildcard certificate management for Cloudflare and Heroku
Stars: ✭ 40 (-42.86%)
Mutual labels:  letsencrypt, ssl, certificates
Acme client
Java ACME Client application
Stars: ✭ 77 (+10%)
Mutual labels:  letsencrypt, ssl, acme
Manuale
A fully manual Let's Encrypt/ACME client
Stars: ✭ 201 (+187.14%)
Mutual labels:  letsencrypt, ssl, acme
freshcerts
ACME certificate protocol (Let's Encrypt) proxy client with a dashboard and monitoring
Stars: ✭ 59 (-15.71%)
Mutual labels:  letsencrypt, ssl, acme
Docker Letsencrypt Nginx Proxy Companion
Automated ACME SSL certificate generation for nginx-proxy
Stars: ✭ 6,350 (+8971.43%)
Mutual labels:  letsencrypt, ssl, acme
httpsbook
《深入浅出HTTPS:从原理到实战》代码示例、勘误、反馈、讨论
Stars: ✭ 77 (+10%)
Mutual labels:  letsencrypt, ssl, certificates
Terraform Provider Acme Old
ACME (Let's Encrypt) Support for Terraform
Stars: ✭ 211 (+201.43%)
Mutual labels:  letsencrypt, ssl, acme
qiniu-auto-cert
七牛 CDN 证书自动化工具
Stars: ✭ 20 (-71.43%)
Mutual labels:  letsencrypt, ssl, acme

Logo

CI Badge License

Azure WebApp SSL Manager is an Azure Function that acquires and manages free SSL certificates for Azure Web App and Azure Function App hosted applications.

Deploy to Azure Visualize

Pre-Deployment
Before deploying this solution to Azure, you need to create a Service Principal (see below).
Unfortunately due to Azure ARM templates limitation it is not possible for me to include this step in the deployment.

Also, be sure to create your SendGrid API Key (see below).

Post-Deployment
After deploying the solution to Azure, make sure to set up the required configuration.
See the Application Properties Configuration File section below for more information

Overview

Azure WebApp SSL Manager is an Azure Function that acquires and manages free SSL certificates for applications hosted on Azure Web Apps and Azure Function Apps

Main Tasks performed:

  • Order/Renewal of SSL certificates from Let's Encrypt free trusted CA
  • Validation of the order using Azure DNS TXT record
  • Download of the certificates and save them on Azure Blob Storage
  • Installation of the certificates on Azure App Service Web App or Function App
  • Association of the certificates to the Web App or Function App hostname bindings

Supported Azure Resources

Currently this solutions supports:

  • Azure Web Apps
  • Azure Web Apps Slots
  • Azure Function Apps
  • Azure Function Apps Slots

Dependencies

This project depends on few other project:

  • Certes for the interface with Let's Encrypt services via ACME
  • SendGrid for the email processing

Prerequisites

In order to successfully use this application, you need a number of Prerequisites.

  • Either:
    • At least one Azure Web App, with at least one custom domain assigned, running in Basic, Standard or Premium tier, OR
    • At least one Azure Function App, with at least one custom domain assigned, running in Consumption tier or in an App Service Basic, Standard or Premium tier
  • A Blob storage account to save the App Properties configuration (see below) and to save the certificates
  • The DNS for the custom domain must be managed via an Azure DNS Zone (in the same subscription of the resources)
  • A Service Principal and it's config values
  • A SendGrid account and a valid SendGrid API Key

Remember to bind all the hostnames you want to add certificates to to the App Service in advance.

Service Principal

You need to have a Service Principal to be able to perform management operations on Azure, like uploading the certificate to the App Service or managing the DNS Zone.

If you don't have a Service Principal, you can create one with the following command via Azure CLI. You can execute the command from any PC with the Azure CLI installed or from the Azure Shell

az ad sp create-for-rbac

You need to have enough privileges in your Azure AAD to be able to successfully create a Service Principal.

Visit the Azure Docs page for more information about Azure Service Principals creation.

Once created, take note of the output values, especially the password because it won't be possible to retrieve it later. The output will look like this:

{
  "appId": "xx15d42-f9xx-45xx-xx9a-3dxxxxxxxxf2",
  "displayName": "azure-cli-xxx-08-xx-07-xx-37",
  "name": "http://azure-cli-xxxx-08-xx-07-xx-37",
  "password": "7xxxxxx-xxxe-4xxx-xxxf-exxxxxxxxxx4",
  "tenant": "9xxxxxx0-cxxx-xxx4-bxxx-cxxxxxxxxxx3"
}

If you experience any problem with Service Principal, take a look at this wiki page.

SendGrid key

AzureWebAppSSLManager sends emails using the Microsoft.Azure.WebJobs.Extensions.SendGrid extension, which needs a valid SendGrid API Key.

To obtain an API Key, you can follow the official SendGrid documentation

Configuration

To be able to run, AzureWebAppSSLManager needs the following configuration settings.

They can be created in the Azure Web App configuration section when deployed, or in the local.settings.json file when debugging.

    "CertificateOwnerEmail": "[email protected]",
    "CertificatePassword": "YOUR_PASSWORD",
    "SubscriptionID": "SUBSCRIPTION_ID",
    "ServicePrincipalClientID": "SERVICE_PRINCIPAL_APP_ID",
    "ServicePrincipalClientSecret": "SERVICE_PRINCIPAL_PASSWORD",
    "ServicePrincipalTenantID": "SERVICE_PRINCIPAL_TENANT",
    "AzureStorageAccountConnectionString": "AZURE_STORAGE_FULL_CONNECTION_STRING",
    "SendGridKey": "SENDGRID_KEY",
    "EmailSender": "[email protected]",
    "UseStaging": "[True|False]",
    "BatchSize": [<0 for no batching> | <int>],
    "DaysBeforeExpiryToRenew": 30,
    "WebAppSSLManager-Trigger": "0 0 0 1 * *"

The config settings for the Service Principal are the ones from the output of the Service Principal creation above.

BatchSize is optional and defaults to 0.

DaysBeforeExpiryToRenew is optional and defaults to 30 (renew certificates 30 days before they expire).

WebAppSSLManager-Trigger is the the trigger configuration (i.e how frequently the Function will run, default every 1st day of each month)

Application Properties Configuration File

Currently AzureWebAppSSLManager retrieves the list of certificates to generate and install from a json file stored in a blob storage account.

An example of the file structure can be found in the appproperties.json example file.

The file needs to be saved in a blob container with name as in the constant "AppPropertiesFileName" of the Constants.cs class.

Certificate Information Configuration File

The app retrieves some information needed for the certificate creation from a json file stored in a blob storage account.

An example of the file structure can be found in the certinfo.json example file.

The file needs to be saved in a blob container with name as in the constant "CertInfoFileName" of the Constants.cs class.

Limitations

Currently an instance of AzureWebAppSSLManager can manage Web Apps and Function Apps in a single subscription. If you need/want to manage App Service Web Apps and Function Apps in multiple subscriptions, you would need to deploy one instance of this Function per subscription.

Support

If you have any issue with this project please let me know through the Issues page and I'll try to fix the problem as soon as possible!

If you want to contribute to this project, feel free to create a Pull Request and I will review it.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].