I have created a Microsoft CDN (classic) in Azure and I need to retrieve the value of the X-Azure-Fdid
.
This value is not displayed in the Microsoft Azure Portal nor it is returned in the Azure CLI reponse.
Portal:
Azure CLI:
az cdn profile list --resource-group redacted --output json
{
"extendedProperties": {},
"id": "/subscriptions/redacted/resourcegroups/redacted/providers/Microsoft.Cdn/profiles/testtest",
"kind": "cdn",
"location": "Global",
"name": "testtest",
"provisioningState": "Succeeded",
"resourceGroup": "redacted",
"resourceState": "Active",
"sku": {
"name": "Standard_Microsoft"
},
"tags": {},
"type": "Microsoft.Cdn/profiles"
}
az cdn endpoint list --profile-name testtest --resource-group op-1 --output json
[
{
"contentTypesToCompress": [
"application/eot",
"application/font",
"application/font-sfnt",
"application/javascript",
"application/json",
"application/opentype",
"application/otf",
"application/pkcs7-mime",
"application/truetype",
"application/ttf",
"application/vnd.ms-fontobject",
"application/xhtml+xml",
"application/xml",
"application/xml+rss",
"application/x-font-opentype",
"application/x-font-truetype",
"application/x-font-ttf",
"application/x-httpd-cgi",
"application/x-javascript",
"application/x-mpegurl",
"application/x-opentype",
"application/x-otf",
"application/x-perl",
"application/x-ttf",
"font/eot",
"font/ttf",
"font/otf",
"font/opentype",
"image/svg+xml",
"text/css",
"text/csv",
"text/html",
"text/javascript",
"text/js",
"text/plain",
"text/richtext",
"text/tab-separated-values",
"text/xml",
"text/x-script",
"text/x-component",
"text/x-java-source"
],
"customDomains": [],
"geoFilters": [],
"hostName": "testtesttest.azureedge.net",
"id": "/redacted/resourcegroups/redacted/providers/Microsoft.Cdn/profiles/testtest/endpoints/testtesttest",
"isCompressionEnabled": true,
"isHttpAllowed": true,
"isHttpsAllowed": true,
"location": "Global",
"name": "testtesttest",
"originGroups": [],
"originHostHeader": "test.com",
"origins": [
{
"enabled": true,
"hostName": "test.com",
"httpPort": 80,
"httpsPort": 443,
"name": "test-com",
"originHostHeader": "test.com",
"priority": 1,
"weight": 1000
}
],
"provisioningState": "Succeeded",
"queryStringCachingBehavior": "BypassCaching",
"resourceGroup": "redacted",
"resourceState": "Running",
"tags": {},
"type": "Microsoft.Cdn/profiles/endpoints"
}
]
The only way I was able to retrieve this ID so far was to look at the access logs on my origin server which is not ideal…
If this helps I created the CDN using Terraform and the following resource:
resource "azurerm_cdn_profile" "example" {
name = var.cdn_profile_name
location = "West Europe"
resource_group_name = azurerm_resource_group.example.name
sku = "Standard_Microsoft"
}
2
Answers
To retrieve
frontdoorId
(X-Azure-Fdid
), you can use following commands:Documentation for the frontdoor az cli – https://learn.microsoft.com/en-us/cli/azure/network/front-door?view=azure-cli-latest#az-network-front-door-show
As of today there does not appear to be a way to a classic Microsoft CDN’s
XAzureFDID
value outside the logs. I can confirm that the CDN does in fact have an assigned XAzureFDID.I have a web app origin that is served both by a premium Front Door instance and a classic Microsoft CDN. When I look at the AppServiceIPSecAuditLogs I see the XAzureFDID column populated with a Front Door ID for all calls originating from Front Door. I also see a separate XAzureFDID for the calls originating from the Microsoft CDN.
In the logs for calls from Front Door:
In the logs for calls from the CDN:
Under the Microsoft.Cdn/profiles properties for the Front Door instance, via resources.azure.com:
Under the Microsoft.Cdn/profiles properties for the classic CDN: