Skip to content

Files

112 lines (72 loc) · 3.32 KB

create-profile-endpoint-bicep.md

File metadata and controls

112 lines (72 loc) · 3.32 KB
title titleSuffix description services author ms.service ms.tgt_pltfrm ms.topic ms.custom ms.date ms.author
Quickstart: Create a profile and endpoint - Bicep
Azure Content Delivery Network
In this quickstart, learn how to create an Azure Content Delivery Network profile and endpoint by using a Bicep file
cdn
schaffererin
azure-cdn
na
quickstart
subject-armqs, devx-track-azurepowershell, mode-arm
03/14/2022
v-eschaffer

Quickstart: Create an Azure CDN profile and endpoint - Bicep

Get started with Azure Content Delivery Network (CDN) by using a Bicep file. The Bicep file deploys a profile and an endpoint.

[!INCLUDE About Bicep]

Prerequisites

[!INCLUDE quickstarts-free-trial-note]

Review the Bicep file

The Bicep file used in this quickstart is from Azure Quickstart Templates.

This Bicep file is configured to create a:

  • Profile
  • Endpoint

:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.cdn/cdn-with-custom-origin/main.bicep":::

One Azure resource is defined in the Bicep file:

Deploy the Bicep file

  1. Save the Bicep file as main.bicep to your local computer.

  2. Deploy the Bicep file using either Azure CLI or Azure PowerShell.

    az group create --name exampleRG --location eastus
    az deployment group create --resource-group exampleRG --template-file main.bicep --parameters profileName=<profile-name> endpointName=<endpoint-name> originURL=<origin-url>
    
    New-AzResourceGroup -Name exampleRG -Location eastus
    New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -profileName "<profile-name>" -endpointName "<endpoint-name>" -originURL "<origin-url>"
    

    [!NOTE] Replace <profile-name> with the name of the CDN profile. Replace <endpoint-name> with a unique CDN Endpoint name. Replace <origin-url> with the URL of the origin.

    When the deployment finishes, you should see a message indicating the deployment succeeded.

Review deployed resources

Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group. Verify that an Endpoint and CDN profile were created in the resource group.

az resource list --resource-group exampleRG
Get-AzResource -ResourceGroupName exampleRG

Clean up resources

When no longer needed, use the Azure portal, Azure CLI, or Azure PowerShell to delete the resource group and its resources.

az group delete --name exampleRG
Remove-AzResourceGroup -Name exampleRG

Next steps

In this quickstart, you created a:

  • CDN Profile
  • Endpoint

To learn more about Azure CDN, continue to the article below.

[!div class="nextstepaction"] Tutorial: Use CDN to serve static content from a web app