0
votes

I am attempting to create an endpoint in my CDN profile with an ARM template. The Template creates a Storage Account and a CDN Profile and when I run the validation commands, my template validates.

However, when I run the deploy, it fails with the error below when it gets to deploying the endpoint into the CDN Profile.


The full error:

An unexpected instance annotation name 'mycdnstorage.blob.core.windows.net' was found when reading from the JSON reader, In OData, Instance annotation name must start with @.


Related Template field declaration This is the originHostHeader value of the endpoint declaration. The value assigned here is the same as the hostName value in the origins node.

"originHostHeader": "[replace(replace(reference(resourceId('Microsoft.Storage/storageAccounts', variables('cdnStorageName')), '2015-06-15').primaryEndpoints.blob, 'https://', ''), '/', '')]",

I have spent several hours comparing my arm template with the pre-built template when starting a new project for Storage-CDN. There does not seem to be any differences other than how my variables/parameters are declared.

I attempted to normalize my variables/parameters between my script and the pre-built, but this did not solve the problem either.

What am I missing in this line of my template?

1

1 Answers

0
votes

Figured it out!

Turns out there was an erroneous white-space character that was added after one of the commas. This code is completely valid and a normal space character is accepted. I am not sure which character made it into my template, but after writing the lines again by hand it started working as expected. I have since then ran 10 or so successful deploys of my template.