I am trying to create a storage account using Web API but it is giving me the exception that method not allowed as shown below

[![Web Api Exception](https://i.stack.imgur.com/zMysc.png)](https://i.stack.imgur.com/zMysc.png)

Below is my code:

```
    string stAccName = "TCStorageAccount" + Guid.NewGuid().ToString().Substring(0, 8);
    stAccName = stAccName.ToLower();

    using (var client = new HttpClient())
    {
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        using (var stream = new MemoryStream())
        using (var writer = new StreamWriter(stream))
        {
            var payloadText = JsonConvert.SerializeObject(parameters);

writer.Write(payloadText);
            writer.Flush();
            stream.Flush();
            stream.Position = 0;

            using (var content = new StreamContent(stream))
            {
                content.Headers.Add("Content-Type", "application/json");
                content.Headers.Add("x-ms-version", "2016-12-01");
                Uri uri = new Uri(String.Format("https://management.azure.com/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Storage/storageAccounts/{2}?api-version=2016-12-01", "subid", "resource group name", stAccName));

var response = await client.PostAsync(uri, content);

                if (!response.IsSuccessStatusCode)
                {
                    throw new InvalidOperationException(response.ReasonPhrase);
                }
           }
       }
   }

```

I also tried with another way as discussed in this thread [Unable to create Storage account on Azure C#](https://stackoverflow.com/questions/45984311/unable-to-create-storage-account-on-azure-c-sharp) but still unable to create a storage account. 

Any help would be appreciated. Thanks