Azure App Service (Web Apps) Public Certificate
This page shows how to write Terraform and Azure Resource Manager for App Service (Web Apps) Public Certificate and write them securely.
azurerm_app_service_public_certificate (Terraform)
The Public Certificate in App Service (Web Apps) can be configured in Terraform with the resource name azurerm_app_service_public_certificate
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
The following arguments are supported:
app_service_name
- (Required) The name of the App Service. Changing this forces a new App Service Public Certificate to be created.resource_group_name
- (Required) The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.certificate_name
- (Required) The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.certificate_location
- (Required) The location of the certificate. Possible values areCurrentUserMy
,LocalMachineMy
andUnknown
.blob
- (Required) The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the App Service Public Certificate.thumbprint
- The thumbprint of the public certificate.
Explanation in Terraform Registry
Manages an App Service Public Certificate.
Tips: Best Practices for The Other Azure App Service (Web Apps) Resources
In addition to the azurerm_app_service, Azure App Service (Web Apps) has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
azurerm_app_service
Ensure your App Service is accessible via HTTPS only
It is better to configure the App Service to be accessible via HTTPS only. By default, both HTTP and HTTPS are available.
azurerm_function_app
Ensure to enable authentication to prevent anonymous request being accepted
It is better to enable authentication to prevent anonymous requests and ensure all communications in the application are authenticated.
Microsoft.Web/sites/publicCertificates (Azure Resource Manager)
The sites/publicCertificates in Microsoft.Web can be configured in Azure Resource Manager with the resource name Microsoft.Web/sites/publicCertificates
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
"type": "Microsoft.Web/sites/publicCertificates"
},
{
"name": "[concat(variables('interactiveMtlsAppServiceName'), '/', variables('sithsRootCertificateName'))]",
"apiVersion": "[variables('apiVersion')]",
"dependsOn": [
"type": "Microsoft.Web/sites/publicCertificates",
"apiVersion": "2018-11-01",
"kind": "string",
"properties": {
"blob": [
"integer"
"type": "Microsoft.Web/sites/publicCertificates",
"location": "[resourceGroup().location]",
"properties": {
"publicCertificateLocation": "[parameters('publicCertificateLocation')]",
"blob": "[parameters('blob')]"
}
"type": "Microsoft.Web/sites/publicCertificates",
"location": "[resourceGroup().location]",
"properties": {
"publicCertificateLocation": "[parameters('publicCertificateLocation')]",
"blob": "[parameters('blob')]"
}
"type": "Microsoft.Web/sites/publicCertificates",
"location": "[resourceGroup().location]",
"properties": {
"publicCertificateLocation": "[parameters('publicCertificateLocation')]",
"blob": "[parameters('blob')]"
}
"type": "Microsoft.Web/sites/publicCertificates",
"location": "[resourceGroup().location]",
"properties": {
"publicCertificateLocation": "[parameters('publicCertificateLocation')]",
"blob": "[parameters('blob')]"
}
"type": "Microsoft.Web/sites/publicCertificates",
"location": "[resourceGroup().location]",
"properties": {
"publicCertificateLocation": "[parameters('publicCertificateLocation')]",
"blob": "[parameters('blob')]"
}
"type": "Microsoft.Web/sites/publicCertificates",
"location": "[resourceGroup().location]",
"properties": {
"publicCertificateLocation": "[parameters('publicCertificateLocation')]",
"blob": "[parameters('blob')]"
}
"type": "Microsoft.Web/sites/publicCertificates",
"location": "[resourceGroup().location]",
"properties": {
"publicCertificateLocation": "[parameters('publicCertificateLocation')]",
"blob": "[parameters('blob')]"
}
"type": "Microsoft.Web/sites/publicCertificates",
"location": "[resourceGroup().location]",
"properties": {
"publicCertificateLocation": "[parameters('publicCertificateLocation')]",
"blob": "[parameters('blob')]"
}
Parameters
apiVersion
required - stringkind
optional - stringKind of resource.
name
required - stringPublic certificate name.
properties
requiredblob
optional - stringPublic Certificate byte array
publicCertificateLocation
optional - stringPublic Certificate Location.
type
required - string