Azure CDN Profile

This page shows how to write Terraform and Azure Resource Manager for CDN Profile and write them securely.

azurerm_cdn_profile (Terraform)

The Profile in CDN can be configured in Terraform with the resource name azurerm_cdn_profile. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

cdn_endpoint_test.tf#L11
resource "azurerm_cdn_profile" "std_verizon" {
  name                = "example-cdn"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku                 = "Standard_Verizon"
}
main.tf#L49
resource "azurerm_cdn_profile" "static" {
  name                = "boundlexx-static-cdn"
  resource_group_name = azurerm_resource_group.rg.name
  location            = "Global"
  sku                 = "Standard_Microsoft"
}
cdn.tf#L1
resource "azurerm_cdn_profile" "DEV-CDN-BCP" {
  name                = "bcpdevprofile"
  location            = azurerm_resource_group.rgbcp.location
  resource_group_name = azurerm_resource_group.rgbcp.name
  sku                 = "Standard_Microsoft"
  tags = {
cdn.tf#L2
resource "azurerm_cdn_profile" "cdnprofile" {
  name                = var.cdn_profile_name
  resource_group_name = azurerm_resource_group.resource_group.name
  location            = azurerm_resource_group.resource_group.location
  sku                 = var.cdn_sku_profile
}
main.tf#L6
resource "azurerm_cdn_profile" "redirector_cdn_profile" {
  name                = "redirector-cdn-profile"
  location            = azurerm_resource_group.redirector_rg.location
  resource_group_name = azurerm_resource_group.redirector_rg.name
  sku                 = "Standard_Microsoft"
}
cdn.tf#L1
resource "azurerm_cdn_profile" "esgi" {
  name                = "esgi-cdn"
  location            = azurerm_resource_group.RG1.location
  resource_group_name = azurerm_resource_group.RG1.name
  sku                 = "Standard_Microsoft"
}
main.tf#L6
resource "azurerm_cdn_profile" "example" {
  name                = "example-cdn"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku                 = "Standard_Microsoft"
}
cdn.tf#L1
resource "azurerm_cdn_profile" "ockam_verizon_premium" {
  count               = var.cdn_count
  name                = "ockam-verizon-premium"
  location            = var.location
  resource_group_name = azurerm_resource_group.main.name
  sku                 = "Premium_Verizon"
main.tf#L12
resource "azurerm_cdn_profile" "cdng5" {
  name                = "cdng5"
  location            = azurerm_resource_group.rg.location
  resource_group_name = azurerm_resource_group.rg.name
  sku                 = "Standard_Verizon"
}
cdn_profile.tf#L1
resource "azurerm_cdn_profile" "jevason-cv-cdn-profile" {
  name                = "jevasoncv-profile"
  location            = "North Europe"
  resource_group_name = azurerm_resource_group.jevason-cv.name
  sku                 = "Standard_Microsoft"

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a CDN Profile to create a collection of CDN Endpoints. !> Be Aware: Azure is rolling out a breaking change on Friday 9th April which may cause issues with the CDN/FrontDoor resources. More information is available in this Github issue - however unfortunately this may necessitate a breaking change to the CDN and FrontDoor resources, more information will be posted in the Github issue as the necessary changes are identified.

Microsoft.Cdn/profiles (Azure Resource Manager)

The profiles in Microsoft.Cdn can be configured in Azure Resource Manager with the resource name Microsoft.Cdn/profiles. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

azuredeploy.json#L41
      "type": "Microsoft.Cdn/profiles",
      "apiVersion": "2020-09-01",
      "name": "[variables('profileName')]",
      "location": "global",
      "sku": {
        "name": "[parameters('skuName')]"
Profiles_Create.json#L19
        "type": "Microsoft.Cdn/profiles",
        "tags": {},
        "location": "WestCentralUs",
        "sku": {
          "name": "Standard_Verizon"
        },
Profiles_Create.json#L19
        "type": "Microsoft.Cdn/profiles",
        "tags": {},
        "location": "WestCentralUs",
        "sku": {
          "name": "Standard_Verizon"
        },
azuredeploy.json#L41
      "type": "Microsoft.Cdn/profiles",
      "apiVersion": "2020-09-01",
      "name": "[variables('profileName')]",
      "location": "global",
      "sku": {
        "name": "[parameters('skuName')]"
azuredeploy.json#L41
      "type": "Microsoft.Cdn/profiles",
      "apiVersion": "2020-09-01",
      "name": "[variables('profileName')]",
      "location": "global",
      "sku": {
        "name": "[parameters('skuName')]"
cdn-template.json#L17
        "type": "Microsoft.Cdn/profiles",
        "apiVersion": "2019-12-31",
        "name": "[parameters('cdnName')]",
        "location": "Global",
        "sku": {
            "name": "Standard_Microsoft"
azuredeploy.json#L46
      "type": "Microsoft.Cdn/profiles",
      "apiVersion": "2020-09-01",
      "name": "[variables('profileName')]",
      "location": "global",
      "sku": {
        "name": "[parameters('skuName')]"
Profiles_Create.json#L19
        "type": "Microsoft.Cdn/profiles",
        "tags": {},
        "location": "WestCentralUs",
        "sku": {
          "name": "Standard_Verizon"
        },

Parameters

  • apiVersion required - string
  • location required - string

    Resource location.

  • name required - string

    Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group.

  • properties required
      • identity optional
          • type optional - string

            Type of managed service identity.

      • originResponseTimeoutSeconds optional - integer

        Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and returns.

  • sku required
      • name optional - string

        Name of the pricing tier.

  • tags optional - string

    Resource tags.

  • type required - string

Frequently asked questions

What is Azure CDN Profile?

Azure CDN Profile is a resource for CDN of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure CDN Profile?

For Terraform, the gilyas/infracost, AngellusMortis/boundlexx-terra and asdasdasdasdasdasd1/bcp-challenge-infra source code examples are useful. See the Terraform Example section for further details.

For Azure Resource Manager, the srk810/azure-quickstart-templates, openapi-env-test/mk0prd-unified-pipeline-integration-test-specs and openapi-env-test/mk0prd-unified-pipeline-integration-test-specs source code examples are useful. See the Azure Resource Manager Example section for further details.