I have been using the Windows Azure Management Libraries to do this in the past with out problems but tonight on a new project I am facing a problem with:
BadRequest : The MD5 codes do not match.
I am not really sure what MD5s that do not match, if its the actually request message or its something related to the cspkg file in blob storage.
I looked up the documentation for the RestAPI and could not find any details on the error message.
Heres the code I use to create the deployment.
var result = await compute.Deployments.CreateAsync(message.ServiceName,
DeploymentSlot.Production,
new DeploymentCreateParameters
{
StartDeployment = true,
PackageUri = new Uri(message.PackageDownloadUri),
Name = message.CloudServiceDeploymentName,
Label = "AzureManagement Deployed Cloud Service " + DateTime.UtcNow.ToString(Constants.DATETIME_TOSTRING_FORMAT),
Configuration = document.ToString(),
ExtendedProperties = new Dictionary<string, string>
{
{ Constants.EXTENDED_PROPERTIES_CREATED_KEY , DateTime.UtcNow.ToString(Constants.DATETIME_TOSTRING_FORMAT)}
},
}, source.Token);