Azure role configuration management

五迷三道 提交于 2019-12-05 10:24:42

Passing a Stream to ComputeHash() ends up with a different hash as compared to using the byte[] overload. I don't know why.

Try something like:

private static void ComputeHash(HashAlgorithm hashAlgorithm, Stream stream)
{
    BinaryReader reader = new BinaryReader(stream)
    byte[] hash = hashAlgorithm.ComputeHash( reader.ReadBytes( (int)stream.length ) );
    string hashString = BitConverter.ToString(hash);
    Console.WriteLine(hashString.Replace("-", string.Empty));
    Console.WriteLine();
}

This will give you the hash you're after.

As you've probably already discovered, on linux you can get the digest with

openssl dgst -sha256 /path/to/file
knightpfhor

I you have items in your web.config that you want to change depending on how it's being built, there is a solution that is outside of Azure that you can use. You can use Web.config transforms. These transforms are tied to your build configuration not your service configuration, but your service configurations a likely closely tied to your build configurations anyway (...Local.csfg -> Debug, ...Cloud.csfg -> Release). If the default build configurations don't work for you, just create the ones you need.

If you want to use different service definitions per service configuration, then it's not supported by the UI, but you can mess around with the build process to make it work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!