mastodon.ie is one of the many independent Mastodon servers you can use to participate in the fediverse.
Irish Mastodon - run from Ireland, we welcome all who respect the community rules and members.

Administered by:

Server stats:

1.6K
active users

#shamelesstechshaming

0 posts0 participants0 posts today
Jesper Stemann Andersen<p>So, why is <a href="https://mastodon.social/tags/dotnet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnet</span></a> involved in the blame for <a href="https://mastodon.social/tags/MicrosoftAzure" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>MicrosoftAzure</span></a> CLI upload to blob storage being weird?</p><p>Due to how <a href="https://mastodon.social/tags/dotnet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnet</span></a> computes an MD5, and returns an array of 16 bytes instead of the more common hexadecimal string (the output of `xxd -r -p` in the cautionary tale).</p><p><a href="https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.md5?view=net-10.0#remarks" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">learn.microsoft.com/en-us/dotn</span><span class="invisible">et/api/system.security.cryptography.md5?view=net-10.0#remarks</span></a></p><p>An MD5 string is 32 bytes, so <a href="https://mastodon.social/tags/Microsoft" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Microsoft</span></a> saved 16 bytes by making it less easy to get an MD5 string... <a href="https://mastodon.social/tags/640kEnoughForAnyone" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>640kEnoughForAnyone</span></a></p><p><a href="https://mastodon.social/tags/MicrosoftLogic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>MicrosoftLogic</span></a> <a href="https://mastodon.social/tags/ShamelessTechShaming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ShamelessTechShaming</span></a> <a href="https://mastodon.social/tags/LegacyTech" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LegacyTech</span></a> <a href="https://mastodon.social/tags/LegacyCode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LegacyCode</span></a></p>
Jesper Stemann Andersen<p>I imagine it went down like this at the <a href="https://mastodon.social/tags/MicrosoftAzure" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>MicrosoftAzure</span></a> design meeting:</p><p>&gt; Microsoft engineer: We should store the MD5 of the content in the blob storage database.</p><p>&gt; Senior Microsoft engineer: Let's use <a href="https://mastodon.social/tags/dotnet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnet</span></a> (!), and interpret the hexadecimal MD5 (with a newline!) as binary, and then base64 encode it!</p><p>They might have saved a couple of bytes... <a href="https://mastodon.social/tags/dotnet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnet</span></a> ...👏 ...😬</p><p><a href="https://mastodon.social/tags/MicrosoftLogic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>MicrosoftLogic</span></a> <a href="https://mastodon.social/tags/ShamelessTechShaming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ShamelessTechShaming</span></a> <a href="https://mastodon.social/tags/LegacyTech" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LegacyTech</span></a> <a href="https://mastodon.social/tags/LegacyCode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LegacyCode</span></a> <a href="https://mastodon.social/tags/LegacyCodeProblems" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LegacyCodeProblems</span></a></p>
Jesper Stemann Andersen<p>But try uploading a single file to blob storage with the <a href="https://mastodon.social/tags/MicrosoftAzure" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>MicrosoftAzure</span></a> CLI! (and consume it with official <a href="https://mastodon.social/tags/dotnet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnet</span></a> API's - which require an MD5 checksum for blobs)</p><p>Surely `az storage blob upload --file foo [account] [container] [dst]` is enough?</p><p>Wrong! You need `az storage blob upload --file foo --content-md5 $(md5sum foo | cut -d ' ' -f 1 | xxd -r -p | base64) [account] [container] [dst]` 😬</p><p>Likely due to doing stuff with <a href="https://mastodon.social/tags/dotnet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dotnet</span></a></p><p><a href="https://mastodon.social/tags/ShamelessTechShaming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ShamelessTechShaming</span></a> <a href="https://mastodon.social/tags/MicrosoftLogic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>MicrosoftLogic</span></a> <a href="https://mastodon.social/tags/LegacyTech" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LegacyTech</span></a> <a href="https://mastodon.social/tags/LegacyCode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LegacyCode</span></a></p>
Jesper Stemann Andersen<p>Surprised with how bad the <a href="https://mastodon.social/tags/MicrosoftAzure" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>MicrosoftAzure</span></a> CLI tool is for batch uploading files to blob storage.</p><p>If a file already exists you get a five-line long warning - per file. Fair enough (ish).</p><p>There is no command line switch to ignore the warning - and `--overwrite false` changes nothing: You still get thousands of warnings when uploading a set of files (where some may already exist) - and you are left wondering whether it succeeded. Not so fair.</p><p><a href="https://mastodon.social/tags/ShamelessTechShaming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ShamelessTechShaming</span></a> <a href="https://mastodon.social/tags/MicrosoftLogic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>MicrosoftLogic</span></a> <a href="https://mastodon.social/tags/LegacyCode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LegacyCode</span></a></p>