# Install Azure PowerShell module
Install-Module -Name Az -AllowClobber -Scope CurrentUser
# Log in to Azure
Connect-AzAccount
# Create Resource Group
$resourceGroupName = "YourResourceGroupName"
$location = "YourPreferredLocation"
New-AzResourceGroup -Name $resourceGroupName -Location $location
# Create CDN profile
$cdnProfileName = "YourCDNProfileName"
$sku = "Standard_Microsoft"
New-AzCdnProfile -ResourceGroupName $resourceGroupName -Name $cdnProfileName -Sku $sku -Location $location
# Create CDN endpoint
$cdnEndpointName = "YourCDNEndpointName"
$originHostName = "YourWebApp.azurewebsites.net"
New-AzCdnEndpoint -ResourceGroupName $resourceGroupName -ProfileName $cdnProfileName -Name $cdnEndpointName -Location $location -OriginHostName $originHostName
How to automate azure CDN service using powershell?
Please let me know if you have any samples to automate CDN and Front Door using powershell scripts.
-
Sedat SALMAN 13,740 Reputation points
2023-03-23T19:45:56.4633333+00:00
1 additional answer
Sort by: Most helpful
-
KapilAnanth-MSFT 44,311 Reputation points Microsoft Employee
2023-03-24T06:25:22.5266667+00:00 Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you would like to know how to manage Azure CDN and AFD using Powershell.
Find the "How-to" of all the configurations for CDN below
- Manage Azure CDN with PowerShell
- This contains commands for Listing, Creating, Adding a custom domain, Purging, Starting, Stopping, Deleting etc.
For AFD,
1.Premium/Standard
- Create an Azure Front Door Standard/Premium
- Other Powershell commands : Az.CDN Module
2.Classic
- Create a Classic Front Door
- Other Powershell commands : Az.FrontDoor Module
Kindly let us know if this helps or you need further assistance on this issue.
Thanks,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.