Azure Content Delivery Network
An Azure service that provides global content delivery and acceleration.
323 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am using Azure CDN / Blob for my Angular application. I would like to enable custom domain support - so that my end users can map the application domain themself. I thought of using Azure SDK. So far I did like this.
var cndCNAME = "dotnetthoughts";
var clientId = _configuration["ClientId"];
var clientSecret = _configuration["ClientSecret"];
var tenantId = _configuration["TenantId"];
var credentials = SdkContext.AzureCredentialsFactory
.FromServicePrincipal(clientId, clientSecret, tenantId, AzureEnvironment.AzureGlobalCloud);
var azure = Microsoft.Azure.Management.Fluent.Azure
.Configure()
.Authenticate(credentials)
.WithDefaultSubscription();
var cndProfile = azure.CdnProfiles.GetById("/subscriptions/<SUBSCRIPTIONID>/resourceGroups/anuraj/providers/microsoft.cdn/profiles/anuraj-dev-cdn");
var customDomainValidationResult = cndProfile.ValidateEndpointCustomDomain(cndCNAME, "demo.anuraj.dev");
if (customDomainValidationResult.CustomDomainValidated)
{
cndProfile.Update()
.DefineNewEndpoint()
.WithOrigin("https://anuraj.z29.web.core.windows.net")
.WithCustomDomain("demo.anuraj.dev")
.Attach()
.Apply();
}
Till the verification it is working. But when I try update the domain, it is failing - Bad Request Error.
Please help.
Have you followed this document for adding a custom domain to your endpoint? I did a Nslookup for the domain- demo.anuraj.dev and that did not return anything.