Hari Priya Thangavel
Hari Priya Thangavel

Reputation: 517

Azure CDN purge fails with error InvalidResource"

CDN purge is working when I do it from azure portal but when I tried the same using arm api, it fails with

{
  "error": {
    "code": "InvalidResource",
    "message": "The resource format is invalid."
  }
}

Here's the api:

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge?api-version=2016-10-02

I am able to do CDN Start, CDN load via API's except this purge which is my requirement :-(

Any help on this will be appreciated in tons :-)

Upvotes: 2

Views: 728

Answers (1)

Hari Priya Thangavel
Hari Priya Thangavel

Reputation: 517

Finally after 62+ purge requests I found out that contentPaths in the request body had issues.

It should be this format

{
  "contentPaths": [
    "(String)"
  ]
}

Upvotes: 7

Related Questions