title: How to purge Front Door Standard/Premium (Preview) endpoint using code
body: <p>In the subscription (name: <code>test-subscription</code>) in the resource group (name: <code>test-resource-group</code>), I created <em>Front Door Standard/Premium (Preview)</em> (name: <code>test-front-door-profile</code>) with endpoint <code>test-front-door-profile-endpoint.z01.azurefd.net</code> and added new endpoint (endpoint name: <code>test-endpoint.z01.azurefd.net</code>).</p>
  <p>For example: I created a request: <code>https://test-endpoint.z01.azurefd.net/test/pictures/abcdefghi.jpeg</code>. How can I purge <code>test-endpoint.z01.azurefd.net/test/pictures/*</code> using code?</p>
  <p>I tried with this code, and different variants of <code>contentPaths</code></p>
  <pre><code>using Microsoft.Azure.Management.FrontDoor;
  using Microsoft.Azure.Management.FrontDoor.Models;
  using Microsoft.IdentityModel.Clients.ActiveDirectory;
  using Microsoft.Rest;
  ...
  
          public async Task PurgeContentAsync()
          {
              var authContext = new AuthenticationContext(Authority);
              var credential = new ClientCredential(ClientId, ClientSecret);
              var authResult = await authContext.AcquireTokenAsync(_resource, credential);
  
              var frontDoor = new FrontDoorManagementClient(new TokenCredentials(authResult.AccessToken)) { SubscriptionId = _subscriptionId };
  
              var contentPaths = new List&lt;string&gt; { &quot;/test-endpoint.z01.azurefd.net/test/pictures/*&quot; };
              var contentFilePaths = new PurgeParameters(contentPaths);
  
              await frontDoor.Endpoints.BeginPurgeContentAsync(&quot;test-resource-group&quot;, &quot;test-front-door-profile&quot;, contentFilePaths);
          }
  </code></pre>
  <p>but I always get exception:</p>
  <pre><code>The exception Microsoft.Azure.Management.FrontDoor.Models.ErrorResponseException was unhandled on the service and could not be serialized for transferring to the client.
  Detailed Remote Exception Information: Microsoft.Azure.Management.FrontDoor.Models.ErrorResponseException: Operation returned an invalid status code 'NotFound'
  </code></pre>
  <p>I tried with Microsoft.Azure.Management.Cdn library but I am getting back the same exception.</p>