0
votes

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);
1
Have you checked your local machine clock to ensure it hasn't "drifted"? This can sometimes cause issues when generating signed requests. :)BrentDaCodeMonkey
Good comment. I found the issue. If the service configuration file do not match the one the package was created for this is the error returned "BadRequest : The MD5 codes do not match.". I will answer my self.Poul K. Sørensen
turned out that I was wrong, still getting the error.Poul K. Sørensen
Just tried going by the management portal and I create he same error. Must be something with the package that is currupted. But I am just using the create package in visual studio.Poul K. Sørensen
Before I tried with "From blob storage" and now with using local it works. I suspect CloudBerry for putting wrong md5 codes on the files.Poul K. Sørensen

1 Answers

0
votes

I have not verified yet that cloudberry was the reason for the wrong md5 as there can be other factors that are in play here. But making TFS upload the packages automatic and not doing it manual made everything work.