<?xml-stylesheet type="text/xsl" href="http://feeds.feedblitz.com/feedblitz_rss.xslt"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:webfeeds="http://webfeeds.org/rss/1.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><channel><webfeeds:logo>https://www.hanselman.com/blog/images/zenicon.jpg</webfeeds:logo><webfeeds:analytics id="UA-130207-1" engine="GoogleAnalytics" /><title>Scott Hanselman's Blog</title><link>https://www.hanselman.com/blog/</link><description>Scott Hanselman on Programming, User Experience, The Zen of Computers and Life in General</description><image>
	<url>http://www.hanselman.com/blog/images/tinyheadshot2.jpg</url>
	<title>Scott Hanselman's Blog</title>
	<link>https://www.hanselman.com/blog/</link>
</image><copyright>Scott Hanselman</copyright><lastBuildDate>Mon, 09 Feb 2026 05:50:59 GMT</lastBuildDate><managingEditor>scott@hanselman.com</managingEditor><webMaster>scott@hanselman.com</webMaster>
<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<item>
<feedburner:origLink>https://www.hanselman.com/blog/is-the-craft-dead</feedburner:origLink><trackback:ping>https://www.hanselman.com/blog/feed/trackback/449e1a01-a1f1-49c3-96eb-4695a08ecef1</trackback:ping><pingback:server>https://www.hanselman.com/blog/feed/pingback</pingback:server><pingback:target>https://www.hanselman.com/blog/post/449e1a01-a1f1-49c3-96eb-4695a08ecef1</pingback:target><dc:creator>Scott Hanselman</dc:creator><wfw:comment>https://feeds.feedblitz.com/~/945480746/0/scotthanselman~Is-the-craft-dead/comments#comments-start</wfw:comment><wfw:commentRss>https://www.hanselman.com/blog/feed/rss/comments/449e1a01-a1f1-49c3-96eb-4695a08ecef1</wfw:commentRss><slash:comments>8</slash:comments><title>Is the craft dead?</title><guid isPermaLink="false">https://www.hanselman.com/blog/post/449e1a01-a1f1-49c3-96eb-4695a08ecef1</guid><link>https://feeds.feedblitz.com/~/945480746/0/scotthanselman~Is-the-craft-dead</link><pubDate>Mon, 09 Feb 2026 05:50:59 GMT</pubDate><description><![CDATA[<div><p>The Japanese are really good at woodworking. And I love watching the Yankee workshop, my dad makes Native American bows and arrows completely from scratch in his workshop with trees that he finds.&nbsp;<p>This is all different from the stuff you get at IKEA, but I’ve been coding now for money for 35 years and systems are still complicated, computers still do dumb stuff, humans still do dumb stuff, this is just like the move from assembler to C, like the introduction of syntax highlighting, the introduction of intellisense, and the copy paste directly into production shift when stack overflow happened.</p>
<p>There is value in good taste, there is value in craftsmanship, and there is value in human judgment. The furniture might be differently designed, but we’re still interior designers and putting together a cohesive system is non-trivial.&nbsp;</p>
<p>Don’t let them gaslight you with one shot Minecraft clones and one shot C compilers. Software is still hard, it’s just that you’re no longer I/O bound with the speed of your fingertips.</p>
<p>I think that there will be lots of work for us cleaning up after the slop, but if you know what you’re doing AI augmented development is going to get you some amazing results and I am enjoying learning a ton during this momentous era shift - but the craft still exists.</p><br/><hr/>© 2025 Scott Hanselman. All rights reserved. <br/></div><div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/945480746/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/945480746/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/945480746/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/945480746/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</description><comments>https://feeds.feedblitz.com/~/945480746/0/scotthanselman~Is-the-craft-dead/comments#comments-start</comments><category>Musings</category><content:encoded><![CDATA[<div><p>The Japanese are really good at woodworking. And I love watching the Yankee workshop, my dad makes Native American bows and arrows completely from scratch in his workshop with trees that he finds.&nbsp;<p>This is all different from the stuff you get at IKEA, but I’ve been coding now for money for 35 years and systems are still complicated, computers still do dumb stuff, humans still do dumb stuff, this is just like the move from assembler to C, like the introduction of syntax highlighting, the introduction of intellisense, and the copy paste directly into production shift when stack overflow happened.</p>
<p>There is value in good taste, there is value in craftsmanship, and there is value in human judgment. The furniture might be differently designed, but we’re still interior designers and putting together a cohesive system is non-trivial.&nbsp;</p>
<p>Don’t let them gaslight you with one shot Minecraft clones and one shot C compilers. Software is still hard, it’s just that you’re no longer I/O bound with the speed of your fingertips.</p>
<p>I think that there will be lots of work for us cleaning up after the slop, but if you know what you’re doing AI augmented development is going to get you some amazing results and I am enjoying learning a ton during this momentous era shift - but the craft still exists.</p>
<br/><hr/>© 2025 Scott Hanselman. All rights reserved. 
<br/></div><Img align="left" border="0" height="1" width="1" alt="" style="border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;" hspace="0" src="https://feeds.feedblitz.com/~/i/945480746/0/scotthanselman">
<div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/945480746/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/945480746/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/945480746/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/945480746/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</content:encoded></item>
<item>
<feedburner:origLink>https://www.hanselman.com/blog/the-danger-of-glamourizing-one-shots</feedburner:origLink><trackback:ping>https://www.hanselman.com/blog/feed/trackback/18a2f0d8-2090-4b71-ac9c-c0d592583e22</trackback:ping><pingback:server>https://www.hanselman.com/blog/feed/pingback</pingback:server><pingback:target>https://www.hanselman.com/blog/post/18a2f0d8-2090-4b71-ac9c-c0d592583e22</pingback:target><dc:creator>Scott Hanselman</dc:creator><wfw:comment>https://feeds.feedblitz.com/~/945480803/0/scotthanselman~The-danger-of-glamourizing-one-shots/comments#comments-start</wfw:comment><wfw:commentRss>https://www.hanselman.com/blog/feed/rss/comments/18a2f0d8-2090-4b71-ac9c-c0d592583e22</wfw:commentRss><slash:comments>1</slash:comments><title>The danger of glamourizing one shots</title><guid isPermaLink="false">https://www.hanselman.com/blog/post/18a2f0d8-2090-4b71-ac9c-c0d592583e22</guid><link>https://feeds.feedblitz.com/~/945480803/0/scotthanselman~The-danger-of-glamourizing-one-shots</link><pubDate>Wed, 04 Feb 2026 05:53:00 GMT</pubDate><description><![CDATA[<div><p>People should not be judging AI-augmented coding by “1 shots.”&nbsp;</p><p>If someone told you that their model did a “one shot of Minecraft” and they’re impressed by that, you need to consider how much semantic heavy lifting the word “Minecraft” is doing in that prompt.&nbsp;</p><p>Ask them to one shot Minecraft without using the word Minecraft.&nbsp;</p><p>It’s not trivial to one shot something unique, because programming is the art of making the ambiguous incredibly specific through sculpting. AI sculpting is less about vibes and more about finding the specificity you want and keeping the system stable through changes. Good SDLC practices still matter, historical context still matters, and knowing how things work matters, shout out to Grady Booch.</p><p>It’s a cool party trick to one shot Mario Brothers or space invaders, but then you’ll end up with the most mid version of both. Literally mid. You’ll get the statistical fat part of the Bell curve version of these mythical games. You’re telling the model to close its eyes and draw the face of these games from memory.&nbsp;</p><p>As high-level programming cedes way to the prose compiler, making your goals and specs well understood to the ambiguity loop and showing good judgment is going to matter more than ever. Consider all of your words and make sure that certain words aren’t carrying all the semantic load, hidden or otherwise.</p><br/><hr/>© 2025 Scott Hanselman. All rights reserved. <br/></div><div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/945480803/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/945480803/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/945480803/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/945480803/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</description><comments>https://feeds.feedblitz.com/~/945480803/0/scotthanselman~The-danger-of-glamourizing-one-shots/comments#comments-start</comments><category>Musings</category><content:encoded><![CDATA[<div><p>People should not be judging AI-augmented coding by “1 shots.”&nbsp;</p><p>If someone told you that their model did a “one shot of Minecraft” and they’re impressed by that, you need to consider how much semantic heavy lifting the word “Minecraft” is doing in that prompt.&nbsp;</p><p>Ask them to one shot Minecraft without using the word Minecraft.&nbsp;</p><p>It’s not trivial to one shot something unique, because programming is the art of making the ambiguous incredibly specific through sculpting. AI sculpting is less about vibes and more about finding the specificity you want and keeping the system stable through changes. Good SDLC practices still matter, historical context still matters, and knowing how things work matters, shout out to Grady Booch.</p><p>It’s a cool party trick to one shot Mario Brothers or space invaders, but then you’ll end up with the most mid version of both. Literally mid. You’ll get the statistical fat part of the Bell curve version of these mythical games. You’re telling the model to close its eyes and draw the face of these games from memory.&nbsp;</p><p>As high-level programming cedes way to the prose compiler, making your goals and specs well understood to the ambiguity loop and showing good judgment is going to matter more than ever. Consider all of your words and make sure that certain words aren’t carrying all the semantic load, hidden or otherwise.</p>
<br/><hr/>© 2025 Scott Hanselman. All rights reserved. 
<br/></div><Img align="left" border="0" height="1" width="1" alt="" style="border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;" hspace="0" src="https://feeds.feedblitz.com/~/i/945480803/0/scotthanselman">
<div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/945480803/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/945480803/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/945480803/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/945480803/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</content:encoded></item>
<item>
<feedburner:origLink>https://www.hanselman.com/blog/automatically-signing-a-windows-exe-with-azure-trusted-signing-dotnet-sign-and-github-actions</feedburner:origLink><trackback:ping>https://www.hanselman.com/blog/feed/trackback/e6ac5a6a-1d2a-4ad2-b116-71ff0508b5c3</trackback:ping><pingback:server>https://www.hanselman.com/blog/feed/pingback</pingback:server><pingback:target>https://www.hanselman.com/blog/post/e6ac5a6a-1d2a-4ad2-b116-71ff0508b5c3</pingback:target><dc:creator>Scott Hanselman</dc:creator><wfw:comment>https://feeds.feedblitz.com/~/930373259/0/scotthanselman~Automatically-Signing-a-Windows-EXE-with-Azure-Trusted-Signing-dotnet-sign-and-GitHub-Actions/comments#comments-start</wfw:comment><wfw:commentRss>https://www.hanselman.com/blog/feed/rss/comments/e6ac5a6a-1d2a-4ad2-b116-71ff0508b5c3</wfw:commentRss><slash:comments>12</slash:comments><title>Automatically Signing a Windows EXE with Azure Trusted Signing, dotnet sign, and GitHub Actions</title><guid isPermaLink="false">https://www.hanselman.com/blog/post/e6ac5a6a-1d2a-4ad2-b116-71ff0508b5c3</guid><link>https://feeds.feedblitz.com/~/930373259/0/scotthanselman~Automatically-Signing-a-Windows-EXE-with-Azure-Trusted-Signing-dotnet-sign-and-GitHub-Actions</link><pubDate>Fri, 28 Nov 2025 19:31:25 GMT</pubDate><description><![CDATA[<div><p><a href="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Automatically-Signing-a-Windows-EXE-with_D0BE/image_2.png"><img title="WindowsEdgeLight on a Surface" style="float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 0px 5px; display: inline; padding-right: 0px" alt="WindowsEdgeLight on a Surface" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Automatically-Signing-a-Windows-EXE-with_D0BE/image_thumb%5B1%5D.png" width="400" align="right" height="344"></a>Mac Tahoe (in Beta as of the time of this writing) has this new feature called Edge Light that basically puts a bright picture of an Edge Light around your screen and basically uses the power of OLED to give you a virtual ring light. So I was like, why can't we also have nice things? I wrote (<a href="https://www.youtube.com/watch?v=WMbHVu4lAGA">vibed, with GitHub Copilot and Claude Sonnet 4.5</a>) a Windows Edge Light App (source code at <a title="https://github.com/shanselman/WindowsEdgeLight" href="https://github.com/shanselman/WindowsEdgeLight">https://github.com/shanselman/WindowsEdgeLight</a> and you can get the latest release here <a title="https://github.com/shanselman/WindowsEdgeLight/releases" href="https://github.com/shanselman/WindowsEdgeLight/releases">https://github.com/shanselman/WindowsEdgeLight/releases</a> or the app will check for new releases and autoupdate with Updatum).</p> <p>However, as is with all suss loose executables on the internet, when you run random stuff you'll often get the Window Defender 'new phone, who dis' warning which is scary. After several downloads and no viruses or complaints, my executable will eventually gain reputation with the Windows Defender Smart Screen service, but having a Code Signing Certificate is said to help with that. However, code signing certs are expensive and a hassle to manage and renew.</p> <p>Someone told me that <a href="https://azure.microsoft.com/en-us/products/trusted-signing">Azure Trusted Signing</a> was somewhat less of a hassle - it's less, but it's still non-trivial. I read <a href="https://weblog.west-wind.com/posts/2025/Jul/20/Fighting-through-Setting-up-Microsoft-Trusted-Signing">this post from Rick (his blog is gold and has been for years) earlier in the year</a> and some of it was super useful and other stuff has been made simpler over time.</p> <p>I wrote 80% of this blog post, but since I just spent an hour getting code signing to work and GitHub Copilot was going through and logging everything I did, I did use Claude 4.5 to help organize some of this. I have reviewed it all and re-written parts I didn't like, so any mistakes are mine.</p> <p>Azure Trusted Signing is Microsoft's cloud-based code signing service that:</p> <ul> <li><strong>No hardware tokens</strong> - Everything happens in the cloud  <li><strong>Automatic certificate management</strong> - Certificates are issued and renewed automatically  <li><strong>GitHub Actions integration</strong> - Sign during your CI/CD pipeline. I used GH Actions.  <li><strong>Kinda Affortable</strong> - About $10/month for small projects. I would like it if this were $10 a year. This is cheaper than a yearly cert, but it'll add up after a while so I'm always looking for cheaper/easier options.  <li><strong>Trusted by Windows</strong> - Uses the same certificate authority as Microsoft's own apps, so you should get your EXE trusted faster</li></ul> <h2>Prerequisites</h2> <p>Before starting, you'll need:  <ol> <li><strong>Azure subscription</strong>  <li><strong>Azure CLI</strong> - <a href="https://aka.ms/installazurecliwindows">Install from here</a>  <li><strong>Identity validation documents</strong> - Driver's license or passport for individual developers. Note that I'm in the US, so your mileage may vary but I basically set up the account, scanned a QR code, took a picture of my license, then did a selfie, then waited.  <li><strong>Windows PC</strong> - For local signing (optional) but I ended up using the dotnet sign tool. There are  <li><strong>GitHub repository</strong> - For automated signing (optional)</li></ol> <h3>Part 1: Setting Up Azure Trusted Signing</h3> <h4>Step 1: Register the Resource Provider</h4> <p>First, I need to enable the Azure Trusted Signing service in my subscription. This can be done in the Portal, or at the CLI. <pre><code># Login to Azure
az login
# Register the Microsoft.CodeSigning resource provider
az provider register --namespace Microsoft.CodeSigning
# Wait for registration to complete (takes 2-3 minutes)
az provider show --namespace Microsoft.CodeSigning --query "registrationState"
</code></pre>
<p>Wait until the output shows <code>"Registered"</code>. 
<h3>Step 2: Create a Trusted Signing Account</h3>
<p>Now create the actual signing account. You can do this via Azure Portal or CLI. 
<p><strong>Option A: Azure Portal (Easier for first-timers)</strong> 
<ol>
<li>Go to <a href="https://portal.azure.com/">Azure Portal</a> 
<li>Search for "Trusted Signing Accounts" 
<li>Click <strong>Create</strong> 
<li>Fill in: 
<ul>
<li><strong>Subscription</strong>: Your subscription 
<li><strong>Resource Group</strong>: Create new or use existing (e.g., "MyAppSigning") 
<li><strong>Account Name</strong>: A unique name (e.g., "myapp-signing") 
<li><strong>Region</strong>: Choose closest to you (e.g., "West US 2") 
<li><strong>SKU</strong>: Basic (sufficient for most apps)</li></ul>
<li>Click <strong>Review + Create</strong>, then <strong>Create</strong></li></ol>
<p><strong>Option B: Azure CLI (Faster if you are a CLI person or like to drive stick shift)</strong><pre><code># Create a resource group
az group create --name MyAppSigning --location westus2
# Create the Trusted Signing account
az trustedsigning create \
  --resource-group MyAppSigning \
  --account-name myapp-signing \
  --location westus2 \
  --sku-name Basic
</code></pre>
<p><strong>Important</strong>: Note your region endpoint. Common ones are: 
<ul>
<li>East US: <code>https://eus.codesigning.azure.net/</code> 
<li>West US 2: <code>https://wus2.codesigning.azure.net/</code> 
<li>Your specific region: Check in Azure Portal under your account's Overview page</li></ul>
<p>I totally flaked on this and messed around for 10 min before I realized that this URL matters and is specific to your account. Remember this endpoint.</p>
<h3>Step 3: Complete Identity Validation</h3>
<p>This is the most important step. Microsoft needs to verify you're a real person/organization. 
<ol>
<li>In Azure Portal, go to your Trusted Signing Account 
<li>Click <strong>Identity validation</strong> in the left menu 
<li>Click <strong>Add identity validation</strong> 
<li>Choose validation type: 
<ul>
<li><strong>Individual</strong>: For solo developers (uses driver's license/passport) 
<li><strong>Organization</strong>: For companies (uses business registration documents)</li></ul>
<li>For <strong>Individual validation</strong>: 
<ul>
<li>Upload a clear photo of your government-issued ID 
<li>Provide your full legal name (must match ID exactly) 
<li>Provide your email address</li></ul>
<li>Submit and wait for approval</li></ol>
<p><strong>Approval Time</strong>: 
<ul>
<li>Individual: Usually 1-3 business days 
<li>Organization: 3-5 business days 
<li>Me: This took about 4 hours, so again, YMMV. I used my personal account and my personal Azure (don't trust MSFT folks with unlimited Azure credits, I pay for my own) so they didn't know it was me. I went through the regular line, not the Pre-check line LOL.</li></ul>
<p>You'll receive an email when approved. <strong>You cannot sign any code until this is approved.</strong> 
<h3>Step 4: Create a Certificate Profile</h3>
<p>Once your identity is validated, create a certificate profile. This is what actually issues the signing certificates. 
<ol>
<li>In your Trusted Signing Account, click <strong>Certificate profiles</strong> 
<li>Click <strong>Add certificate profile</strong> 
<li>Fill in: 
<ul>
<li><strong>Profile name</strong>: Descriptive name (e.g., "MyAppProfile") 
<li><strong>Profile type</strong>: Choose <strong>Public Trust</strong> (required to prevent SmartScreen) 
<li><strong>Identity validation</strong>: Select your approved identity 
<li><strong>Certificate type</strong>: Code Signing</li></ul>
<li>Click <strong>Add</strong></li></ol>
<p><strong>Important</strong>: Only "Public Trust" profiles prevent SmartScreen warnings. "Private Trust" is for internal apps only. This took me a second to realize also as it's not an intuitive name. 
<h3>Step 5: Verify Your Setup</h3><pre><code># List your Trusted Signing accounts
az trustedsigning show \
  --resource-group MyAppSigning \
  --account-name myapp-signing
# Should show status: "Succeeded"
</code></pre>
<p><strong>Write down these values</strong> - you'll need them later: 
<ul>
<li><strong>Account Name</strong>: <code>myapp-signing</code> 
<li><strong>Certificate Profile Name</strong>: <code>MyAppProfile</code> 
<li><strong>Endpoint URL</strong>: <code>https://wus2.codesigning.azure.net/</code> (or your region) 
<li><strong>Subscription ID</strong>: Found in Azure Portal 
<li><strong>Resource Group</strong>: <code>MyAppSigning</code></li></ul>
<h2>Part 2: Local Code Signing</h2>
<p>Now let's sign an executable on your my machine. You don't NEED to do this, but I wanted to try it locally to avoid a bunch of CI/CD runs, and I wanted to right-click the EXE and see the cert in Properties before I took it all to the cloud. The nice part about this was that I didn't need to mess with any certificates. 
<h3>Step 1: Assign Yourself the Signing Role</h3>
<p>You need permission to actually use the signing service. 
<p><strong>Option A: Azure Portal</strong> 
<ol>
<li>Go to your Trusted Signing Account 
<li>Click <strong>Access control (IAM)</strong> 
<li>Click <strong>Add</strong> → <strong>Add role assignment</strong> 
<li>Search for and select <strong>Trusted Signing Certificate Profile Signer. </strong>This is important. I searched for "code" and found nothing. Search for "Trusted" 
<li>Click <strong>Next</strong> 
<li>Click <strong>Select members</strong> and find your user account 
<li>Click <strong>Select</strong>, then <strong>Review + assign</strong></li></ol>
<p><strong>Option B: Azure CLI</strong><pre><code># Get your user object ID
$userId = az ad signed-in-user show --query id -o tsv
# Assign the role
az role assignment create \
  --role "Trusted Signing Certificate Profile Signer" \
  --assignee-object-id $userId \
  --scope /subscriptions/YOUR_SUBSCRIPTION_ID/resourceGroups/MyAppSigning/providers/Microsoft.CodeSigning/codeSigningAccounts/myapp-signing
</code></pre>
<p>Replace <code>YOUR_SUBSCRIPTION_ID</code> with your actual subscription ID. 
<h3>Step 2: Login with the Correct Scope</h3>
<p>This is crucial - you need to login with the specific codesigning scope.<pre><code># Logout first to clear old tokens
az logout
# Login with codesigning scope
az login --use-device-code --scope "https://codesigning.azure.net/.default"
</code></pre>
<p>This will give you a code to enter at <a href="https://microsoft.com/devicelogin">https://microsoft.com/devicelogin</a>. Follow the prompts. 
<p><strong>Why device code flow?</strong> Because Azure CLI's default authentication can conflict with Visual Studio credentials in my experience. Device code flow is more reliable for code signing. 
<h3>Step 3: Download the Sign Tool</h3>
<p><strong>Option A: Install Globally (Recommended for regular use)</strong><pre><code># Install as a global tool (available everywhere)
dotnet tool install --global --prerelease sign
# Verify installation
sign --version
</code></pre>
<p><strong>Option B: Install Locally (Project-specific)</strong><pre><code># Install to current directory
dotnet tool install --tool-path . --prerelease sign
# Use with .\sign.exe
</code></pre>
<p><strong>Which should I use?</strong> 
<ul>
<li><strong>Global</strong>: If you'll sign multiple projects or sign frequently 
<li><strong>Local</strong>: If you want to keep the tool with a specific project or don't want it in your PATH</li></ul>
<h3>Step 4: Sign Your Executable</h3>
<p>Note again that code signing URL is specific to you. The tscp is your Trusted Signing Certificate Profile name and the tsa is your Trusted Signing Account name. I set *.exe to sign all the EXEs in the folder and note that the -b base directory is an absolute path, not a relative one. For me it was d:\github\WindowsEdgeLight\publish, and your mileage will vary.</p><pre><code># Navigate to your project folder
cd C:\MyProject
# Sign the executable
.\sign.exe code trusted-signing `
  -b "C:\MyProject\publish" `
  -tse "https://wus2.codesigning.azure.net" `
  -tscp "MyAppProfile" `
  -tsa "myapp-signing" `
  *.exe `
  -v Information
</code></pre>
<p><strong>Parameters explained:</strong> 
<ul>
<li><code>-b</code>: Base directory containing files to sign 
<li><code>-tse</code>: Trusted Signing endpoint (your region) 
<li><code>-tscp</code>: Certificate profile name 
<li><code>-tsa</code>: Trusted Signing account name 
<li><code>*.exe</code>: Pattern to match files to sign 
<li><code>-v</code>: Verbosity level (Trace, Information, Warning, Error)</li></ul>
<p><strong>Expected output:</strong><pre><code>info: Signing WindowsEdgeLight.exe succeeded.
Completed in 2743 ms.
</code></pre>
<h3>Step 5: Verify the Signature</h3>
<p>You can do this in PowerShell:</p><pre><code># Check the signature
Get-AuthenticodeSignature ".\publish\MyApp.exe" | Format-List
# Look for:
# Status: Valid
# SignerCertificate: CN=Your Name, O=Your Name, ...
# TimeStamperCertificate: Should be present
</code></pre>
<p><strong>Right-click the EXE</strong> → <strong>Properties</strong> → <strong>Digital Signatures</strong> tab: 
<ul>
<li>You should see your signature 
<li>"This digital signature is OK"</li></ul>
<h3>Common Local Signing Issues</h3>
<p>I hit all of these lol</p>
<p><strong>Issue: "Please run 'az login' to set up account"</strong> 
<ul>
<li><strong>Cause</strong>: Not logged in with the right scope 
<li><strong>Fix</strong>: Run <code>az logout</code> then <code>az login --use-device-code --scope "https://codesigning.azure.net/.default"</code></li></ul>
<p><strong>Issue: "403 Forbidden"</strong> 
<ul>
<li><strong>Cause</strong>: Wrong endpoint, account name, or missing permissions 
<li><strong>Fix</strong>: 
<ul>
<li>Verify endpoint matches your region (wus2, eus, etc.) 
<li>Verify account name is exact (case-sensitive) 
<li>Verify you have "Trusted Signing Certificate Profile Signer" role</li></ul></li></ul>
<p><strong>Issue: "User account does not exist in tenant"</strong> 
<ul>
<li><strong>Cause</strong>: Azure CLI trying to use Visual Studio credentials 
<li><strong>Fix</strong>: Use device code flow (see Step 2)</li></ul>
<h2>Part 3: Automated Signing with GitHub Actions</h2>
<p>This is where the magic happens. I want to automatically sign every release. I'm using GitVersion so I just need to tag a commit and GitHub Actions will kick off a run. You can go look at a real run in detail at <a title="https://github.com/shanselman/WindowsEdgeLight/actions/runs/19775054123" href="https://github.com/shanselman/WindowsEdgeLight/actions/runs/19775054123">https://github.com/shanselman/WindowsEdgeLight/actions/runs/19775054123</a>
<h3>Step 1: Create a Service Principal</h3>
<p>GitHub Actions needs its own identity to sign code. We'll create a service principal (like a robot account). This is VERY different than your local signing setup.
<p><strong>Important</strong>: You need <strong>Owner</strong> or <strong>User Access Administrator</strong> role on your subscription to do this. If you don't have it, ask your Azure admin or a friend.<pre><code># Create service principal with signing permissions
az ad sp create-for-rbac \
  --name "MyAppGitHubActions" \
  --role "Trusted Signing Certificate Profile Signer" \
  --scopes /subscriptions/YOUR_SUBSCRIPTION_ID/resourceGroups/MyAppSigning/providers/Microsoft.CodeSigning/codeSigningAccounts/myapp-signing \
  --json-auth
</code></pre>
<p>This outputs JSON like this:<pre><code>{
  "clientId": "12345678-1234-1234-1234-123456789abc",
  "clientSecret": "super-secret-value-abc123",
  "tenantId": "87654321-4321-4321-4321-cba987654321",
  "subscriptionId": "abcdef12-3456-7890-abcd-ef1234567890"
}
</code></pre>
<p><strong>SAVE THESE VALUES IMMEDIATELY!</strong> You can't retrieve the <code>clientSecret</code> again. This is super important.
<p><strong>Alternative: Azure Portal Method</strong> 
<p>If CLI doesn't work: 
<ol>
<li><strong>Azure Portal</strong> → <strong>App registrations</strong> → <strong>New registration</strong> 
<li>Name: "MyAppGitHubActions" 
<li>Click <strong>Register</strong> 
<li><strong>Copy the Application (client) ID</strong> - this is <code>AZURE_CLIENT_ID</code> 
<li><strong>Copy the Directory (tenant) ID</strong> - this is <code>AZURE_TENANT_ID</code> 
<li>Go to <strong>Certificates &amp; secrets</strong> → <strong>New client secret</strong> 
<li>Description: "GitHub Actions" 
<li>Expiration: 24 months (max) 
<li>Click <strong>Add</strong> and <strong>immediately copy the Value</strong> - this is <code>AZURE_CLIENT_SECRET</code> 
<li>Go to your Trusted Signing Account → <strong>Access control (IAM)</strong> 
<li><strong>Add role assignment</strong> → <strong>Trusted Signing Certificate Profile Signer</strong> 
<li><strong>Select members</strong> → Search for "MyAppGitHubActions" 
<li><strong>Review + assign</strong></li></ol>
<h3>Step 2: Add GitHub Secrets</h3>
<p>Go to your GitHub repository: 
<ol>
<li><strong>Settings</strong> → <strong>Secrets and variables</strong> → <strong>Actions</strong> 
<li>Click <strong>New repository secret</strong> for each:</li></ol>
<ul>
<li><code>AZURE_CLIENT_ID </code>- From service principal output or App registration </li>
<li><code>AZURE_CLIENT_SECRET <font face="Calibri">- </font></code>From service principal output or Certificates &amp; secrets </li>
<li><code>AZURE_TENANT_ID </code>- From service principal output or App registration </li>
<li><code>AZURE_SUBSCRIPTION_ID </code>- Azure Portal → Subscriptions </li></ul>
<p><strong>Security Note</strong>: These secrets are encrypted and never visible in logs. Only your workflow can access them. You'll never see them again.
<h3>Step 3: Update Your GitHub Workflow</h3>
<p>This is a little confusing as it's YAML, which is Satan's markup, but it's what we have sunk to as a society. 
<p>Note the dotnet-version below. Yours might be 8 or 9, etc. Also, I am building both x64 and ARM versions and I am using GitVersion so if you want a more complete build.yml, you can go here <a title="https://github.com/shanselman/WindowsEdgeLight/blob/master/.github/workflows/build.yml" href="https://github.com/shanselman/WindowsEdgeLight/blob/master/.github/workflows/build.yml">https://github.com/shanselman/WindowsEdgeLight/blob/master/.github/workflows/build.yml</a> I am also zipping mine up and prepping my releases so my loose EXE lives in a ZIP file.
<p>Add signing steps to your <code>.github/workflows/build.yml</code>:<pre><code>name: Build and Sign
on:
  push:
    tags:
      - 'v*'
  workflow_dispatch:
permissions:
  contents: write
jobs:
  build:
    runs-on: windows-latest
    
    steps:
    - name: Checkout code
      uses: actions/checkout@v4
      with:
        fetch-depth: 0
      
    - name: Setup .NET
      uses: actions/setup-dotnet@v4
      with:
        dotnet-version: '10.0.x'
        
    - name: Restore dependencies
      run: dotnet restore MyApp/MyApp.csproj
    - name: Build
      run: |
        dotnet publish MyApp/MyApp.csproj `
          -c Release `
          -r win-x64 `
          --self-contained
    # === SIGNING STEPS START HERE ===
    
    - name: Azure Login
      uses: azure/login@v2
      with:
        creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'
    - name: Sign executables with Trusted Signing
      uses: azure/trusted-signing-action@v0
      with:
        azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
        azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
        azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
        endpoint: https://wus2.codesigning.azure.net/
        trusted-signing-account-name: myapp-signing
        certificate-profile-name: MyAppProfile
        files-folder: ${{ github.workspace }}\MyApp\bin\Release\net10.0-windows\win-x64\publish
        files-folder-filter: exe
        files-folder-recurse: true
        file-digest: SHA256
        timestamp-rfc3161: http://timestamp.acs.microsoft.com
        timestamp-digest: SHA256
    
    # === SIGNING STEPS END HERE ===
        
    - name: Create Release
      if: startsWith(github.ref, 'refs/tags/')
      uses: softprops/action-gh-release@v2
      with:
        files: MyApp/bin/Release/net10.0-windows/win-x64/publish/MyApp.exe
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
</code></pre>
<p><strong>Key points:</strong> 
<ul>
<li><code>endpoint</code>: Use YOUR region's endpoint (wus2, eus, etc.) 
<li><code>trusted-signing-account-name</code>: Your account name (exact, case-sensitive) 
<li><code>certificate-profile-name</code>: Your certificate profile name (exact, case-sensitive) 
<li><code>files-folder</code>: Path to your compiled executables 
<li><code>files-folder-filter</code>: File types to sign (exe, dll, etc.) 
<li><code>files-folder-recurse</code>: Sign files in subfolders</li></ul>
<h3>Step 4: Test the Workflow</h3>
<p>Now trigger the workflow. You have two options:</p>
<p><strong>Option A: Manual Trigger (Safest for testing)</strong>
<p>Since the workflow includes <code>workflow_dispatch:</code>, you can trigger it manually without creating a tag:<pre><code># Trigger manually via GitHub CLI
gh workflow run build.yml
# Or go to GitHub web UI:
# Actions tab → "Build and Sign" workflow → "Run workflow" button
</code></pre>
<p>This is ideal for testing because:
<ul>
<li>No tag required 
<li>Won't create a release 
<li>Can test multiple times 
<li>Easy to debug issues</li></ul>
<p><strong>Option B: Create a Tag (For actual releases)</strong><pre><code># Make sure you're on your main branch with no uncommitted changes
git status
# Create and push a tag
git tag v1.0.0
git push origin v1.0.0
</code></pre>
<p>Use this when you're ready to create an actual release with signed binaries. This is what I am doing on my side.
<h3>Step 5: Monitor the Build</h3>
<p>Watch the progress with GitHub CLI:<pre><code># See latest runs
gh run list --limit 5
# Watch a specific run
gh run watch
# View detailed status
gh run view --log
</code></pre>
<p>Or visit: <code>https://github.com/YOUR_USERNAME/YOUR_REPO/actions</code> 
<p><strong>Look for:</strong> 
<ul>
<li>Azure Login - Should complete in ~5 seconds 
<li>Sign executables with Trusted Signing - Should complete in ~10-30 seconds 
<li>Create Release - Your signed executable is now available in /releases in your GitHib project</li></ul>
<h3>Common GitHub Actions Issues</h3>
<p>I hit a few of these, natch.</p>
<p><strong>Issue: "403 Forbidden" during signing</strong> 
<ul>
<li><strong>Cause</strong>: Service principal doesn't have permissions 
<li><strong>Fix</strong>: 
<ol>
<li>Go to Azure Portal → Trusted Signing Account → Access control (IAM) 
<li>Verify "MyAppGitHubActions" has "Trusted Signing Certificate Profile Signer" role 
<li>If not, add it manually</li></ol></li></ul>
<p><strong>Issue: "No files matched the pattern"</strong> 
<ul>
<li><strong>Cause</strong>: Wrong <code>files-folder</code> path or build artifacts in wrong location 
<li><strong>Fix</strong>: 
<ol>
<li>Add a debug step before signing: <code>- run: Get-ChildItem -Recurse</code> 
<li>Find where your EXE is actually located 
<li>Update <code>files-folder</code> to match</li></ol></li></ul>
<p><strong>Issue: Secrets not working</strong> 
<ul>
<li><strong>Cause</strong>: Typo in secret name or value not saved 
<li><strong>Fix</strong>: 
<ol>
<li>Verify secret names EXACTLY match (case-sensitive) 
<li>Re-create secrets if unsure 
<li>Make sure no extra spaces in values</li></ol></li></ul>
<p><strong>Issue: "DefaultAzureCredential authentication failed"</strong> 
<ul>
<li><strong>Cause</strong>: Usually wrong tenant ID or client ID 
<li><strong>Fix</strong>: Verify all 4 secrets are correct from service principal output</li></ul>
<h2>Part 4: Understanding the Certificate</h2>
<h3>Certificate Lifecycle</h3>
<p>Azure Trusted Signing uses <strong>short-lived certificates</strong> (typically 3 days). This freaked me out but they say this is actually a security feature: </p>
<ul>
<li>If a certificate is compromised, it expires quickly 
<li>You never manage certificate files or passwords 
<li>Automatic renewal - you don't have to do anything</li></ul>
<p><strong>But won't my signature break after 3 days?</strong> 
<p>No, it seems that's what <strong>timestamping</strong> is for. When you sign a file: 
<ol>
<li>Azure issues a 3-day certificate 
<li>The file is signed with that certificate 
<li>A timestamp server records "this file was signed on DATE" 
<li>Even after the certificate expires, the signature remains valid because the timestamp proves it was signed when the certificate was valid</li></ol>
<p>That's why both local and GitHub Actions signing include:<pre><code>timestamp-rfc3161: http://timestamp.acs.microsoft.com
</code></pre>
<h3>What the Certificate Contains</h3>
<p>Your signed executable has a certificate with: 
<ul>
<li><strong>Subject</strong>: Your name (e.g., "CN=John Doe, O=John Doe, L=Seattle, S=Washington, C=US") 
<li><strong>Issuer</strong>: Microsoft ID Verified CS EOC CA 01 
<li><strong>Valid Dates</strong>: 3-day window 
<li><strong>Key Size</strong>: 3072-bit RSA (very secure) 
<li><strong>Enhanced Key Usage</strong>: Code Signing</li></ul>
<h3>Verify Certificate on Any Machine</h3><pre><code># Using PowerShell
Get-AuthenticodeSignature "MyApp.exe" | Select-Object -ExpandProperty SignerCertificate | Format-List
# Using Windows UI
# Right-click EXE → Properties → Digital Signatures tab → Details → View Certificate
</code></pre>
<p>This whole thing took me about an hour to 75 minutes. It was detailed, but not deeply difficult. Misspellings, case-sensitivity, and a few account issues with Role-Based Access Control did slow me down. Hope this helps!</p>
<h3>Used Resources</h3>
<ul>
<li><a href="https://learn.microsoft.com/en-us/azure/trusted-signing/">Azure Trusted Signing Documentation</a> 
<li><a href="https://github.com/dotnet/sign">dotnet/sign Tool</a> 
<li><a href="https://github.com/Azure/trusted-signing-action">azure/trusted-signing-action</a> 
<li><a href="https://learn.microsoft.com/en-us/windows/win32/seccrypto/cryptography-tools">Windows Code Signing Best Practices</a> 
<li><a href="https://learn.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-smartscreen/microsoft-defender-smartscreen-overview">SmartScreen Reputation System</a></li></ul>
<p><em>Written in November 2025 based on real-world implementation for WindowsEdgeLight. Your setup might vary slightly depending on Azure region and account type. Things change, be stoic.</em></p><br/><hr/>© 2025 Scott Hanselman. All rights reserved. <br/></div><div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/930373259/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/930373259/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/930373259/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/930373259/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</description><comments>https://feeds.feedblitz.com/~/930373259/0/scotthanselman~Automatically-Signing-a-Windows-EXE-with-Azure-Trusted-Signing-dotnet-sign-and-GitHub-Actions/comments#comments-start</comments><category>Azure</category><category>DotNetCore</category><content:encoded><![CDATA[<div><p><a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Automatically-Signing-a-Windows-EXE-with_D0BE/image_2.png"><img title="WindowsEdgeLight on a Surface" style="float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 0px 5px; display: inline; padding-right: 0px" alt="WindowsEdgeLight on a Surface" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Automatically-Signing-a-Windows-EXE-with_D0BE/image_thumb%5B1%5D.png" width="400" align="right" height="344"></a>Mac Tahoe (in Beta as of the time of this writing) has this new feature called Edge Light that basically puts a bright picture of an Edge Light around your screen and basically uses the power of OLED to give you a virtual ring light. So I was like, why can't we also have nice things? I wrote (<a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.youtube.com/watch?v=WMbHVu4lAGA">vibed, with GitHub Copilot and Claude Sonnet 4.5</a>) a Windows Edge Light App (source code at <a title="https://github.com/shanselman/WindowsEdgeLight" href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/shanselman/WindowsEdgeLight">https://github.com/shanselman/WindowsEdgeLight</a> and you can get the latest release here <a title="https://github.com/shanselman/WindowsEdgeLight/releases" href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/shanselman/WindowsEdgeLight/releases">https://github.com/shanselman/WindowsEdgeLight/releases</a> or the app will check for new releases and autoupdate with Updatum).</p> <p>However, as is with all suss loose executables on the internet, when you run random stuff you'll often get the Window Defender 'new phone, who dis' warning which is scary. After several downloads and no viruses or complaints, my executable will eventually gain reputation with the Windows Defender Smart Screen service, but having a Code Signing Certificate is said to help with that. However, code signing certs are expensive and a hassle to manage and renew.</p> <p>Someone told me that <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://azure.microsoft.com/en-us/products/trusted-signing">Azure Trusted Signing</a> was somewhat less of a hassle - it's less, but it's still non-trivial. I read <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://weblog.west-wind.com/posts/2025/Jul/20/Fighting-through-Setting-up-Microsoft-Trusted-Signing">this post from Rick (his blog is gold and has been for years) earlier in the year</a> and some of it was super useful and other stuff has been made simpler over time.</p> <p>I wrote 80% of this blog post, but since I just spent an hour getting code signing to work and GitHub Copilot was going through and logging everything I did, I did use Claude 4.5 to help organize some of this. I have reviewed it all and re-written parts I didn't like, so any mistakes are mine.</p> <p>Azure Trusted Signing is Microsoft's cloud-based code signing service that:</p> <ul> <li><strong>No hardware tokens</strong> - Everything happens in the cloud  <li><strong>Automatic certificate management</strong> - Certificates are issued and renewed automatically  <li><strong>GitHub Actions integration</strong> - Sign during your CI/CD pipeline. I used GH Actions.  <li><strong>Kinda Affortable</strong> - About $10/month for small projects. I would like it if this were $10 a year. This is cheaper than a yearly cert, but it'll add up after a while so I'm always looking for cheaper/easier options.  <li><strong>Trusted by Windows</strong> - Uses the same certificate authority as Microsoft's own apps, so you should get your EXE trusted faster</li></ul> <h2>Prerequisites</h2> <p>Before starting, you'll need:  <ol> <li><strong>Azure subscription</strong>  <li><strong>Azure CLI</strong> - <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://aka.ms/installazurecliwindows">Install from here</a>  <li><strong>Identity validation documents</strong> - Driver's license or passport for individual developers. Note that I'm in the US, so your mileage may vary but I basically set up the account, scanned a QR code, took a picture of my license, then did a selfie, then waited.  <li><strong>Windows PC</strong> - For local signing (optional) but I ended up using the dotnet sign tool. There are  <li><strong>GitHub repository</strong> - For automated signing (optional)</li></ol> <h3>Part 1: Setting Up Azure Trusted Signing</h3> <h4>Step 1: Register the Resource Provider</h4> <p>First, I need to enable the Azure Trusted Signing service in my subscription. This can be done in the Portal, or at the CLI. <pre><code># Login to Azure
az login
# Register the Microsoft.CodeSigning resource provider
az provider register --namespace Microsoft.CodeSigning
# Wait for registration to complete (takes 2-3 minutes)
az provider show --namespace Microsoft.CodeSigning --query "registrationState"
</code></pre>
<p>Wait until the output shows <code>"Registered"</code>. 
<h3>Step 2: Create a Trusted Signing Account</h3>
<p>Now create the actual signing account. You can do this via Azure Portal or CLI. 
<p><strong>Option A: Azure Portal (Easier for first-timers)</strong> 
<ol>
<li>Go to <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://portal.azure.com/">Azure Portal</a> 
<li>Search for "Trusted Signing Accounts" 
<li>Click <strong>Create</strong> 
<li>Fill in: 
<ul>
<li><strong>Subscription</strong>: Your subscription 
<li><strong>Resource Group</strong>: Create new or use existing (e.g., "MyAppSigning") 
<li><strong>Account Name</strong>: A unique name (e.g., "myapp-signing") 
<li><strong>Region</strong>: Choose closest to you (e.g., "West US 2") 
<li><strong>SKU</strong>: Basic (sufficient for most apps)</li></ul>
<li>Click <strong>Review + Create</strong>, then <strong>Create</strong></li></ol>
<p><strong>Option B: Azure CLI (Faster if you are a CLI person or like to drive stick shift)</strong><pre><code># Create a resource group
az group create --name MyAppSigning --location westus2
# Create the Trusted Signing account
az trustedsigning create \
  --resource-group MyAppSigning \
  --account-name myapp-signing \
  --location westus2 \
  --sku-name Basic
</code></pre>
<p><strong>Important</strong>: Note your region endpoint. Common ones are: 
<ul>
<li>East US: <code>https://eus.codesigning.azure.net/</code> 
<li>West US 2: <code>https://wus2.codesigning.azure.net/</code> 
<li>Your specific region: Check in Azure Portal under your account's Overview page</li></ul>
<p>I totally flaked on this and messed around for 10 min before I realized that this URL matters and is specific to your account. Remember this endpoint.</p>
<h3>Step 3: Complete Identity Validation</h3>
<p>This is the most important step. Microsoft needs to verify you're a real person/organization. 
<ol>
<li>In Azure Portal, go to your Trusted Signing Account 
<li>Click <strong>Identity validation</strong> in the left menu 
<li>Click <strong>Add identity validation</strong> 
<li>Choose validation type: 
<ul>
<li><strong>Individual</strong>: For solo developers (uses driver's license/passport) 
<li><strong>Organization</strong>: For companies (uses business registration documents)</li></ul>
<li>For <strong>Individual validation</strong>: 
<ul>
<li>Upload a clear photo of your government-issued ID 
<li>Provide your full legal name (must match ID exactly) 
<li>Provide your email address</li></ul>
<li>Submit and wait for approval</li></ol>
<p><strong>Approval Time</strong>: 
<ul>
<li>Individual: Usually 1-3 business days 
<li>Organization: 3-5 business days 
<li>Me: This took about 4 hours, so again, YMMV. I used my personal account and my personal Azure (don't trust MSFT folks with unlimited Azure credits, I pay for my own) so they didn't know it was me. I went through the regular line, not the Pre-check line LOL.</li></ul>
<p>You'll receive an email when approved. <strong>You cannot sign any code until this is approved.</strong> 
<h3>Step 4: Create a Certificate Profile</h3>
<p>Once your identity is validated, create a certificate profile. This is what actually issues the signing certificates. 
<ol>
<li>In your Trusted Signing Account, click <strong>Certificate profiles</strong> 
<li>Click <strong>Add certificate profile</strong> 
<li>Fill in: 
<ul>
<li><strong>Profile name</strong>: Descriptive name (e.g., "MyAppProfile") 
<li><strong>Profile type</strong>: Choose <strong>Public Trust</strong> (required to prevent SmartScreen) 
<li><strong>Identity validation</strong>: Select your approved identity 
<li><strong>Certificate type</strong>: Code Signing</li></ul>
<li>Click <strong>Add</strong></li></ol>
<p><strong>Important</strong>: Only "Public Trust" profiles prevent SmartScreen warnings. "Private Trust" is for internal apps only. This took me a second to realize also as it's not an intuitive name. 
<h3>Step 5: Verify Your Setup</h3><pre><code># List your Trusted Signing accounts
az trustedsigning show \
  --resource-group MyAppSigning \
  --account-name myapp-signing
# Should show status: "Succeeded"
</code></pre>
<p><strong>Write down these values</strong> - you'll need them later: 
<ul>
<li><strong>Account Name</strong>: <code>myapp-signing</code> 
<li><strong>Certificate Profile Name</strong>: <code>MyAppProfile</code> 
<li><strong>Endpoint URL</strong>: <code>https://wus2.codesigning.azure.net/</code> (or your region) 
<li><strong>Subscription ID</strong>: Found in Azure Portal 
<li><strong>Resource Group</strong>: <code>MyAppSigning</code></li></ul>
<h2>Part 2: Local Code Signing</h2>
<p>Now let's sign an executable on your my machine. You don't NEED to do this, but I wanted to try it locally to avoid a bunch of CI/CD runs, and I wanted to right-click the EXE and see the cert in Properties before I took it all to the cloud. The nice part about this was that I didn't need to mess with any certificates. 
<h3>Step 1: Assign Yourself the Signing Role</h3>
<p>You need permission to actually use the signing service. 
<p><strong>Option A: Azure Portal</strong> 
<ol>
<li>Go to your Trusted Signing Account 
<li>Click <strong>Access control (IAM)</strong> 
<li>Click <strong>Add</strong> → <strong>Add role assignment</strong> 
<li>Search for and select <strong>Trusted Signing Certificate Profile Signer. </strong>This is important. I searched for "code" and found nothing. Search for "Trusted" 
<li>Click <strong>Next</strong> 
<li>Click <strong>Select members</strong> and find your user account 
<li>Click <strong>Select</strong>, then <strong>Review + assign</strong></li></ol>
<p><strong>Option B: Azure CLI</strong><pre><code># Get your user object ID
$userId = az ad signed-in-user show --query id -o tsv
# Assign the role
az role assignment create \
  --role "Trusted Signing Certificate Profile Signer" \
  --assignee-object-id $userId \
  --scope /subscriptions/YOUR_SUBSCRIPTION_ID/resourceGroups/MyAppSigning/providers/Microsoft.CodeSigning/codeSigningAccounts/myapp-signing
</code></pre>
<p>Replace <code>YOUR_SUBSCRIPTION_ID</code> with your actual subscription ID. 
<h3>Step 2: Login with the Correct Scope</h3>
<p>This is crucial - you need to login with the specific codesigning scope.<pre><code># Logout first to clear old tokens
az logout
# Login with codesigning scope
az login --use-device-code --scope "https://codesigning.azure.net/.default"
</code></pre>
<p>This will give you a code to enter at <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://microsoft.com/devicelogin">https://microsoft.com/devicelogin</a>. Follow the prompts. 
<p><strong>Why device code flow?</strong> Because Azure CLI's default authentication can conflict with Visual Studio credentials in my experience. Device code flow is more reliable for code signing. 
<h3>Step 3: Download the Sign Tool</h3>
<p><strong>Option A: Install Globally (Recommended for regular use)</strong><pre><code># Install as a global tool (available everywhere)
dotnet tool install --global --prerelease sign
# Verify installation
sign --version
</code></pre>
<p><strong>Option B: Install Locally (Project-specific)</strong><pre><code># Install to current directory
dotnet tool install --tool-path . --prerelease sign
# Use with .\sign.exe
</code></pre>
<p><strong>Which should I use?</strong> 
<ul>
<li><strong>Global</strong>: If you'll sign multiple projects or sign frequently 
<li><strong>Local</strong>: If you want to keep the tool with a specific project or don't want it in your PATH</li></ul>
<h3>Step 4: Sign Your Executable</h3>
<p>Note again that code signing URL is specific to you. The tscp is your Trusted Signing Certificate Profile name and the tsa is your Trusted Signing Account name. I set *.exe to sign all the EXEs in the folder and note that the -b base directory is an absolute path, not a relative one. For me it was d:\github\WindowsEdgeLight\publish, and your mileage will vary.</p><pre><code># Navigate to your project folder
cd C:\MyProject
# Sign the executable
.\sign.exe code trusted-signing `
  -b "C:\MyProject\publish" `
  -tse "https://wus2.codesigning.azure.net" `
  -tscp "MyAppProfile" `
  -tsa "myapp-signing" `
  *.exe `
  -v Information
</code></pre>
<p><strong>Parameters explained:</strong> 
<ul>
<li><code>-b</code>: Base directory containing files to sign 
<li><code>-tse</code>: Trusted Signing endpoint (your region) 
<li><code>-tscp</code>: Certificate profile name 
<li><code>-tsa</code>: Trusted Signing account name 
<li><code>*.exe</code>: Pattern to match files to sign 
<li><code>-v</code>: Verbosity level (Trace, Information, Warning, Error)</li></ul>
<p><strong>Expected output:</strong><pre><code>info: Signing WindowsEdgeLight.exe succeeded.
Completed in 2743 ms.
</code></pre>
<h3>Step 5: Verify the Signature</h3>
<p>You can do this in PowerShell:</p><pre><code># Check the signature
Get-AuthenticodeSignature ".\publish\MyApp.exe" | Format-List
# Look for:
# Status: Valid
# SignerCertificate: CN=Your Name, O=Your Name, ...
# TimeStamperCertificate: Should be present
</code></pre>
<p><strong>Right-click the EXE</strong> → <strong>Properties</strong> → <strong>Digital Signatures</strong> tab: 
<ul>
<li>You should see your signature 
<li>"This digital signature is OK"</li></ul>
<h3>Common Local Signing Issues</h3>
<p>I hit all of these lol</p>
<p><strong>Issue: "Please run 'az login' to set up account"</strong> 
<ul>
<li><strong>Cause</strong>: Not logged in with the right scope 
<li><strong>Fix</strong>: Run <code>az logout</code> then <code>az login --use-device-code --scope "https://codesigning.azure.net/.default"</code></li></ul>
<p><strong>Issue: "403 Forbidden"</strong> 
<ul>
<li><strong>Cause</strong>: Wrong endpoint, account name, or missing permissions 
<li><strong>Fix</strong>: 
<ul>
<li>Verify endpoint matches your region (wus2, eus, etc.) 
<li>Verify account name is exact (case-sensitive) 
<li>Verify you have "Trusted Signing Certificate Profile Signer" role</li></ul></li></ul>
<p><strong>Issue: "User account does not exist in tenant"</strong> 
<ul>
<li><strong>Cause</strong>: Azure CLI trying to use Visual Studio credentials 
<li><strong>Fix</strong>: Use device code flow (see Step 2)</li></ul>
<h2>Part 3: Automated Signing with GitHub Actions</h2>
<p>This is where the magic happens. I want to automatically sign every release. I'm using GitVersion so I just need to tag a commit and GitHub Actions will kick off a run. You can go look at a real run in detail at <a title="https://github.com/shanselman/WindowsEdgeLight/actions/runs/19775054123" href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/shanselman/WindowsEdgeLight/actions/runs/19775054123">https://github.com/shanselman/WindowsEdgeLight/actions/runs/19775054123</a>
<h3>Step 1: Create a Service Principal</h3>
<p>GitHub Actions needs its own identity to sign code. We'll create a service principal (like a robot account). This is VERY different than your local signing setup.
<p><strong>Important</strong>: You need <strong>Owner</strong> or <strong>User Access Administrator</strong> role on your subscription to do this. If you don't have it, ask your Azure admin or a friend.<pre><code># Create service principal with signing permissions
az ad sp create-for-rbac \
  --name "MyAppGitHubActions" \
  --role "Trusted Signing Certificate Profile Signer" \
  --scopes /subscriptions/YOUR_SUBSCRIPTION_ID/resourceGroups/MyAppSigning/providers/Microsoft.CodeSigning/codeSigningAccounts/myapp-signing \
  --json-auth
</code></pre>
<p>This outputs JSON like this:<pre><code>{
  "clientId": "12345678-1234-1234-1234-123456789abc",
  "clientSecret": "super-secret-value-abc123",
  "tenantId": "87654321-4321-4321-4321-cba987654321",
  "subscriptionId": "abcdef12-3456-7890-abcd-ef1234567890"
}
</code></pre>
<p><strong>SAVE THESE VALUES IMMEDIATELY!</strong> You can't retrieve the <code>clientSecret</code> again. This is super important.
<p><strong>Alternative: Azure Portal Method</strong> 
<p>If CLI doesn't work: 
<ol>
<li><strong>Azure Portal</strong> → <strong>App registrations</strong> → <strong>New registration</strong> 
<li>Name: "MyAppGitHubActions" 
<li>Click <strong>Register</strong> 
<li><strong>Copy the Application (client) ID</strong> - this is <code>AZURE_CLIENT_ID</code> 
<li><strong>Copy the Directory (tenant) ID</strong> - this is <code>AZURE_TENANT_ID</code> 
<li>Go to <strong>Certificates &amp; secrets</strong> → <strong>New client secret</strong> 
<li>Description: "GitHub Actions" 
<li>Expiration: 24 months (max) 
<li>Click <strong>Add</strong> and <strong>immediately copy the Value</strong> - this is <code>AZURE_CLIENT_SECRET</code> 
<li>Go to your Trusted Signing Account → <strong>Access control (IAM)</strong> 
<li><strong>Add role assignment</strong> → <strong>Trusted Signing Certificate Profile Signer</strong> 
<li><strong>Select members</strong> → Search for "MyAppGitHubActions" 
<li><strong>Review + assign</strong></li></ol>
<h3>Step 2: Add GitHub Secrets</h3>
<p>Go to your GitHub repository: 
<ol>
<li><strong>Settings</strong> → <strong>Secrets and variables</strong> → <strong>Actions</strong> 
<li>Click <strong>New repository secret</strong> for each:</li></ol>
<ul>
<li><code>AZURE_CLIENT_ID </code>- From service principal output or App registration </li>
<li><code>AZURE_CLIENT_SECRET <font face="Calibri">- </font></code>From service principal output or Certificates &amp; secrets </li>
<li><code>AZURE_TENANT_ID </code>- From service principal output or App registration </li>
<li><code>AZURE_SUBSCRIPTION_ID </code>- Azure Portal → Subscriptions </li></ul>
<p><strong>Security Note</strong>: These secrets are encrypted and never visible in logs. Only your workflow can access them. You'll never see them again.
<h3>Step 3: Update Your GitHub Workflow</h3>
<p>This is a little confusing as it's YAML, which is Satan's markup, but it's what we have sunk to as a society. 
<p>Note the dotnet-version below. Yours might be 8 or 9, etc. Also, I am building both x64 and ARM versions and I am using GitVersion so if you want a more complete build.yml, you can go here <a title="https://github.com/shanselman/WindowsEdgeLight/blob/master/.github/workflows/build.yml" href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/shanselman/WindowsEdgeLight/blob/master/.github/workflows/build.yml">https://github.com/shanselman/WindowsEdgeLight/blob/master/.github/workflows/build.yml</a> I am also zipping mine up and prepping my releases so my loose EXE lives in a ZIP file.
<p>Add signing steps to your <code>.github/workflows/build.yml</code>:<pre><code>name: Build and Sign
on:
  push:
    tags:
      - 'v*'
  workflow_dispatch:
permissions:
  contents: write
jobs:
  build:
    runs-on: windows-latest
    
    steps:
    - name: Checkout code
      uses: actions/checkout@v4
      with:
        fetch-depth: 0
      
    - name: Setup .NET
      uses: actions/setup-dotnet@v4
      with:
        dotnet-version: '10.0.x'
        
    - name: Restore dependencies
      run: dotnet restore MyApp/MyApp.csproj
    - name: Build
      run: |
        dotnet publish MyApp/MyApp.csproj `
          -c Release `
          -r win-x64 `
          --self-contained
    # === SIGNING STEPS START HERE ===
    
    - name: Azure Login
      uses: azure/login@v2
      with:
        creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'
    - name: Sign executables with Trusted Signing
      uses: azure/trusted-signing-action@v0
      with:
        azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
        azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
        azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
        endpoint: https://wus2.codesigning.azure.net/
        trusted-signing-account-name: myapp-signing
        certificate-profile-name: MyAppProfile
        files-folder: ${{ github.workspace }}\MyApp\bin\Release\net10.0-windows\win-x64\publish
        files-folder-filter: exe
        files-folder-recurse: true
        file-digest: SHA256
        timestamp-rfc3161: http://timestamp.acs.microsoft.com
        timestamp-digest: SHA256
    
    # === SIGNING STEPS END HERE ===
        
    - name: Create Release
      if: startsWith(github.ref, 'refs/tags/')
      uses: softprops/action-gh-release@v2
      with:
        files: MyApp/bin/Release/net10.0-windows/win-x64/publish/MyApp.exe
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
</code></pre>
<p><strong>Key points:</strong> 
<ul>
<li><code>endpoint</code>: Use YOUR region's endpoint (wus2, eus, etc.) 
<li><code>trusted-signing-account-name</code>: Your account name (exact, case-sensitive) 
<li><code>certificate-profile-name</code>: Your certificate profile name (exact, case-sensitive) 
<li><code>files-folder</code>: Path to your compiled executables 
<li><code>files-folder-filter</code>: File types to sign (exe, dll, etc.) 
<li><code>files-folder-recurse</code>: Sign files in subfolders</li></ul>
<h3>Step 4: Test the Workflow</h3>
<p>Now trigger the workflow. You have two options:</p>
<p><strong>Option A: Manual Trigger (Safest for testing)</strong>
<p>Since the workflow includes <code>workflow_dispatch:</code>, you can trigger it manually without creating a tag:<pre><code># Trigger manually via GitHub CLI
gh workflow run build.yml
# Or go to GitHub web UI:
# Actions tab → "Build and Sign" workflow → "Run workflow" button
</code></pre>
<p>This is ideal for testing because:
<ul>
<li>No tag required 
<li>Won't create a release 
<li>Can test multiple times 
<li>Easy to debug issues</li></ul>
<p><strong>Option B: Create a Tag (For actual releases)</strong><pre><code># Make sure you're on your main branch with no uncommitted changes
git status
# Create and push a tag
git tag v1.0.0
git push origin v1.0.0
</code></pre>
<p>Use this when you're ready to create an actual release with signed binaries. This is what I am doing on my side.
<h3>Step 5: Monitor the Build</h3>
<p>Watch the progress with GitHub CLI:<pre><code># See latest runs
gh run list --limit 5
# Watch a specific run
gh run watch
# View detailed status
gh run view --log
</code></pre>
<p>Or visit: <code>https://github.com/YOUR_USERNAME/YOUR_REPO/actions</code> 
<p><strong>Look for:</strong> 
<ul>
<li>Azure Login - Should complete in ~5 seconds 
<li>Sign executables with Trusted Signing - Should complete in ~10-30 seconds 
<li>Create Release - Your signed executable is now available in /releases in your GitHib project</li></ul>
<h3>Common GitHub Actions Issues</h3>
<p>I hit a few of these, natch.</p>
<p><strong>Issue: "403 Forbidden" during signing</strong> 
<ul>
<li><strong>Cause</strong>: Service principal doesn't have permissions 
<li><strong>Fix</strong>: 
<ol>
<li>Go to Azure Portal → Trusted Signing Account → Access control (IAM) 
<li>Verify "MyAppGitHubActions" has "Trusted Signing Certificate Profile Signer" role 
<li>If not, add it manually</li></ol></li></ul>
<p><strong>Issue: "No files matched the pattern"</strong> 
<ul>
<li><strong>Cause</strong>: Wrong <code>files-folder</code> path or build artifacts in wrong location 
<li><strong>Fix</strong>: 
<ol>
<li>Add a debug step before signing: <code>- run: Get-ChildItem -Recurse</code> 
<li>Find where your EXE is actually located 
<li>Update <code>files-folder</code> to match</li></ol></li></ul>
<p><strong>Issue: Secrets not working</strong> 
<ul>
<li><strong>Cause</strong>: Typo in secret name or value not saved 
<li><strong>Fix</strong>: 
<ol>
<li>Verify secret names EXACTLY match (case-sensitive) 
<li>Re-create secrets if unsure 
<li>Make sure no extra spaces in values</li></ol></li></ul>
<p><strong>Issue: "DefaultAzureCredential authentication failed"</strong> 
<ul>
<li><strong>Cause</strong>: Usually wrong tenant ID or client ID 
<li><strong>Fix</strong>: Verify all 4 secrets are correct from service principal output</li></ul>
<h2>Part 4: Understanding the Certificate</h2>
<h3>Certificate Lifecycle</h3>
<p>Azure Trusted Signing uses <strong>short-lived certificates</strong> (typically 3 days). This freaked me out but they say this is actually a security feature: </p>
<ul>
<li>If a certificate is compromised, it expires quickly 
<li>You never manage certificate files or passwords 
<li>Automatic renewal - you don't have to do anything</li></ul>
<p><strong>But won't my signature break after 3 days?</strong> 
<p>No, it seems that's what <strong>timestamping</strong> is for. When you sign a file: 
<ol>
<li>Azure issues a 3-day certificate 
<li>The file is signed with that certificate 
<li>A timestamp server records "this file was signed on DATE" 
<li>Even after the certificate expires, the signature remains valid because the timestamp proves it was signed when the certificate was valid</li></ol>
<p>That's why both local and GitHub Actions signing include:<pre><code>timestamp-rfc3161: http://timestamp.acs.microsoft.com
</code></pre>
<h3>What the Certificate Contains</h3>
<p>Your signed executable has a certificate with: 
<ul>
<li><strong>Subject</strong>: Your name (e.g., "CN=John Doe, O=John Doe, L=Seattle, S=Washington, C=US") 
<li><strong>Issuer</strong>: Microsoft ID Verified CS EOC CA 01 
<li><strong>Valid Dates</strong>: 3-day window 
<li><strong>Key Size</strong>: 3072-bit RSA (very secure) 
<li><strong>Enhanced Key Usage</strong>: Code Signing</li></ul>
<h3>Verify Certificate on Any Machine</h3><pre><code># Using PowerShell
Get-AuthenticodeSignature "MyApp.exe" | Select-Object -ExpandProperty SignerCertificate | Format-List
# Using Windows UI
# Right-click EXE → Properties → Digital Signatures tab → Details → View Certificate
</code></pre>
<p>This whole thing took me about an hour to 75 minutes. It was detailed, but not deeply difficult. Misspellings, case-sensitivity, and a few account issues with Role-Based Access Control did slow me down. Hope this helps!</p>
<h3>Used Resources</h3>
<ul>
<li><a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://learn.microsoft.com/en-us/azure/trusted-signing/">Azure Trusted Signing Documentation</a> 
<li><a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/dotnet/sign">dotnet/sign Tool</a> 
<li><a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/Azure/trusted-signing-action">azure/trusted-signing-action</a> 
<li><a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://learn.microsoft.com/en-us/windows/win32/seccrypto/cryptography-tools">Windows Code Signing Best Practices</a> 
<li><a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://learn.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-smartscreen/microsoft-defender-smartscreen-overview">SmartScreen Reputation System</a></li></ul>
<p><em>Written in November 2025 based on real-world implementation for WindowsEdgeLight. Your setup might vary slightly depending on Azure region and account type. Things change, be stoic.</em></p>
<br/><hr/>© 2025 Scott Hanselman. All rights reserved. 
<br/></div><Img align="left" border="0" height="1" width="1" alt="" style="border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;" hspace="0" src="https://feeds.feedblitz.com/~/i/930373259/0/scotthanselman">
<div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/930373259/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/930373259/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/930373259/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/930373259/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</content:encoded></item>
<item>
<feedburner:origLink>https://www.hanselman.com/blog/webcam-randomly-pausing-in-obs-discord-and-websites-lsvcam-and-tiktok-studio</feedburner:origLink><trackback:ping>https://www.hanselman.com/blog/feed/trackback/03c0598d-681d-4fad-914b-83c801a54801</trackback:ping><pingback:server>https://www.hanselman.com/blog/feed/pingback</pingback:server><pingback:target>https://www.hanselman.com/blog/post/03c0598d-681d-4fad-914b-83c801a54801</pingback:target><dc:creator>Scott Hanselman</dc:creator><wfw:comment>https://feeds.feedblitz.com/~/905963465/0/scotthanselman~Webcam-randomly-pausing-in-OBS-Discord-and-websites-LSVCam-and-TikTok-Studio/comments#comments-start</wfw:comment><wfw:commentRss>https://www.hanselman.com/blog/feed/rss/comments/03c0598d-681d-4fad-914b-83c801a54801</wfw:commentRss><slash:comments>5</slash:comments><title>Webcam randomly pausing in OBS, Discord, and websites - LSVCam and TikTok Studio</title><guid isPermaLink="false">https://www.hanselman.com/blog/post/03c0598d-681d-4fad-914b-83c801a54801</guid><link>https://feeds.feedblitz.com/~/905963465/0/scotthanselman~Webcam-randomly-pausing-in-OBS-Discord-and-websites-LSVCam-and-TikTok-Studio</link><pubDate>Wed, 09 Oct 2024 19:32:28 GMT</pubDate><description><![CDATA[<div><p>I use my webcam constantly for streaming and I'm pretty familiar with all the internals and how the camera model on Windows works. I also use OBS extensively, so I regularly use the OBS virtual camera and flow everything through Open Broadcasting Studio. </p> <p>For my podcast, I use Zencastr which is a web-based app that talks to the webcam via the browser APIs. For YouTubes, I'll use Riverside or StreamYard, also webapps.</p> <p>I've done this reliably for the last several years without any trouble. Yesterday, I started seeing the most weird thing and it was absolutely perplexing and almost destroyed the day. I started seeing regular pauses in my webcam stream but only in two instances. </p> <ul> <li>The webcam would pause for 10-15 seconds every 90 or so seconds when access the Webcam in a browser</li> <li>I would see a long pause/hang in OBS when double clicking on my Video Source (Webcam) to view its properties</li></ul> <p>Micah initially said USB but my usb bus and hubs have worked reliably for years. Thought something might have changed in my El Gato capture device, but that has also been rock solid for 1/2 a decade. Then I started exploring virtual cameras and looked in the windows camera dialog under settings for a list of all virtual cameras. </p> <p>Interestingly, <em>virtual </em>cameras don't get listed under Cameras in Settings in Windows:</p> <p><a href="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/730f6664b802_E062/image_2.png"><img title="List of Cameras in Windows" style="padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px" alt="List of Cameras in Windows" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/730f6664b802_E062/image_thumb.png" width="640" height="364"></a></p> <p>From what I can tell, there's no user interface to list out all of your cameras - virtual or otherwise - in windows. </p> <p>Here's a quick PowerShell script you can run to list out anything 'connected' that also includes the string "cam" in your local devices</p><pre class="brush: ps; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">Get-CimInstance -Namespace root\cimv2 -ClassName Win32_PnPEntity |<br>     Where-Object { $_.Name -match 'Cam' } |<br>     Select-Object Name, Manufacturer, PNPDeviceID
</pre>
<p>and my output</p><pre>Name                                     Manufacturer        PNPDeviceID<br>----                                     ------------        -----------<br>Cam Link 4K                              Microsoft           USB\VID_0FD9&amp;PID_0066&amp;MI_00\7&amp;3768531A&amp;0&amp;0000<br>Digital Audio Interface (2- Cam Link 4K) Microsoft           SWD\MMDEVAPI\{0.0.1.00000000}.{AF1690B6-CA2A-4AD3-AAFD-8DDEBB83DD4A}<br>Logitech StreamCam WinUSB                Logitech            USB\VID_046D&amp;PID_0893&amp;MI_04\7&amp;E36D0CF&amp;0&amp;0004<br>Logitech StreamCam                       (Generic USB Audio) USB\VID_046D&amp;PID_0893&amp;MI_02\7&amp;E36D0CF&amp;0&amp;0002<br>Logitech StreamCam                       Logitech            USB\VID_046D&amp;PID_0893&amp;MI_00\7&amp;E36D0CF&amp;0&amp;0000<br>Remote Desktop Camera Bus                Microsoft           UMB\UMB\1&amp;841921D&amp;0&amp;RDCAMERA_BUS<br>Cam Link 4K                              (Generic USB Audio) USB\VID_0FD9&amp;PID_0066&amp;MI_03\7&amp;3768531A&amp;0&amp;0003<br>Windows Virtual Camera Device            Microsoft           SWD\VCAMDEVAPI\B486E21F1D4BC97087EA831093E840AD2177E046699EFBF62B27304F5CCAEF57</pre>
<p>However, when I list out my cameras using JavaScript enumerateDevices() like this<br><pre class="brush: js; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">// Put variables in global scope to make them available to the browser console.<br>async function listWebcams() {<br>  try {<br>    const devices = await navigator.mediaDevices.enumerateDevices();<br>    const webcams = devices.filter(device =&gt; device.kind === 'videoinput');<br><br>    if (webcams.length &gt; 0) {<br>      console.log("Connected webcams:");<br>      webcams.forEach((webcam, index) =&gt; {<br>        console.log(`${index + 1}. ${webcam.label || `Camera ${index + 1}`}`);<br>      });<br>    } else {<br>      console.log("No webcams found.");<br>    }<br>  } catch (error) {<br>    console.error("Error accessing media devices:", error);<br>  }<br>}<br>listWebcams();</pre></p>
<p>I would get:</p><pre>Connected webcams:
test.html:11 1. Logitech StreamCam (046d:0893)
test.html:11 2. OBS Virtual Camera (Windows Virtual Camera)
test.html:11 3. Cam Link 4K (0fd9:0066)
test.html:11 4. LSVCam
test.html:11 5. OBS Virtual Camera</pre>
<p>So, what, what's LSVCam? And depending on how I'd call it I'd get the pause and </p><pre>getUserMedia error: NotReadableError NotReadableError: Could not start video source</pre>
<p>Some apps could see this <strong>LSVCam</strong> and others couldn't. OBS really dislikes it, browsers really dislike it and it seemed to HANG on enumeration of cameras. Why can parts of Windows see this camera and others can't?</p>
<p>I don't know. Do you?</p>
<p>Regardless, it turns that it appears once in my registry, here (this is a dump of the key, you just care about the Registry PATH)</p><pre>Windows Registry Editor Version 5.00<br><br>[HKEY_CLASSES_ROOT\CLSID\{860BB310-5D01-11d0-BD3B-00A0C911CE86}\Instance\LSVCam]<br>"FriendlyName"="LSVCam"<br>"CLSID"="{BA80C4AD-8AED-4A61-B434-481D46216E45}"<br>"FilterData"=hex:02,00,00,00,00,00,20,00,01,00,00,00,00,00,00,00,30,70,69,33,\<br>  08,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,30,74,79,33,00,\<br>  00,00,00,38,00,00,00,48,00,00,00,76,69,64,73,00,00,10,00,80,00,00,aa,00,38,\<br>  9b,71,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00</pre>
<p>If you want to get rid of it, delete HKEY_CLASSES_ROOT\CLSID\{860BB310-5D01-11d0-BD3B-00A0C911CE86}\Instance\LSVCam</p>
<p><strong>WARNING: </strong>DO NOT delete the \Instance, just the LSVCam and below. I am a random person on the internet and you got here by googling, so if you mess up your machine by going into RegEdit.exe, I'm sorry to this man, but it's above me now.</p>
<p>Where did LSVCam.dll come from, you may ask? TikTok Live Studio, baby. Live Studio Video/Virtual Cam, I am guessing.</p><pre>Directory of C:\Program Files\TikTok LIVE Studio\0.67.2\resources\app\electron\sdk\lib\MediaSDK_V1<br><br>09/18/2024  09:20 PM           218,984 LSVCam.dll<br>               1 File(s)        218,984 bytes</pre>
<p>This is a regression that started recently for me, so it's my opinion that they are installing a virtual camera for their game streaming feature but they are doing it poorly. It's either not completely installed, or hangs on enumeration, but the result is you'll see hangs on camera enumeration in your apps, especually browser apps that poll for cameras changes or check on a timer.</p>
<p>Nothing bad will happen if you delete the registry key BUT it'll show back up when you run TikTok Studio again. I still stream to TikTok, I just delete this key each time until someone on the TikTok Studio development team sees this blog post.</p>
<p>Hope this helps!</p><br/><hr/>© 2025 Scott Hanselman. All rights reserved. <br/></div><div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/905963465/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/905963465/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/905963465/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/905963465/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</description><comments>https://feeds.feedblitz.com/~/905963465/0/scotthanselman~Webcam-randomly-pausing-in-OBS-Discord-and-websites-LSVCam-and-TikTok-Studio/comments#comments-start</comments><category>Bugs</category><content:encoded><![CDATA[<div><p>I use my webcam constantly for streaming and I'm pretty familiar with all the internals and how the camera model on Windows works. I also use OBS extensively, so I regularly use the OBS virtual camera and flow everything through Open Broadcasting Studio. </p> <p>For my podcast, I use Zencastr which is a web-based app that talks to the webcam via the browser APIs. For YouTubes, I'll use Riverside or StreamYard, also webapps.</p> <p>I've done this reliably for the last several years without any trouble. Yesterday, I started seeing the most weird thing and it was absolutely perplexing and almost destroyed the day. I started seeing regular pauses in my webcam stream but only in two instances. </p> <ul> <li>The webcam would pause for 10-15 seconds every 90 or so seconds when access the Webcam in a browser</li> <li>I would see a long pause/hang in OBS when double clicking on my Video Source (Webcam) to view its properties</li></ul> <p>Micah initially said USB but my usb bus and hubs have worked reliably for years. Thought something might have changed in my El Gato capture device, but that has also been rock solid for 1/2 a decade. Then I started exploring virtual cameras and looked in the windows camera dialog under settings for a list of all virtual cameras. </p> <p>Interestingly, <em>virtual </em>cameras don't get listed under Cameras in Settings in Windows:</p> <p><a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/730f6664b802_E062/image_2.png"><img title="List of Cameras in Windows" style="padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px" alt="List of Cameras in Windows" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/730f6664b802_E062/image_thumb.png" width="640" height="364"></a></p> <p>From what I can tell, there's no user interface to list out all of your cameras - virtual or otherwise - in windows. </p> <p>Here's a quick PowerShell script you can run to list out anything 'connected' that also includes the string "cam" in your local devices</p><pre class="brush: ps; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">Get-CimInstance -Namespace root\cimv2 -ClassName Win32_PnPEntity |
<br>     Where-Object { $_.Name -match 'Cam' } |
<br>     Select-Object Name, Manufacturer, PNPDeviceID
</pre>
<p>and my output</p><pre>Name                                     Manufacturer        PNPDeviceID
<br>----                                     ------------        -----------
<br>Cam Link 4K                              Microsoft           USB\VID_0FD9&amp;PID_0066&amp;MI_00\7&amp;3768531A&amp;0&amp;0000
<br>Digital Audio Interface (2- Cam Link 4K) Microsoft           SWD\MMDEVAPI\{0.0.1.00000000}.{AF1690B6-CA2A-4AD3-AAFD-8DDEBB83DD4A}
<br>Logitech StreamCam WinUSB                Logitech            USB\VID_046D&amp;PID_0893&amp;MI_04\7&amp;E36D0CF&amp;0&amp;0004
<br>Logitech StreamCam                       (Generic USB Audio) USB\VID_046D&amp;PID_0893&amp;MI_02\7&amp;E36D0CF&amp;0&amp;0002
<br>Logitech StreamCam                       Logitech            USB\VID_046D&amp;PID_0893&amp;MI_00\7&amp;E36D0CF&amp;0&amp;0000
<br>Remote Desktop Camera Bus                Microsoft           UMB\UMB\1&amp;841921D&amp;0&amp;RDCAMERA_BUS
<br>Cam Link 4K                              (Generic USB Audio) USB\VID_0FD9&amp;PID_0066&amp;MI_03\7&amp;3768531A&amp;0&amp;0003
<br>Windows Virtual Camera Device            Microsoft           SWD\VCAMDEVAPI\B486E21F1D4BC97087EA831093E840AD2177E046699EFBF62B27304F5CCAEF57</pre>
<p>However, when I list out my cameras using JavaScript enumerateDevices() like this
<br><pre class="brush: js; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">// Put variables in global scope to make them available to the browser console.
<br>async function listWebcams() {
<br>  try {
<br>    const devices = await navigator.mediaDevices.enumerateDevices();
<br>    const webcams = devices.filter(device =&gt; device.kind === 'videoinput');
<br>
<br>    if (webcams.length &gt; 0) {
<br>      console.log("Connected webcams:");
<br>      webcams.forEach((webcam, index) =&gt; {
<br>        console.log(`${index + 1}. ${webcam.label || `Camera ${index + 1}`}`);
<br>      });
<br>    } else {
<br>      console.log("No webcams found.");
<br>    }
<br>  } catch (error) {
<br>    console.error("Error accessing media devices:", error);
<br>  }
<br>}
<br>listWebcams();</pre></p>
<p>I would get:</p><pre>Connected webcams:
test.html:11 1. Logitech StreamCam (046d:0893)
test.html:11 2. OBS Virtual Camera (Windows Virtual Camera)
test.html:11 3. Cam Link 4K (0fd9:0066)
test.html:11 4. LSVCam
test.html:11 5. OBS Virtual Camera</pre>
<p>So, what, what's LSVCam? And depending on how I'd call it I'd get the pause and </p><pre>getUserMedia error: NotReadableError NotReadableError: Could not start video source</pre>
<p>Some apps could see this <strong>LSVCam</strong> and others couldn't. OBS really dislikes it, browsers really dislike it and it seemed to HANG on enumeration of cameras. Why can parts of Windows see this camera and others can't?</p>
<p>I don't know. Do you?</p>
<p>Regardless, it turns that it appears once in my registry, here (this is a dump of the key, you just care about the Registry PATH)</p><pre>Windows Registry Editor Version 5.00
<br>
<br>[HKEY_CLASSES_ROOT\CLSID\{860BB310-5D01-11d0-BD3B-00A0C911CE86}\Instance\LSVCam]
<br>"FriendlyName"="LSVCam"
<br>"CLSID"="{BA80C4AD-8AED-4A61-B434-481D46216E45}"
<br>"FilterData"=hex:02,00,00,00,00,00,20,00,01,00,00,00,00,00,00,00,30,70,69,33,\
<br>  08,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,30,74,79,33,00,\
<br>  00,00,00,38,00,00,00,48,00,00,00,76,69,64,73,00,00,10,00,80,00,00,aa,00,38,\
<br>  9b,71,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00</pre>
<p>If you want to get rid of it, delete HKEY_CLASSES_ROOT\CLSID\{860BB310-5D01-11d0-BD3B-00A0C911CE86}\Instance\LSVCam</p>
<p><strong>WARNING: </strong>DO NOT delete the \Instance, just the LSVCam and below. I am a random person on the internet and you got here by googling, so if you mess up your machine by going into RegEdit.exe, I'm sorry to this man, but it's above me now.</p>
<p>Where did LSVCam.dll come from, you may ask? TikTok Live Studio, baby. Live Studio Video/Virtual Cam, I am guessing.</p><pre>Directory of C:\Program Files\TikTok LIVE Studio\0.67.2\resources\app\electron\sdk\lib\MediaSDK_V1
<br>
<br>09/18/2024  09:20 PM           218,984 LSVCam.dll
<br>               1 File(s)        218,984 bytes</pre>
<p>This is a regression that started recently for me, so it's my opinion that they are installing a virtual camera for their game streaming feature but they are doing it poorly. It's either not completely installed, or hangs on enumeration, but the result is you'll see hangs on camera enumeration in your apps, especually browser apps that poll for cameras changes or check on a timer.</p>
<p>Nothing bad will happen if you delete the registry key BUT it'll show back up when you run TikTok Studio again. I still stream to TikTok, I just delete this key each time until someone on the TikTok Studio development team sees this blog post.</p>
<p>Hope this helps!</p>
<br/><hr/>© 2025 Scott Hanselman. All rights reserved. 
<br/></div><Img align="left" border="0" height="1" width="1" alt="" style="border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;" hspace="0" src="https://feeds.feedblitz.com/~/i/905963465/0/scotthanselman">
<div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/905963465/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/905963465/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/905963465/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/905963465/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</content:encoded></item>
<item>
<feedburner:origLink>https://www.hanselman.com/blog/open-sourcing-dos-4</feedburner:origLink><trackback:ping>https://www.hanselman.com/blog/feed/trackback/ed4f5c94-07d3-465c-96f1-776ba41b0099</trackback:ping><pingback:server>https://www.hanselman.com/blog/feed/pingback</pingback:server><pingback:target>https://www.hanselman.com/blog/post/ed4f5c94-07d3-465c-96f1-776ba41b0099</pingback:target><dc:creator>Scott Hanselman</dc:creator><wfw:comment>https://feeds.feedblitz.com/~/882544025/0/scotthanselman~Open-Sourcing-DOS/comments#comments-start</wfw:comment><wfw:commentRss>https://www.hanselman.com/blog/feed/rss/comments/ed4f5c94-07d3-465c-96f1-776ba41b0099</wfw:commentRss><slash:comments>19</slash:comments><title>Open Sourcing DOS 4</title><guid isPermaLink="false">https://www.hanselman.com/blog/post/ed4f5c94-07d3-465c-96f1-776ba41b0099</guid><link>https://feeds.feedblitz.com/~/882544025/0/scotthanselman~Open-Sourcing-DOS</link><pubDate>Thu, 25 Apr 2024 16:46:13 GMT</pubDate><description><![CDATA[<div><p><img title="Beta DOS Disks" style="float: right; margin: 0px 0px 0px 4px; display: inline" alt="Beta DOS Disks" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Open-Sourcing-DOS-4_E712/clip_image002_5b6e1c02-95d8-4ee1-87af-ca53a8b0bd56.png" width="500" align="right" height="342"><em>See <a href="https://cloudblogs.microsoft.com/opensource/2024/04/25/open-sourcing-ms-dos-4-0/">the canonical version of this blog post at the Microsoft Open Source Blog</a>!</em>  <p>Ten years ago, <a href="https://devblogs.microsoft.com/commandline/re-open-sourcing-ms-dos-1-25-and-2-0/">Microsoft released the source for MS-DOS 1.25 and 2.0</a> to the Computer History Museum, and then <a href="https://github.com/microsoft/MS-DOS">later republished them</a> for reference purposes. This code holds an important place in history and is a fascinating read of an operating system that was written entirely in 8086 assembly code nearly 45 years ago. </p> <p>Today, in partnership with IBM and in the spirit of open innovation, we're releasing the source code to MS-DOS 4.00 under the MIT license. There's a somewhat complex and fascinating history behind the 4.0 versions of DOS, as Microsoft partnered with IBM for portions of the code but also created a branch of DOS called Multitasking DOS that did not see a wide release. </p> <p><a title="https://github.com/microsoft/MS-DOS?WT.mc_id=-blog-scottha" href="https://github.com/microsoft/MS-DOS?WT.mc_id=-blog-scottha"><strong>https://github.com/microsoft/MS-DOS</strong></a></p> <p>A young English researcher named <a href="https://starfrost.net/blog/001-mdos4-part-1/">Connor "Starfrost" Hyde</a> recently corresponded with former Microsoft Chief Technical Officer Ray Ozzie about some of the software in his collection. Amongst the floppies, Ray found unreleased beta binaries of DOS 4.0 that he was sent while he was at Lotus. Starfrost reached out to the Microsoft Open Source Programs Office (OSPO) to explore releasing DOS 4 source, as he is working on documenting the relationship between DOS 4, MT-DOS, and what would eventually become OS/2. Some later versions of these Multitasking DOS binaries can be found around the internet, but these new Ozzie beta binaries appear to be much earlier, unreleased, and also include the ibmbio.com source.&nbsp; </p> <p>Scott Hanselman, with the help of internet archivist and enthusiast Jeff Sponaugle, has imaged these original disks and carefully scanned the original printed documents from this "Ozzie Drop". Microsoft, along with our friends at IBM, think this is a fascinating piece of operating system history worth sharing.&nbsp; </p> <p>Jeff Wilcox and OSPO went to the Microsoft Archives, and while they were unable to find the full source code for MT-DOS, they did find MS DOS 4.00, which we're releasing today, alongside these additional beta binaries, PDFs of the documentation, and disk images. We will continue to explore the archives and may update this release if more is discovered.&nbsp; </p> <p>Thank you to Ray Ozzie, Starfrost, Jeff Sponaugle, Larry Osterman, our friends at the IBM OSPO, as well as the makers of such digital archeology software including, but not limited to Greaseweazle, Fluxengine, Aaru Data Preservation Suite, and the HxC Floppy Emulator. Above all, thank you to the original authors of this code, some of whom still work at Microsoft and IBM today! </p> <p>If you'd like to run this software yourself and explore, we have successfully run it directly on an original IBM PC XT, a newer Pentium, and within the open source PCem and 86box emulators.&nbsp; </p><br/><hr/>© 2025 Scott Hanselman. All rights reserved. <br/></div><div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/882544025/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/882544025/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/882544025/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/882544025/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</description><comments>https://feeds.feedblitz.com/~/882544025/0/scotthanselman~Open-Sourcing-DOS/comments#comments-start</comments><category>Open Source</category><content:encoded><![CDATA[<div><p><img title="Beta DOS Disks" style="float: right; margin: 0px 0px 0px 4px; display: inline" alt="Beta DOS Disks" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Open-Sourcing-DOS-4_E712/clip_image002_5b6e1c02-95d8-4ee1-87af-ca53a8b0bd56.png" width="500" align="right" height="342"><em>See <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://cloudblogs.microsoft.com/opensource/2024/04/25/open-sourcing-ms-dos-4-0/">the canonical version of this blog post at the Microsoft Open Source Blog</a>!</em>  <p>Ten years ago, <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://devblogs.microsoft.com/commandline/re-open-sourcing-ms-dos-1-25-and-2-0/">Microsoft released the source for MS-DOS 1.25 and 2.0</a> to the Computer History Museum, and then <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/microsoft/MS-DOS">later republished them</a> for reference purposes. This code holds an important place in history and is a fascinating read of an operating system that was written entirely in 8086 assembly code nearly 45 years ago. </p> <p>Today, in partnership with IBM and in the spirit of open innovation, we're releasing the source code to MS-DOS 4.00 under the MIT license. There's a somewhat complex and fascinating history behind the 4.0 versions of DOS, as Microsoft partnered with IBM for portions of the code but also created a branch of DOS called Multitasking DOS that did not see a wide release. </p> <p><a title="https://github.com/microsoft/MS-DOS?WT.mc_id=-blog-scottha" href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/microsoft/MS-DOS?WT.mc_id=-blog-scottha"><strong>https://github.com/microsoft/MS-DOS</strong></a></p> <p>A young English researcher named <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://starfrost.net/blog/001-mdos4-part-1/">Connor "Starfrost" Hyde</a> recently corresponded with former Microsoft Chief Technical Officer Ray Ozzie about some of the software in his collection. Amongst the floppies, Ray found unreleased beta binaries of DOS 4.0 that he was sent while he was at Lotus. Starfrost reached out to the Microsoft Open Source Programs Office (OSPO) to explore releasing DOS 4 source, as he is working on documenting the relationship between DOS 4, MT-DOS, and what would eventually become OS/2. Some later versions of these Multitasking DOS binaries can be found around the internet, but these new Ozzie beta binaries appear to be much earlier, unreleased, and also include the ibmbio.com source.&nbsp; </p> <p>Scott Hanselman, with the help of internet archivist and enthusiast Jeff Sponaugle, has imaged these original disks and carefully scanned the original printed documents from this "Ozzie Drop". Microsoft, along with our friends at IBM, think this is a fascinating piece of operating system history worth sharing.&nbsp; </p> <p>Jeff Wilcox and OSPO went to the Microsoft Archives, and while they were unable to find the full source code for MT-DOS, they did find MS DOS 4.00, which we're releasing today, alongside these additional beta binaries, PDFs of the documentation, and disk images. We will continue to explore the archives and may update this release if more is discovered.&nbsp; </p> <p>Thank you to Ray Ozzie, Starfrost, Jeff Sponaugle, Larry Osterman, our friends at the IBM OSPO, as well as the makers of such digital archeology software including, but not limited to Greaseweazle, Fluxengine, Aaru Data Preservation Suite, and the HxC Floppy Emulator. Above all, thank you to the original authors of this code, some of whom still work at Microsoft and IBM today! </p> <p>If you'd like to run this software yourself and explore, we have successfully run it directly on an original IBM PC XT, a newer Pentium, and within the open source PCem and 86box emulators.&nbsp; </p>
<br/><hr/>© 2025 Scott Hanselman. All rights reserved. 
<br/></div><Img align="left" border="0" height="1" width="1" alt="" style="border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;" hspace="0" src="https://feeds.feedblitz.com/~/i/882544025/0/scotthanselman">
<div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/882544025/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/882544025/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/882544025/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/882544025/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</content:encoded></item>
<item>
<feedburner:origLink>https://www.hanselman.com/blog/updating-to-net-8-updating-to-ihostbuilder-and-running-playwright-tests-within-nunit-headless-or-headed-on-any-os</feedburner:origLink><trackback:ping>https://www.hanselman.com/blog/feed/trackback/815e0b55-f583-49a5-b01c-bd38197343f9</trackback:ping><pingback:server>https://www.hanselman.com/blog/feed/pingback</pingback:server><pingback:target>https://www.hanselman.com/blog/post/815e0b55-f583-49a5-b01c-bd38197343f9</pingback:target><dc:creator>Scott Hanselman</dc:creator><wfw:comment>https://feeds.feedblitz.com/~/873234002/0/scotthanselman~Updating-to-NET-updating-to-IHostBuilder-and-running-Playwright-Tests-within-NUnit-headless-or-headed-on-any-OS/comments#comments-start</wfw:comment><wfw:commentRss>https://www.hanselman.com/blog/feed/rss/comments/815e0b55-f583-49a5-b01c-bd38197343f9</wfw:commentRss><slash:comments>54</slash:comments><title>Updating to .NET 8, updating to IHostBuilder, and running Playwright Tests within NUnit headless or headed on any OS</title><guid isPermaLink="false">https://www.hanselman.com/blog/post/815e0b55-f583-49a5-b01c-bd38197343f9</guid><link>https://feeds.feedblitz.com/~/873234002/0/scotthanselman~Updating-to-NET-updating-to-IHostBuilder-and-running-Playwright-Tests-within-NUnit-headless-or-headed-on-any-OS</link><pubDate>Thu, 07 Mar 2024 01:12:13 GMT</pubDate><description><![CDATA[<div><p><img title="All the Unit Tests pass" style="float: right; margin: 0px 0px 0px 5px; display: inline" alt="All the Unit Tests pass" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/78fe85887e7e_1244B/image_8b82f0d7-a3bc-4403-96c3-9dd36fc46d1f.png" width="475" align="right" height="437">I've been doing not just Unit Testing for my sites but full on Integration Testing and Browser Automation Testing as early as 2007 with Selenium. Lately, however, I've been using the faster and generally more compatible <a href="https://playwright.dev/">Playwright</a>. It has one API and can test on Windows, Linux, Mac, locally, in a container (headless), in my CI/CD pipeline, on Azure DevOps, or in GitHub Actions. </p> <p>For me, it's that last moment of truth to make sure that the site runs completely from end to end.</p> <p>I can write those Playwright tests in something like TypeScript, and I could launch them with node, but I like running end unit tests and using that test runner and test harness as my jumping off point for my .NET applications. I'm used to right clicking and "run unit tests" or even better, right click and "debug unit tests" in Visual Studio or VS Code. This gets me the benefit of all of the assertions of a full unit testing framework, and all the benefits of using something like Playwright to automate my browser. </p> <p><a href="https://www.hanselman.com/blog/real-browser-integration-testing-with-selenium-standalone-chrome-and-aspnet-core-21">In 2018 I was using WebApplicationFactory</a> and some tricky hacks to basically spin up ASP.NET within .NET (at the time) Core 2.1 within the unit tests and then launching Selenium. This was kind of janky and would require to manually start a separate process and manage its life cycle. However, I kept on with this hack for a number of years basically trying to get the Kestrel Web Server to spin up inside of my unit tests.</p> <p>I've recently upgraded my main site and podcast site to .NET 8. Keep in mind that I've been moving my websites forward from early early versions of .NET to the most recent versions. The blog is happily running on Linux in a container on .NET 8, but its original code started in 2002 on .NET 1.1.</p> <p>Now that I'm on .NET 8, I scandalously discovered (as my unit tests stopped working) <a href="https://learn.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.1&amp;tabs=visual-studio#hostbuilder-replaces-webhostbuilder">that the rest of the world had moved from IWebHostBuilder to IHostBuilder five version of .NET ago</a>. Gulp. Say what you will, but the backward compatibility is impressive. </p> <p>As such my code for Program.cs changed from this</p><pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">public static void Main(string[] args)<br>{<br>    CreateWebHostBuilder(args).Build().Run();<br>}<br><br>public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;<br>    WebHost.CreateDefaultBuilder(args)<br>        .UseStartup&lt;Startup&gt;();<br></pre>
<p>to this:</p><pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">public static void Main(string[] args)<br>{<br>  CreateHostBuilder(args).Build().Run();<br>}<br><br>public static IHostBuilder CreateHostBuilder(string[] args) =&gt;<br>  Host.CreateDefaultBuilder(args).<br>      ConfigureWebHostDefaults(WebHostBuilder =&gt; WebHostBuilder.UseStartup&lt;Startup&gt;());</pre>
<p>Not a major change on the outside but tidies things up on the inside and sets me up with <a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/generic-host?view=aspnetcore-3.1">a more flexible generic host for my web app</a>.</p>
<p>My unit tests stopped working because my Kestral Web Server hack was no longer firing up my server. </p>
<p>Here is an example of my goal from a Playwright perspective within a .NET NUnit test. </p><pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">[Test]<br>public async Task DoesSearchWork()<br>{<br>    await Page.GotoAsync(Url);<br><br>    await Page.Locator("#topbar").GetByRole(AriaRole.Link, new() { Name = "episodes" }).ClickAsync();<br><br>    await Page.GetByPlaceholder("search and filter").ClickAsync();<br><br>    await Page.GetByPlaceholder("search and filter").TypeAsync("wife");<br><br>    const string visibleCards = ".showCard:visible";<br><br>    var waiting = await Page.WaitForSelectorAsync(visibleCards, new PageWaitForSelectorOptions() { Timeout = 500 });<br><br>    await Expect(Page.Locator(visibleCards).First).ToBeVisibleAsync();<br><br>    await Expect(Page.Locator(visibleCards)).ToHaveCountAsync(5);<br>}
</pre>
<p>I love this. Nice and clean. Certainly here we are assuming that we have a URL in that first line, which will be localhost something, and then we assume that our web application has started up on its own. </p>
<p>Here is the setup code that starts my new "web application test builder factory," yeah, the name is stupid but it's descriptive. Note the OneTimeSetUp and the OneTimeTearDown. This starts my web app within the context of my TestHost. Note the :0 makes the app find a port which I then, sadly, have to dig out and put into the Url private for use within my Unit Tests. Note that the &lt;Startup&gt; is in fact my Startup class within Startup.cs which hosts my app's pipeline and Configure and ConfigureServices get setup here so routing all works.</p><pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">private string Url;<br>private WebApplication? _app = null;<br><br>[OneTimeSetUp]<br>public void Setup()<br>{<br>    var builder = WebApplicationTestBuilderFactory.CreateBuilder&lt;Startup&gt;();<br><br>    var startup = new Startup(builder.Environment);<br>    builder.WebHost.ConfigureKestrel(o =&gt; o.Listen(IPAddress.Loopback, 0));<br>    startup.ConfigureServices(builder.Services);<br>    _app = builder.Build();<br><br>    // listen on any local port (hence the 0)<br>    startup.Configure(_app, _app.Configuration);<br>    _app.Start();<br><br>    //you are kidding me<br>    Url = _app.Services.GetRequiredService&lt;IServer&gt;().Features.GetRequiredFeature&lt;IServerAddressesFeature&gt;().Addresses.Last();<br>}<br><br>[OneTimeTearDown]<br>public async Task TearDown()<br>{<br>    await _app.DisposeAsync();<br>}</pre>
<p>So what horrors are buried in WebApplicationTestBuilderFactory? The first bit is bad and we should fix it for .NET 9. The rest is actually every nice, with a hat tip to David Fowler for his help and guidance! This is the magic and the ick in one small helper class.</p><pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">public class WebApplicationTestBuilderFactory <br>{<br>    public static WebApplicationBuilder CreateBuilder&lt;T&gt;() where T : class <br>    {<br>        //This ungodly code requires an unused reference to the MvcTesting package that hooks up<br>        //  MSBuild to create the manifest file that is read here.<br>        var testLocation = Path.Combine(AppContext.BaseDirectory, "MvcTestingAppManifest.json");<br>        var json = JsonObject.Parse(File.ReadAllText(testLocation));<br>        var asmFullName = typeof(T).Assembly.FullName ?? throw new InvalidOperationException("Assembly Full Name is null");<br>        var contentRootPath = json?[asmFullName]?.GetValue&lt;string&gt;();<br><br>        //spin up a real live web application inside TestHost.exe<br>        var builder = WebApplication.CreateBuilder(<br>            new WebApplicationOptions()<br>            {<br>                ContentRootPath = contentRootPath,<br>                ApplicationName = asmFullName<br>            });<br>        return builder;<br>    }<br>}</pre>
<p>The first 4 lines are nasty. Because the test runs in the context of a different directory and my website needs to run within the context of its own content root path, I have to force the content root path to be correct and the only way to do that is by getting the apps base directory from a file generated within MSBuild from the (aging) MvcTesting package. The package is not used, but by referencing it it gets into the build and makes that file that I then use to pull out the directory. </p>
<p>If we can get rid of that "hack" and pull the directory from context elsewhere, then this helper function turns into a single line and .NET 9 gets WAY WAY more testable!</p>
<p>Now I can run my Unit Tests AND Playwright Browser Integration Tests across all OS's, headed or headless, in docker or on the metal. The site is updated to .NET 8 and all is right with my code. Well, it runs at least. ;)</p><br/><hr/>© 2025 Scott Hanselman. All rights reserved. <br/></div><div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/873234002/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/873234002/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/873234002/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/873234002/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</description><comments>https://feeds.feedblitz.com/~/873234002/0/scotthanselman~Updating-to-NET-updating-to-IHostBuilder-and-running-Playwright-Tests-within-NUnit-headless-or-headed-on-any-OS/comments#comments-start</comments><category>ASP.NET</category><category>DotNetCore</category><content:encoded><![CDATA[<div><p><img title="All the Unit Tests pass" style="float: right; margin: 0px 0px 0px 5px; display: inline" alt="All the Unit Tests pass" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/78fe85887e7e_1244B/image_8b82f0d7-a3bc-4403-96c3-9dd36fc46d1f.png" width="475" align="right" height="437">I've been doing not just Unit Testing for my sites but full on Integration Testing and Browser Automation Testing as early as 2007 with Selenium. Lately, however, I've been using the faster and generally more compatible <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://playwright.dev/">Playwright</a>. It has one API and can test on Windows, Linux, Mac, locally, in a container (headless), in my CI/CD pipeline, on Azure DevOps, or in GitHub Actions. </p> <p>For me, it's that last moment of truth to make sure that the site runs completely from end to end.</p> <p>I can write those Playwright tests in something like TypeScript, and I could launch them with node, but I like running end unit tests and using that test runner and test harness as my jumping off point for my .NET applications. I'm used to right clicking and "run unit tests" or even better, right click and "debug unit tests" in Visual Studio or VS Code. This gets me the benefit of all of the assertions of a full unit testing framework, and all the benefits of using something like Playwright to automate my browser. </p> <p><a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.hanselman.com/blog/real-browser-integration-testing-with-selenium-standalone-chrome-and-aspnet-core-21">In 2018 I was using WebApplicationFactory</a> and some tricky hacks to basically spin up ASP.NET within .NET (at the time) Core 2.1 within the unit tests and then launching Selenium. This was kind of janky and would require to manually start a separate process and manage its life cycle. However, I kept on with this hack for a number of years basically trying to get the Kestrel Web Server to spin up inside of my unit tests.</p> <p>I've recently upgraded my main site and podcast site to .NET 8. Keep in mind that I've been moving my websites forward from early early versions of .NET to the most recent versions. The blog is happily running on Linux in a container on .NET 8, but its original code started in 2002 on .NET 1.1.</p> <p>Now that I'm on .NET 8, I scandalously discovered (as my unit tests stopped working) <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://learn.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.1&amp;tabs=visual-studio#hostbuilder-replaces-webhostbuilder">that the rest of the world had moved from IWebHostBuilder to IHostBuilder five version of .NET ago</a>. Gulp. Say what you will, but the backward compatibility is impressive. </p> <p>As such my code for Program.cs changed from this</p><pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">public static void Main(string[] args)
<br>{
<br>    CreateWebHostBuilder(args).Build().Run();
<br>}
<br>
<br>public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
<br>    WebHost.CreateDefaultBuilder(args)
<br>        .UseStartup&lt;Startup&gt;();
<br></pre>
<p>to this:</p><pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">public static void Main(string[] args)
<br>{
<br>  CreateHostBuilder(args).Build().Run();
<br>}
<br>
<br>public static IHostBuilder CreateHostBuilder(string[] args) =&gt;
<br>  Host.CreateDefaultBuilder(args).
<br>      ConfigureWebHostDefaults(WebHostBuilder =&gt; WebHostBuilder.UseStartup&lt;Startup&gt;());</pre>
<p>Not a major change on the outside but tidies things up on the inside and sets me up with <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/generic-host?view=aspnetcore-3.1">a more flexible generic host for my web app</a>.</p>
<p>My unit tests stopped working because my Kestral Web Server hack was no longer firing up my server. </p>
<p>Here is an example of my goal from a Playwright perspective within a .NET NUnit test. </p><pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">[Test]
<br>public async Task DoesSearchWork()
<br>{
<br>    await Page.GotoAsync(Url);
<br>
<br>    await Page.Locator("#topbar").GetByRole(AriaRole.Link, new() { Name = "episodes" }).ClickAsync();
<br>
<br>    await Page.GetByPlaceholder("search and filter").ClickAsync();
<br>
<br>    await Page.GetByPlaceholder("search and filter").TypeAsync("wife");
<br>
<br>    const string visibleCards = ".showCard:visible";
<br>
<br>    var waiting = await Page.WaitForSelectorAsync(visibleCards, new PageWaitForSelectorOptions() { Timeout = 500 });
<br>
<br>    await Expect(Page.Locator(visibleCards).First).ToBeVisibleAsync();
<br>
<br>    await Expect(Page.Locator(visibleCards)).ToHaveCountAsync(5);
<br>}
</pre>
<p>I love this. Nice and clean. Certainly here we are assuming that we have a URL in that first line, which will be localhost something, and then we assume that our web application has started up on its own. </p>
<p>Here is the setup code that starts my new "web application test builder factory," yeah, the name is stupid but it's descriptive. Note the OneTimeSetUp and the OneTimeTearDown. This starts my web app within the context of my TestHost. Note the :0 makes the app find a port which I then, sadly, have to dig out and put into the Url private for use within my Unit Tests. Note that the &lt;Startup&gt; is in fact my Startup class within Startup.cs which hosts my app's pipeline and Configure and ConfigureServices get setup here so routing all works.</p><pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">private string Url;
<br>private WebApplication? _app = null;
<br>
<br>[OneTimeSetUp]
<br>public void Setup()
<br>{
<br>    var builder = WebApplicationTestBuilderFactory.CreateBuilder&lt;Startup&gt;();
<br>
<br>    var startup = new Startup(builder.Environment);
<br>    builder.WebHost.ConfigureKestrel(o =&gt; o.Listen(IPAddress.Loopback, 0));
<br>    startup.ConfigureServices(builder.Services);
<br>    _app = builder.Build();
<br>
<br>    // listen on any local port (hence the 0)
<br>    startup.Configure(_app, _app.Configuration);
<br>    _app.Start();
<br>
<br>    //you are kidding me
<br>    Url = _app.Services.GetRequiredService&lt;IServer&gt;().Features.GetRequiredFeature&lt;IServerAddressesFeature&gt;().Addresses.Last();
<br>}
<br>
<br>[OneTimeTearDown]
<br>public async Task TearDown()
<br>{
<br>    await _app.DisposeAsync();
<br>}</pre>
<p>So what horrors are buried in WebApplicationTestBuilderFactory? The first bit is bad and we should fix it for .NET 9. The rest is actually every nice, with a hat tip to David Fowler for his help and guidance! This is the magic and the ick in one small helper class.</p><pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">public class WebApplicationTestBuilderFactory 
<br>{
<br>    public static WebApplicationBuilder CreateBuilder&lt;T&gt;() where T : class 
<br>    {
<br>        //This ungodly code requires an unused reference to the MvcTesting package that hooks up
<br>        //  MSBuild to create the manifest file that is read here.
<br>        var testLocation = Path.Combine(AppContext.BaseDirectory, "MvcTestingAppManifest.json");
<br>        var json = JsonObject.Parse(File.ReadAllText(testLocation));
<br>        var asmFullName = typeof(T).Assembly.FullName ?? throw new InvalidOperationException("Assembly Full Name is null");
<br>        var contentRootPath = json?[asmFullName]?.GetValue&lt;string&gt;();
<br>
<br>        //spin up a real live web application inside TestHost.exe
<br>        var builder = WebApplication.CreateBuilder(
<br>            new WebApplicationOptions()
<br>            {
<br>                ContentRootPath = contentRootPath,
<br>                ApplicationName = asmFullName
<br>            });
<br>        return builder;
<br>    }
<br>}</pre>
<p>The first 4 lines are nasty. Because the test runs in the context of a different directory and my website needs to run within the context of its own content root path, I have to force the content root path to be correct and the only way to do that is by getting the apps base directory from a file generated within MSBuild from the (aging) MvcTesting package. The package is not used, but by referencing it it gets into the build and makes that file that I then use to pull out the directory. </p>
<p>If we can get rid of that "hack" and pull the directory from context elsewhere, then this helper function turns into a single line and .NET 9 gets WAY WAY more testable!</p>
<p>Now I can run my Unit Tests AND Playwright Browser Integration Tests across all OS's, headed or headless, in docker or on the metal. The site is updated to .NET 8 and all is right with my code. Well, it runs at least. ;)</p>
<br/><hr/>© 2025 Scott Hanselman. All rights reserved. 
<br/></div><Img align="left" border="0" height="1" width="1" alt="" style="border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;" hspace="0" src="https://feeds.feedblitz.com/~/i/873234002/0/scotthanselman">
<div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/873234002/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/873234002/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/873234002/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/873234002/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</content:encoded></item>
<item>
<feedburner:origLink>https://www.hanselman.com/blog/using-wsl-and-lets-encrypt-to-create-azure-app-service-ssl-wildcard-certificates</feedburner:origLink><trackback:ping>https://www.hanselman.com/blog/feed/trackback/7fbeba21-edbe-4af4-b909-26b6ba644546</trackback:ping><pingback:server>https://www.hanselman.com/blog/feed/pingback</pingback:server><pingback:target>https://www.hanselman.com/blog/post/7fbeba21-edbe-4af4-b909-26b6ba644546</pingback:target><dc:creator>Scott Hanselman</dc:creator><wfw:comment>https://feeds.feedblitz.com/~/749206136/0/scotthanselman~Using-WSL-and-Lets-Encrypt-to-create-Azure-App-Service-SSL-Wildcard-Certificates/comments#comments-start</wfw:comment><wfw:commentRss>https://www.hanselman.com/blog/feed/rss/comments/7fbeba21-edbe-4af4-b909-26b6ba644546</wfw:commentRss><slash:comments>3</slash:comments><title>Using WSL and Let's Encrypt to create Azure App Service SSL Wildcard Certificates</title><guid isPermaLink="false">https://www.hanselman.com/blog/post/7fbeba21-edbe-4af4-b909-26b6ba644546</guid><link>https://feeds.feedblitz.com/~/749206136/0/scotthanselman~Using-WSL-and-Lets-Encrypt-to-create-Azure-App-Service-SSL-Wildcard-Certificates</link><pubDate>Tue, 27 Jun 2023 17:17:25 GMT</pubDate><description><![CDATA[<div><p>There are many let's encrypt automatic tools for azure but I also wanted to see if I could use certbot in wsl to generate a wildcard certificate for the azure Friday website and then upload the resulting certificates to azure app service. </p> <p>Azure app service ultimately needs a specific format called dot PFX that includes the full certificate path and all intermediates.</p> <p>Per the docs, App Service private certificates must meet <a href="https://learn.microsoft.com/en-us/azure/app-service/configure-ssl-certificate?tabs=apex%2Cportal#private-certificate-requirements">the following requirements</a>:  <ul> <li>Exported as a password-protected PFX file, encrypted using triple DES.  <li>Contains private key at least 2048 bits long  <li>Contains all intermediate certificates and the root certificate in the certificate chain.</li></ul> <p>If you have a PFX that doesn't meet all these requirements you can have Windows reencrypt the file.</p> <p>I use WSL and certbot to create the cert, then I import/export in Windows and upload the resulting PFX.</p> <p>Within WSL, install certbot:</p><pre class="gutter: false; toolbar: false; smart-tabs: false;">sudo apt update<br>sudo apt install python3 python3-venv libaugeas0<br>sudo python3 -m venv /opt/certbot/<br>sudo /opt/certbot/bin/pip install --upgrade pip<br>sudo /opt/certbot/bin/pip install certbot</pre>
<p>Then I generate the cert. You'll get a nice text UI from certbot and update your DNS as a verification challenge. Change this to make sure it's <strong>two</strong> lines, and your domains and subdomains are correct and your paths are correct.</p><pre class="gutter: false; toolbar: false; smart-tabs: false;">sudo certbot certonly --manual --preferred-challenges=dns --email YOUR@EMAIL.COM   <br>    --server https://acme-v02.api.letsencrypt.org/directory   <br>    --agree-tos   --manual-public-ip-logging-ok   -d "azurefriday.com"   -d "*.azurefriday.com"<br>sudo openssl pkcs12 -export -out AzureFriday2023.pfx <br>    -inkey /etc/letsencrypt/live/azurefriday.com/privkey.pem <br>    -in /etc/letsencrypt/live/azurefriday.com/fullchain.pem</pre>
<p>I then copy the resulting file to my desktop (check your desktop path) so it's now in the Windows world.</p><pre class="gutter: false; toolbar: false; smart-tabs: false;">sudo cp AzureFriday2023.pfx /mnt/c/Users/Scott/OneDrive/Desktop
</pre>
<p>Now from Windows, import the PFX, note the thumbprint and export that cert.</p><pre class="brush: ps; gutter: false; toolbar: false; smart-tabs: false;">Import-PfxCertificate -FilePath "AzureFriday2023.pfx" -CertStoreLocation Cert:\LocalMachine\My <br>    -Password (ConvertTo-SecureString -String 'PASSWORDHERE' -AsPlainText -Force) -Exportable<br><br>Export-PfxCertificate -Cert Microsoft.PowerShell.Security\Certificate::LocalMachine\My\597THISISTHETHUMBNAILCF1157B8CEBB7CA1 <br>    -FilePath 'AzureFriday2023-fixed.pfx' -Password (ConvertTo-SecureString -String 'PASSWORDHERE' -AsPlainText -Force) </pre>
<p>Then upload the cert to the Certificates section of your App Service, under Bring Your Own Cert. </p><figure><img title="Custom Domains in Azure App Service" style="display: inline" alt="Custom Domains in Azure App Service" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-WSL-and-Lets-Encrypt-to-create-Azu_C384/image_3849c466-fcdb-4abd-96ad-8d52a5e93730.png" width="858" height="437"></figure> 
<p>Then under Custom Domains, click Update Binding and select the new cert (with the latest expiration date).</p>
<p><img title="image" style="margin: 0px; display: inline" alt="image" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-WSL-and-Lets-Encrypt-to-create-Azu_C384/image_3d6c1eb8-4a3e-4004-985a-75e8f8f56118.png" width="522" height="437"></p>
<p>Next step is to make this even more automatic or select a more automated solution but for now, I'll worry about this in September and it solved my expensive Wildcard Domain issue.</p><br/><hr/>© 2025 Scott Hanselman. All rights reserved. <br/></div><div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/749206136/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/749206136/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/749206136/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/749206136/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</description><comments>https://feeds.feedblitz.com/~/749206136/0/scotthanselman~Using-WSL-and-Lets-Encrypt-to-create-Azure-App-Service-SSL-Wildcard-Certificates/comments#comments-start</comments><category>Azure</category><content:encoded><![CDATA[<div><p>There are many let's encrypt automatic tools for azure but I also wanted to see if I could use certbot in wsl to generate a wildcard certificate for the azure Friday website and then upload the resulting certificates to azure app service. </p> <p>Azure app service ultimately needs a specific format called dot PFX that includes the full certificate path and all intermediates.</p> <p>Per the docs, App Service private certificates must meet <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://learn.microsoft.com/en-us/azure/app-service/configure-ssl-certificate?tabs=apex%2Cportal#private-certificate-requirements">the following requirements</a>:  <ul> <li>Exported as a password-protected PFX file, encrypted using triple DES.  <li>Contains private key at least 2048 bits long  <li>Contains all intermediate certificates and the root certificate in the certificate chain.</li></ul> <p>If you have a PFX that doesn't meet all these requirements you can have Windows reencrypt the file.</p> <p>I use WSL and certbot to create the cert, then I import/export in Windows and upload the resulting PFX.</p> <p>Within WSL, install certbot:</p><pre class="gutter: false; toolbar: false; smart-tabs: false;">sudo apt update
<br>sudo apt install python3 python3-venv libaugeas0
<br>sudo python3 -m venv /opt/certbot/
<br>sudo /opt/certbot/bin/pip install --upgrade pip
<br>sudo /opt/certbot/bin/pip install certbot</pre>
<p>Then I generate the cert. You'll get a nice text UI from certbot and update your DNS as a verification challenge. Change this to make sure it's <strong>two</strong> lines, and your domains and subdomains are correct and your paths are correct.</p><pre class="gutter: false; toolbar: false; smart-tabs: false;">sudo certbot certonly --manual --preferred-challenges=dns --email YOUR@EMAIL.COM   
<br>    --server https://acme-v02.api.letsencrypt.org/directory   
<br>    --agree-tos   --manual-public-ip-logging-ok   -d "azurefriday.com"   -d "*.azurefriday.com"
<br>sudo openssl pkcs12 -export -out AzureFriday2023.pfx 
<br>    -inkey /etc/letsencrypt/live/azurefriday.com/privkey.pem 
<br>    -in /etc/letsencrypt/live/azurefriday.com/fullchain.pem</pre>
<p>I then copy the resulting file to my desktop (check your desktop path) so it's now in the Windows world.</p><pre class="gutter: false; toolbar: false; smart-tabs: false;">sudo cp AzureFriday2023.pfx /mnt/c/Users/Scott/OneDrive/Desktop
</pre>
<p>Now from Windows, import the PFX, note the thumbprint and export that cert.</p><pre class="brush: ps; gutter: false; toolbar: false; smart-tabs: false;">Import-PfxCertificate -FilePath "AzureFriday2023.pfx" -CertStoreLocation Cert:\LocalMachine\My 
<br>    -Password (ConvertTo-SecureString -String 'PASSWORDHERE' -AsPlainText -Force) -Exportable
<br>
<br>Export-PfxCertificate -Cert Microsoft.PowerShell.Security\Certificate::LocalMachine\My\597THISISTHETHUMBNAILCF1157B8CEBB7CA1 
<br>    -FilePath 'AzureFriday2023-fixed.pfx' -Password (ConvertTo-SecureString -String 'PASSWORDHERE' -AsPlainText -Force) </pre>
<p>Then upload the cert to the Certificates section of your App Service, under Bring Your Own Cert. </p><figure><img title="Custom Domains in Azure App Service" style="display: inline" alt="Custom Domains in Azure App Service" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-WSL-and-Lets-Encrypt-to-create-Azu_C384/image_3849c466-fcdb-4abd-96ad-8d52a5e93730.png" width="858" height="437"></figure> 
<p>Then under Custom Domains, click Update Binding and select the new cert (with the latest expiration date).</p>
<p><img title="image" style="margin: 0px; display: inline" alt="image" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-WSL-and-Lets-Encrypt-to-create-Azu_C384/image_3d6c1eb8-4a3e-4004-985a-75e8f8f56118.png" width="522" height="437"></p>
<p>Next step is to make this even more automatic or select a more automated solution but for now, I'll worry about this in September and it solved my expensive Wildcard Domain issue.</p>
<br/><hr/>© 2025 Scott Hanselman. All rights reserved. 
<br/></div><Img align="left" border="0" height="1" width="1" alt="" style="border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;" hspace="0" src="https://feeds.feedblitz.com/~/i/749206136/0/scotthanselman">
<div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/749206136/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/749206136/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/749206136/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/749206136/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</content:encoded></item>
<item>
<feedburner:origLink>https://www.hanselman.com/blog/github-copilot-for-cli-for-powershell</feedburner:origLink><trackback:ping>https://www.hanselman.com/blog/feed/trackback/aa1cc05f-3910-471d-8686-68c749ec90ff</trackback:ping><pingback:server>https://www.hanselman.com/blog/feed/pingback</pingback:server><pingback:target>https://www.hanselman.com/blog/post/aa1cc05f-3910-471d-8686-68c749ec90ff</pingback:target><dc:creator>Scott Hanselman</dc:creator><wfw:comment>https://feeds.feedblitz.com/~/737271731/0/scotthanselman~GitHub-Copilot-for-CLI-for-PowerShell/comments#comments-start</wfw:comment><wfw:commentRss>https://www.hanselman.com/blog/feed/rss/comments/aa1cc05f-3910-471d-8686-68c749ec90ff</wfw:commentRss><slash:comments>6</slash:comments><title>GitHub Copilot for CLI for PowerShell</title><guid isPermaLink="false">https://www.hanselman.com/blog/post/aa1cc05f-3910-471d-8686-68c749ec90ff</guid><link>https://feeds.feedblitz.com/~/737271731/0/scotthanselman~GitHub-Copilot-for-CLI-for-PowerShell</link><pubDate>Tue, 25 Apr 2023 15:31:49 GMT</pubDate><description><![CDATA[<div><p>GitHub Next has this cool project that is basically Copilot for the CLI (command line interface). You can sign up for their waitlist at the <a href="https://githubnext.com/projects/copilot-cli/">Copilot for CLI site</a>.</p> <blockquote> <p>Copilot for CLI provides three shell commands: <code>??</code>, <code>git?</code> and <code>gh?</code></p></blockquote> <p>This is cool and all, but I use PowerShell. Turns out these ?? commands are just router commands to a larger EXE called github-copilot-cli. So if you go "?? something" you're really going "github-copilot-cli what-the-shell something."</p> <p>So this means I should be able to to do the same/similar aliases for my PowerShell prompt AND change the injected prompt (look at me I'm a prompt engineer) to add 'use powershell to.' </p> <p>Now it's not perfect, but hopefully it will make the point to the Copilot CLI team that PowerShell needs love also.</p> <p>Here are my aliases. Feel free to suggest if these suck. Note the addition of "user powershell to" for the ?? one. I may make a ?? and a p? where one does bash and one does PowerShell. I could also have it use wsl.exe and shell out to bash. Lots of possibilities.</p><pre class="brush: ps; gutter: false; toolbar: false; collapse: false; smart-tabs: false;">function ?? { <br>    $TmpFile = New-TemporaryFile <br>    github-copilot-cli what-the-shell ('use powershell to ' + $args) --shellout $TmpFile <br>    if ([System.IO.File]::Exists($TmpFile)) { <br>        $TmpFileContents = Get-Content $TmpFile <br>            if ($TmpFileContents -ne $nill) {<br>            Invoke-Expression $TmpFileContents <br>            Remove-Item $TmpFile <br>        }<br>    }<br>}<br><br>function git? {<br>    $TmpFile = New-TemporaryFile<br>    github-copilot-cli git-assist $args --shellout $TmpFile<br>    if ([System.IO.File]::Exists($TmpFile)) {<br>        $TmpFileContents = Get-Content $TmpFile <br>            if ($TmpFileContents -ne $nill) {<br>            Invoke-Expression $TmpFileContents <br>            Remove-Item $TmpFile <br>        }<br>    }<br>}<br>function gh? {<br>    $TmpFile = New-TemporaryFile<br>    github-copilot-cli gh-assist $args --shellout $TmpFile<br>    if ([System.IO.File]::Exists($TmpFile)) {<br>        $TmpFileContents = Get-Content $TmpFile <br>            if ($TmpFileContents -ne $nill) {<br>            Invoke-Expression $TmpFileContents <br>            Remove-Item $TmpFile <br>        }<br>    }<br>} </pre>
<p>It also then offers to run the command. Very smooth.</p><figure><img title="image" style="margin: 0px; display: inline" alt="image" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/GitHub-Copilot-for-CLI-for-PowerShell_B0E3/image_f39afdbf-04bf-4c95-a913-2404f46dc308.png" width="999" height="437"></figure> 
<p>Hope you like it. Lots of fun stuff happening in this space.</p><br/><hr/>© 2025 Scott Hanselman. All rights reserved. <br/></div><div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/737271731/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/737271731/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/737271731/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/737271731/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</description><comments>https://feeds.feedblitz.com/~/737271731/0/scotthanselman~GitHub-Copilot-for-CLI-for-PowerShell/comments#comments-start</comments><category>AI</category><category>PowerShell</category><content:encoded><![CDATA[<div><p>GitHub Next has this cool project that is basically Copilot for the CLI (command line interface). You can sign up for their waitlist at the <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://githubnext.com/projects/copilot-cli/">Copilot for CLI site</a>.</p> <blockquote> <p>Copilot for CLI provides three shell commands: <code>??</code>, <code>git?</code> and <code>gh?</code></p></blockquote> <p>This is cool and all, but I use PowerShell. Turns out these ?? commands are just router commands to a larger EXE called github-copilot-cli. So if you go "?? something" you're really going "github-copilot-cli what-the-shell something."</p> <p>So this means I should be able to to do the same/similar aliases for my PowerShell prompt AND change the injected prompt (look at me I'm a prompt engineer) to add 'use powershell to.' </p> <p>Now it's not perfect, but hopefully it will make the point to the Copilot CLI team that PowerShell needs love also.</p> <p>Here are my aliases. Feel free to suggest if these suck. Note the addition of "user powershell to" for the ?? one. I may make a ?? and a p? where one does bash and one does PowerShell. I could also have it use wsl.exe and shell out to bash. Lots of possibilities.</p><pre class="brush: ps; gutter: false; toolbar: false; collapse: false; smart-tabs: false;">function ?? { 
<br>    $TmpFile = New-TemporaryFile 
<br>    github-copilot-cli what-the-shell ('use powershell to ' + $args) --shellout $TmpFile 
<br>    if ([System.IO.File]::Exists($TmpFile)) { 
<br>        $TmpFileContents = Get-Content $TmpFile 
<br>            if ($TmpFileContents -ne $nill) {
<br>            Invoke-Expression $TmpFileContents 
<br>            Remove-Item $TmpFile 
<br>        }
<br>    }
<br>}
<br>
<br>function git? {
<br>    $TmpFile = New-TemporaryFile
<br>    github-copilot-cli git-assist $args --shellout $TmpFile
<br>    if ([System.IO.File]::Exists($TmpFile)) {
<br>        $TmpFileContents = Get-Content $TmpFile 
<br>            if ($TmpFileContents -ne $nill) {
<br>            Invoke-Expression $TmpFileContents 
<br>            Remove-Item $TmpFile 
<br>        }
<br>    }
<br>}
<br>function gh? {
<br>    $TmpFile = New-TemporaryFile
<br>    github-copilot-cli gh-assist $args --shellout $TmpFile
<br>    if ([System.IO.File]::Exists($TmpFile)) {
<br>        $TmpFileContents = Get-Content $TmpFile 
<br>            if ($TmpFileContents -ne $nill) {
<br>            Invoke-Expression $TmpFileContents 
<br>            Remove-Item $TmpFile 
<br>        }
<br>    }
<br>} </pre>
<p>It also then offers to run the command. Very smooth.</p><figure><img title="image" style="margin: 0px; display: inline" alt="image" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/GitHub-Copilot-for-CLI-for-PowerShell_B0E3/image_f39afdbf-04bf-4c95-a913-2404f46dc308.png" width="999" height="437"></figure> 
<p>Hope you like it. Lots of fun stuff happening in this space.</p>
<br/><hr/>© 2025 Scott Hanselman. All rights reserved. 
<br/></div><Img align="left" border="0" height="1" width="1" alt="" style="border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;" hspace="0" src="https://feeds.feedblitz.com/~/i/737271731/0/scotthanselman">
<div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/737271731/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/737271731/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/737271731/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/737271731/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</content:encoded></item>
<item>
<feedburner:origLink>https://www.hanselman.com/blog/use-your-own-user-domain-for-mastodon-discoverability-with-the-webfinger-protocol-without-hosting-a-server</feedburner:origLink><trackback:ping>https://www.hanselman.com/blog/feed/trackback/0c9c9a66-f3db-4e58-a1f3-c692b8ad64af</trackback:ping><pingback:server>https://www.hanselman.com/blog/feed/pingback</pingback:server><pingback:target>https://www.hanselman.com/blog/post/0c9c9a66-f3db-4e58-a1f3-c692b8ad64af</pingback:target><dc:creator>Scott Hanselman</dc:creator><wfw:comment>https://feeds.feedblitz.com/~/722495722/0/scotthanselman~Use-your-own-user-domain-for-Mastodon-discoverability-with-the-WebFinger-Protocol-without-hosting-a-server/comments#comments-start</wfw:comment><wfw:commentRss>https://www.hanselman.com/blog/feed/rss/comments/0c9c9a66-f3db-4e58-a1f3-c692b8ad64af</wfw:commentRss><slash:comments>3</slash:comments><title>Use your own user @ domain for Mastodon discoverability with the WebFinger Protocol without hosting a server</title><guid isPermaLink="false">https://www.hanselman.com/blog/post/0c9c9a66-f3db-4e58-a1f3-c692b8ad64af</guid><link>https://feeds.feedblitz.com/~/722495722/0/scotthanselman~Use-your-own-user-domain-for-Mastodon-discoverability-with-the-WebFinger-Protocol-without-hosting-a-server</link><pubDate>Sun, 18 Dec 2022 22:16:30 GMT</pubDate><description><![CDATA[<div><p>Mastodon is a free, open-source social networking service that is decentralized and distributed. It was created in 2016 as an alternative to centralized social media platforms such as Twitter and Facebook. <p>One of the key features of Mastodon is the use of the WebFinger protocol, which allows users to discover and access information about other users on the Mastodon network. WebFinger is a simple HTTP-based protocol that enables a user to discover information about other users or resources on the internet by using their email address or other identifying information. The WebFinger protocol is important for Mastodon because it enables users to find and follow each other on the network, regardless of where they are hosted. <p>WebFinger uses a "well known" path structure when calling an domain. You may be familiar with the robots.txt convention. We all just agree that robots.txt will sit at the top path of everyone's domain. <p>The WebFinger protocol is a simple HTTP-based protocol that enables a user or search to discover information about other users or resources on the internet by using their email address or other identifying information. My is first name at last name .com, so...my personal WebFinger API endpoint is here <a title="https://www.hanselman.com/.well-known/webfinger" href="https://www.hanselman.com/.well-known/webfinger">https://www.hanselman.com/.well-known/webfinger</a> <p>The idea is that... <ol> <li> <p>A user sends a WebFinger request to a server, using the email address or other identifying information of the user or resource they are trying to discover.</p> <li> <p>The server looks up the requested information in its database and returns a JSON object containing the information about the user or resource. This JSON object is called a "resource descriptor."</p> <li> <p>The user's client receives the resource descriptor and displays the information to the user.</p></li></ol> <p>The resource descriptor contains various types of information about the user or resource, such as their name, profile picture, and links to their social media accounts or other online resources. It can also include other types of information, such as the user's public key, which can be used to establish a secure connection with the user. <p>There's <a href="https://guide.toot.as/guide/use-your-own-domain/">a great explainer here as well</a>. From that page: <blockquote> <p><strong>When someone searches for you on Mastodon, your server will be queried for accounts using an endpoint that looks like this:</strong> <p>GET <a href="https://${MASTODON_DOMAIN}/.well-known/webfinger?resource=acct:${MASTODON_USER}@${MASTODON_DOMAIN">https://${MASTODON_DOMAIN}/.well-known/webfinger?resource=acct:${MASTODON_USER}@${MASTODON_DOMAIN</a>}<br></p></blockquote> <p>Note that Mastodon user names start with @ so they are @username@someserver.com. Just like twiter would be @shanselman@twitter.com I can be @shanselman@hanselman.com now! <p><img title="Searching for me with Mastodon" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Searching for me with Mastodon" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/f76e92f681b3_FC6E/image_cb60bf43-6d0a-41f9-9ff5-246f288adedf.png" width="533" height="455"> <p>So perhaps <em>https://www.hanselman.com/.well-known/webfinger?resource=acct:FRED@HANSELMAN.COM</em> <p>Mine returns<pre class="brush: js; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">{<br>    "subject":"acct:shanselman@hachyderm.io",<br>    "aliases":<br>    [<br>        "https://hachyderm.io/@shanselman",<br>        "https://hachyderm.io/users/shanselman"<br>    ],<br>    "links":<br>    [<br>        {<br>            "rel":"http://webfinger.net/rel/profile-page",<br>            "type":"text/html",<br>            "href":"https://hachyderm.io/@shanselman"<br>        },<br>        {<br>            "rel":"self",<br>            "type":"application/activity+json",<br>            "href":"https://hachyderm.io/users/shanselman"<br>        },<br>        {<br>            "rel":"http://ostatus.org/schema/1.0/subscribe",<br>            "template":"https://hachyderm.io/authorize_interaction?uri={uri}"<br>        }<br>    ]<br>}
</pre>
<p>This file should be returned as a mime type of <strong>application/jrd+json</strong>
<p>My site is an ASP.NET Razor Pages site, so I just did this in Startup.cs to map that well known URL to a page/route that returns the JSON needed.<pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">services.AddRazorPages().AddRazorPagesOptions(options =&gt;<br>{<br>    options.Conventions.AddPageRoute("/robotstxt", "/Robots.Txt"); //i did this before, not needed<br>    options.Conventions.AddPageRoute("/webfinger", "/.well-known/webfinger");<br>    options.Conventions.AddPageRoute("/webfinger", "/.well-known/webfinger/{val?}");<br>});
</pre>
<p>then I made a webfinger.cshtml like this. Note I have to double escape the @@ sites because it's Razor.<pre class="brush: xml; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">@page<br>@{<br>    Layout = null;<br>    this.Response.ContentType = "application/jrd+json";<br>}<br>{<br>    "subject":"acct:shanselman@hachyderm.io",<br>    "aliases":<br>    [<br>        "https://hachyderm.io/@@shanselman",<br>        "https://hachyderm.io/users/shanselman"<br>    ],<br>    "links":<br>    [<br>        {<br>            "rel":"http://webfinger.net/rel/profile-page",<br>            "type":"text/html",<br>            "href":"https://hachyderm.io/@@shanselman"<br>        },<br>        {<br>            "rel":"self",<br>            "type":"application/activity+json",<br>            "href":"https://hachyderm.io/users/shanselman"<br>        },<br>        {<br>            "rel":"http://ostatus.org/schema/1.0/subscribe",<br>            "template":"https://hachyderm.io/authorize_interaction?uri={uri}"<br>        }<br>    ]<br>}
</pre>
<p>This is a static response, but if I was hosting pages for more than one person I'd want to take in the url with the user's name, and then map it to their aliases and return those correctly. 
<p>Even easier, you can just use the JSON file of your own Mastodon server's webfinger response and SAVE IT as a static json file and copy it to your own server! 
<p>As long as your server returns the right JSON from that well known URL then it'll work.
<p>So this is <em>my </em>template <a title="https://hachyderm.io/.well-known/webfinger?resource=acct:shanselman@hachyderm.io" href="https://hachyderm.io/.well-known/webfinger?resource=acct:shanselman@hachyderm.io">https://hachyderm.io/.well-known/webfinger?resource=acct:shanselman@hachyderm.io</a> from where I'm hosted now.
<p>If you want to get started with Mastodon, start here. <a title="https://github.com/joyeusenoelle/GuideToMastodon/" href="https://github.com/joyeusenoelle/GuideToMastodon/">https://github.com/joyeusenoelle/GuideToMastodon/</a> it feels like Twitter circa 2007 except it's not owned by anyone and is based on web standards like ActivityPub. 
<p>Hope this helps! </p><br/><hr/>© 2025 Scott Hanselman. All rights reserved. <br/></div><div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/722495722/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/722495722/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/722495722/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/722495722/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</description><comments>https://feeds.feedblitz.com/~/722495722/0/scotthanselman~Use-your-own-user-domain-for-Mastodon-discoverability-with-the-WebFinger-Protocol-without-hosting-a-server/comments#comments-start</comments><category>Musings</category><content:encoded><![CDATA[<div><p>Mastodon is a free, open-source social networking service that is decentralized and distributed. It was created in 2016 as an alternative to centralized social media platforms such as Twitter and Facebook. <p>One of the key features of Mastodon is the use of the WebFinger protocol, which allows users to discover and access information about other users on the Mastodon network. WebFinger is a simple HTTP-based protocol that enables a user to discover information about other users or resources on the internet by using their email address or other identifying information. The WebFinger protocol is important for Mastodon because it enables users to find and follow each other on the network, regardless of where they are hosted. <p>WebFinger uses a "well known" path structure when calling an domain. You may be familiar with the robots.txt convention. We all just agree that robots.txt will sit at the top path of everyone's domain. <p>The WebFinger protocol is a simple HTTP-based protocol that enables a user or search to discover information about other users or resources on the internet by using their email address or other identifying information. My is first name at last name .com, so...my personal WebFinger API endpoint is here <a title="https://www.hanselman.com/.well-known/webfinger" href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.hanselman.com/.well-known/webfinger">https://www.hanselman.com/.well-known/webfinger</a> <p>The idea is that... <ol> <li> <p>A user sends a WebFinger request to a server, using the email address or other identifying information of the user or resource they are trying to discover.</p> <li> <p>The server looks up the requested information in its database and returns a JSON object containing the information about the user or resource. This JSON object is called a "resource descriptor."</p> <li> <p>The user's client receives the resource descriptor and displays the information to the user.</p></li></ol> <p>The resource descriptor contains various types of information about the user or resource, such as their name, profile picture, and links to their social media accounts or other online resources. It can also include other types of information, such as the user's public key, which can be used to establish a secure connection with the user. <p>There's <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://guide.toot.as/guide/use-your-own-domain/">a great explainer here as well</a>. From that page: <blockquote> <p><strong>When someone searches for you on Mastodon, your server will be queried for accounts using an endpoint that looks like this:</strong> <p>GET <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://${MASTODON_DOMAIN}/.well-known/webfinger?resource=acct:${MASTODON_USER}@${MASTODON_DOMAIN">https://${MASTODON_DOMAIN}/.well-known/webfinger?resource=acct:${MASTODON_USER}@${MASTODON_DOMAIN</a>}
<br></p></blockquote> <p>Note that Mastodon user names start with @ so they are @username@someserver.com. Just like twiter would be @shanselman@twitter.com I can be @shanselman@hanselman.com now! <p><img title="Searching for me with Mastodon" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Searching for me with Mastodon" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/f76e92f681b3_FC6E/image_cb60bf43-6d0a-41f9-9ff5-246f288adedf.png" width="533" height="455"> <p>So perhaps <em>https://www.hanselman.com/.well-known/webfinger?resource=acct:FRED@HANSELMAN.COM</em> <p>Mine returns<pre class="brush: js; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">{
<br>    "subject":"acct:shanselman@hachyderm.io",
<br>    "aliases":
<br>    [
<br>        "https://hachyderm.io/@shanselman",
<br>        "https://hachyderm.io/users/shanselman"
<br>    ],
<br>    "links":
<br>    [
<br>        {
<br>            "rel":"http://webfinger.net/rel/profile-page",
<br>            "type":"text/html",
<br>            "href":"https://hachyderm.io/@shanselman"
<br>        },
<br>        {
<br>            "rel":"self",
<br>            "type":"application/activity+json",
<br>            "href":"https://hachyderm.io/users/shanselman"
<br>        },
<br>        {
<br>            "rel":"http://ostatus.org/schema/1.0/subscribe",
<br>            "template":"https://hachyderm.io/authorize_interaction?uri={uri}"
<br>        }
<br>    ]
<br>}
</pre>
<p>This file should be returned as a mime type of <strong>application/jrd+json</strong>
<p>My site is an ASP.NET Razor Pages site, so I just did this in Startup.cs to map that well known URL to a page/route that returns the JSON needed.<pre class="brush: csharp; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">services.AddRazorPages().AddRazorPagesOptions(options =&gt;
<br>{
<br>    options.Conventions.AddPageRoute("/robotstxt", "/Robots.Txt"); //i did this before, not needed
<br>    options.Conventions.AddPageRoute("/webfinger", "/.well-known/webfinger");
<br>    options.Conventions.AddPageRoute("/webfinger", "/.well-known/webfinger/{val?}");
<br>});
</pre>
<p>then I made a webfinger.cshtml like this. Note I have to double escape the @@ sites because it's Razor.<pre class="brush: xml; gutter: false; toolbar: false; auto-links: false; smart-tabs: false;">@page
<br>@{
<br>    Layout = null;
<br>    this.Response.ContentType = "application/jrd+json";
<br>}
<br>{
<br>    "subject":"acct:shanselman@hachyderm.io",
<br>    "aliases":
<br>    [
<br>        "https://hachyderm.io/@@shanselman",
<br>        "https://hachyderm.io/users/shanselman"
<br>    ],
<br>    "links":
<br>    [
<br>        {
<br>            "rel":"http://webfinger.net/rel/profile-page",
<br>            "type":"text/html",
<br>            "href":"https://hachyderm.io/@@shanselman"
<br>        },
<br>        {
<br>            "rel":"self",
<br>            "type":"application/activity+json",
<br>            "href":"https://hachyderm.io/users/shanselman"
<br>        },
<br>        {
<br>            "rel":"http://ostatus.org/schema/1.0/subscribe",
<br>            "template":"https://hachyderm.io/authorize_interaction?uri={uri}"
<br>        }
<br>    ]
<br>}
</pre>
<p>This is a static response, but if I was hosting pages for more than one person I'd want to take in the url with the user's name, and then map it to their aliases and return those correctly. 
<p>Even easier, you can just use the JSON file of your own Mastodon server's webfinger response and SAVE IT as a static json file and copy it to your own server! 
<p>As long as your server returns the right JSON from that well known URL then it'll work.
<p>So this is <em>my </em>template <a title="https://hachyderm.io/.well-known/webfinger?resource=acct:shanselman@hachyderm.io" href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://hachyderm.io/.well-known/webfinger?resource=acct:shanselman@hachyderm.io">https://hachyderm.io/.well-known/webfinger?resource=acct:shanselman@hachyderm.io</a> from where I'm hosted now.
<p>If you want to get started with Mastodon, start here. <a title="https://github.com/joyeusenoelle/GuideToMastodon/" href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/joyeusenoelle/GuideToMastodon/">https://github.com/joyeusenoelle/GuideToMastodon/</a> it feels like Twitter circa 2007 except it's not owned by anyone and is based on web standards like ActivityPub. 
<p>Hope this helps! </p>
<br/><hr/>© 2025 Scott Hanselman. All rights reserved. 
<br/></div><Img align="left" border="0" height="1" width="1" alt="" style="border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;" hspace="0" src="https://feeds.feedblitz.com/~/i/722495722/0/scotthanselman">
<div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/722495722/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/722495722/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/722495722/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/722495722/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</content:encoded></item>
<item>
<feedburner:origLink>https://www.hanselman.com/blog/i-got-tired</feedburner:origLink><trackback:ping>https://www.hanselman.com/blog/feed/trackback/aba7f282-e752-48e8-8bf5-3c2e8c33c0e6</trackback:ping><pingback:server>https://www.hanselman.com/blog/feed/pingback</pingback:server><pingback:target>https://www.hanselman.com/blog/post/aba7f282-e752-48e8-8bf5-3c2e8c33c0e6</pingback:target><dc:creator>Scott Hanselman</dc:creator><wfw:comment>https://feeds.feedblitz.com/~/722495724/0/scotthanselman~I-got-tired/comments#comments-start</wfw:comment><wfw:commentRss>https://www.hanselman.com/blog/feed/rss/comments/aba7f282-e752-48e8-8bf5-3c2e8c33c0e6</wfw:commentRss><slash:comments>31</slash:comments><title>I got tired</title><guid isPermaLink="false">https://www.hanselman.com/blog/post/aba7f282-e752-48e8-8bf5-3c2e8c33c0e6</guid><link>https://feeds.feedblitz.com/~/722495724/0/scotthanselman~I-got-tired</link><pubDate>Sun, 18 Dec 2022 18:27:11 GMT</pubDate><description><![CDATA[<div><p><a href="https://unsplash.com/photos/bmJAXAz6ads"><img title="I got tired - photo by Elisa Ventur" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 0px 4px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="I got tired - photo by Elisa Ventur" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/I-got-tired-and-I-took-a-break_C67F/tired_299ef159-a454-413b-8654-3ec136cf9f79.jpg" width="350" align="right" height="233"></a>I have been blogging here for the last 20 years. Every Tuesday and Thursday, quite consistently, for two decades. But last year, without planning it, I got tired and stopped. Not sure why. It didn't correspond with any life events. Nothing interesting or notable happened. I just stopped.</p> <p>I did find joy on <a href="https://www.tiktok.com/@shanselman">TikTok</a> and amassed a small group of like-minded followers there. I enjoy my <a href="https://www.youtube.com/shanselman">YouTube</a> as well, and my <a href="https://www.hanselminutes.com/episodes">weekly podcast</a> is going strong with nearly 900 (!) episodes of interviews with cool people. I've also recently <a href="https://hachyderm.io/@shanselman">started posting on Mastodon</a> (a fediverse (federated universe)) Twitter alternative that uses the <a href="https://activitypub.rocks/">ActivityPub web standard</a>. I see that <a href="https://github.com/poppastring/dasblog-core/issues/647">Mark Downie has been looking at ActivityPub as well for DasBlog</a> (the blog engine that powers this blog) so I need to spend sometime with Mark soon.</p> <p>Being consistent is a hard thing, and I think I did a good job. I gave many talks over many years about <a href="https://www.hanselman.com/blog/scott-hanselmans-complete-list-of-productivity-tips">Personal Productivity</a> but I always mentioned doing what "feeds your spirit." For a minute here the blog took a backseat, and that's OK. I filled that (spare) time with family time, personal projects, writing more code, 3d printing, games, taekwondo, and a ton of other things. </p> <p>Going forward I will continue to write and share across a number of platforms, but it will continue to <a href="https://www.hanselman.com/blog/your-blog-is-the-engine-of-community">start here</a> as <a href="https://www.hanselman.com/blog/your-words-are-wasted">it's super important to Own Your Words</a>. Keep taking snapshots and backups of your keystrokes as you never know when your chosen platform might change or go away entirely.</p> <p>I'm still here. I hope you are too! I will see you soon.</p> <h3>Related Links:</h3> <ul> <li><a href="https://www.hanselman.com/blog/do-they-deserve-the-gift-of-your-keystrokes">Do they deserve the gift of your keystrokes?</a></li> <li><a href="https://www.hanselman.com/blog/do-you-have-a-digital-or-social-media-will-who-will-maintain-your-life-online-when-youre-dead">Do you have a digital or social media will?</a></li></ul><br/><hr/>© 2025 Scott Hanselman. All rights reserved. <br/></div><div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/722495724/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/722495724/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/722495724/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/722495724/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</description><comments>https://feeds.feedblitz.com/~/722495724/0/scotthanselman~I-got-tired/comments#comments-start</comments><category>Musings</category><content:encoded><![CDATA[<div><p><a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://unsplash.com/photos/bmJAXAz6ads"><img title="I got tired - photo by Elisa Ventur" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 0px 4px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="I got tired - photo by Elisa Ventur" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/I-got-tired-and-I-took-a-break_C67F/tired_299ef159-a454-413b-8654-3ec136cf9f79.jpg" width="350" align="right" height="233"></a>I have been blogging here for the last 20 years. Every Tuesday and Thursday, quite consistently, for two decades. But last year, without planning it, I got tired and stopped. Not sure why. It didn't correspond with any life events. Nothing interesting or notable happened. I just stopped.</p> <p>I did find joy on <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.tiktok.com/@shanselman">TikTok</a> and amassed a small group of like-minded followers there. I enjoy my <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.youtube.com/shanselman">YouTube</a> as well, and my <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.hanselminutes.com/episodes">weekly podcast</a> is going strong with nearly 900 (!) episodes of interviews with cool people. I've also recently <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://hachyderm.io/@shanselman">started posting on Mastodon</a> (a fediverse (federated universe)) Twitter alternative that uses the <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://activitypub.rocks/">ActivityPub web standard</a>. I see that <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/poppastring/dasblog-core/issues/647">Mark Downie has been looking at ActivityPub as well for DasBlog</a> (the blog engine that powers this blog) so I need to spend sometime with Mark soon.</p> <p>Being consistent is a hard thing, and I think I did a good job. I gave many talks over many years about <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.hanselman.com/blog/scott-hanselmans-complete-list-of-productivity-tips">Personal Productivity</a> but I always mentioned doing what "feeds your spirit." For a minute here the blog took a backseat, and that's OK. I filled that (spare) time with family time, personal projects, writing more code, 3d printing, games, taekwondo, and a ton of other things. </p> <p>Going forward I will continue to write and share across a number of platforms, but it will continue to <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.hanselman.com/blog/your-blog-is-the-engine-of-community">start here</a> as <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.hanselman.com/blog/your-words-are-wasted">it's super important to Own Your Words</a>. Keep taking snapshots and backups of your keystrokes as you never know when your chosen platform might change or go away entirely.</p> <p>I'm still here. I hope you are too! I will see you soon.</p> <h3>Related Links:</h3> <ul> <li><a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.hanselman.com/blog/do-they-deserve-the-gift-of-your-keystrokes">Do they deserve the gift of your keystrokes?</a></li> <li><a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.hanselman.com/blog/do-you-have-a-digital-or-social-media-will-who-will-maintain-your-life-online-when-youre-dead">Do you have a digital or social media will?</a></li></ul>
<br/><hr/>© 2025 Scott Hanselman. All rights reserved. 
<br/></div><Img align="left" border="0" height="1" width="1" alt="" style="border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;" hspace="0" src="https://feeds.feedblitz.com/~/i/722495724/0/scotthanselman">
<div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/722495724/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/722495724/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/722495724/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/722495724/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</content:encoded></item>
<item>
<feedburner:origLink>https://www.hanselman.com/blog/using-home-assistant-to-integrate-a-unifi-protect-g4-doorbell-and-amazon-alexa-to-announce-visitors</feedburner:origLink><trackback:ping>https://www.hanselman.com/blog/feed/trackback/9632ddf9-403c-4319-bba6-4cb98bc7932b</trackback:ping><pingback:server>https://www.hanselman.com/blog/feed/pingback</pingback:server><pingback:target>https://www.hanselman.com/blog/post/9632ddf9-403c-4319-bba6-4cb98bc7932b</pingback:target><dc:creator>Scott Hanselman</dc:creator><wfw:comment>https://feeds.feedblitz.com/~/676711904/0/scotthanselman~Using-Home-Assistant-to-integrate-a-Unifi-Protect-G-Doorbell-and-Amazon-Alexa-to-announce-visitors/comments#comments-start</wfw:comment><wfw:commentRss>https://www.hanselman.com/blog/feed/rss/comments/9632ddf9-403c-4319-bba6-4cb98bc7932b</wfw:commentRss><title>Using Home Assistant to integrate a Unifi Protect G4 Doorbell and Amazon Alexa to announce visitors</title><guid isPermaLink="false">https://www.hanselman.com/blog/post/9632ddf9-403c-4319-bba6-4cb98bc7932b</guid><link>https://feeds.feedblitz.com/~/676711904/0/scotthanselman~Using-Home-Assistant-to-integrate-a-Unifi-Protect-G-Doorbell-and-Amazon-Alexa-to-announce-visitors</link><pubDate>Tue, 14 Dec 2021 21:36:00 GMT</pubDate><description><![CDATA[<div><p>I am not a <a href="https://www.home-assistant.io/">Home Assistant</a> expert, but it's clearly a massive and powerful ecosystem. I've interviewed <a href="https://hanselminutes.com/788/automating-all-the-things-with-home-assistants-paulus-schoutsen">the creator of Home Assistant on my podcast</a> and I encourage you to check out that chat.</p> <p>Home Assistant can quickly become a hobby that overwhelms you. Every object (entity) in your house that is even remotely connected can become programmable. Everything. Even people! You can declare that any name:value pair that (for example) your phone can expose can be consumable by Home Assistant. Questions like "is Scott home" or "what's Scott's phone battery" can be associated with Scott the Entity in the Home Assistant Dashboard. </p> <blockquote> <p>I was amazed at the devices/objects that Home Assistant discovered that it could automate. Lights, remotes, Spotify, and more. You'll find that any internally connected device you have likely has an Integration available.</p></blockquote> <p>Temperature, Light Status, sure, that's easy Home Automation. But integrations and 3rd party code can give you details like "Is the Living Room dark" or "is there motion in the driveway." From these building blocks, you can then build your own IFTTT (If This Then That) automations, combining not just two systems, but any and all disparate systems.</p> <p>What's the best part? This all runs LOCALLY. Not in a cloud or the cloud or anyone's cloud. I've got my stuff running on a <a href="https://amzn.to/3HnJ3IY">Raspberry Pi 4</a>. Even better I put a <a href="https://amzn.to/3HnJ3IY">Power Over Ethernet (PoE) hat on my Rpi</a> so I have just one network wire into my hub that powers the Pi.</p> <p>I believe setting up <a href="https://www.home-assistant.io/installation/raspberrypi/">Home Assistant on a Pi</a> is the best and easiest way to get started. That said, you can also run in a Docker Container, on a Synology or other NAS, or just on Windows or Mac in the background. It's up to you. Optionally, you can pay <a href="https://www.nabucasa.com/">Nabu Casa</a> $5 for remote (outside your house) network access via transparent forwarding. But to be clear, it all still runs inside your house and not in the cloud.</p> <p><img title="Basic Home Assistant Setup" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Basic Home Assistant Setup" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-Home-Assistant_E31C/image_c613af81-10de-49d3-aead-6e174ca870ca.png" width="600" height="550"></p> <p>OK, to the main point. I used to have an Amazon Ring Doorbell that would integrate with Amazon Alexa and when you pressed the doorbell it would say "Someone is at the front door" on our all Alexas. It was a lovely little integration that worked nicely in our lives.</p> <p><img title="Front Door UniFi G4 Doorbell" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Front Door UniFi G4 Doorbell" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-Home-Assistant_E31C/image_165ff623-cdc3-40c0-9caf-46686032f539.png" width="485" height="357"></p> <p>However, I swapped out the Ring for a <a href="https://hacs.xyz/">Unifi Protect G4 Doorbell</a> for a number of reasons. I don't want to pump video to outside services, so this doorbell integrates nicely with my <a href="https://www.hanselman.com/blog/review-unifi-from-ubiquiti-networking-is-the-ultimate-prosumer-home-networking-solution">existing Unifi installation</a> and records video to a local hard drive. However, I lose any Alexa integration and this nice little "someone is at the door" announcement. So this seems like a perfect job for Home Assistant.</p> <p>Here's the general todo list:</p> <ul> <li>Install <a href="https://www.home-assistant.io/getting-started/">Home Assistant</a></li> <li>Install <a href="https://hacs.xyz/">Home Assistant Community Store</a></li> <ul> <li>This enables 3rd party "untrusted" integrations directly from GitHub. You'll need a GitHub account and it'll clone custom integrations directly into your local HA.</li> <li>I also recommend the Terminal &amp; SSH (9.2.2), File editor (5.3.3) add ons so you can see what's happening.</li></ul> <li>Get the <a href="https://github.com/briis/unifiprotect">UniFi Protect 3rd party integration for Home Assistant</a></li> <ul> <li><strong>NOTE</strong>: Unifi Protect support is being promoted in Home Assistant v2022.2 so you won't need this step soon as it'll be included.</li> <li>"The UniFi Protect Integration adds support for retrieving Camera feeds and Sensor data from a UniFi Protect installation on either an Ubiquiti CloudKey+, Ubiquiti UniFi Dream Machine Pro or UniFi Protect Network Video Recorder."</li> <li>Authenticate and configure this integration.</li></ul> <li>Get the <a href="https://github.com/custom-components/alexa_media_player">Alexa Media Player</a> integration</li> <ul> <li>This makes all your Alexas show up in Home Assistant as "media players" and also allows you to tts (text to speech) to them.</li> <li>Authenticate and configure this integration.</li></ul></ul> <p>I recommend going into your Alexa app and making a Multi-room Speaker Group called "everywhere." Not only because it's nice to be able to say "play the music everywhere" but you can also target that "Everywhere" group in Home Assistant.</p> <p>Go into your Home Assistant UI at <a title="http://homeassistant.local:8123/" href="http://homeassistant.local:8123/">http://homeassistant.local:8123/</a> and into <a href="https://www.home-assistant.io/docs/tools/dev-tools/">Developer Tools</a>. Under Services, try pasting in this YAML and clicking "call service."</p><pre>service: notify.alexa_media_everywhere
data:
  message: Someone is at the front door, this is a test
  data:
    type: announce
    method: speak</pre>
<p>If that works, you know you can automate Alexa and make it say things. Now, go to Configuration, Automation, and Add a new Automation. Here's mine. I used the UI to create it. Note that your Entity names may be different if you give your front doorbell camera a different name.</p>
<p><img title="Binary_sensor.front_door_doorbell" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Binary_sensor.front_door_doorbell" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-Home-Assistant_E31C/image_6c40ad44-b67e-422c-97c8-41741af21066.png" width="404" height="389"></p>
<p>Notice the format of Data, it's name value pairs within a single field's value.</p>
<p><img title="Alexa Action" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Alexa Action" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-Home-Assistant_E31C/image_5a58a5af-dd88-40f5-9c62-93202dbdf409.png" width="815" height="682"></p>
<p>...but it also exists in a file called Automations.yaml. Note that the "to: 'on'" trigger is required or you'll get double announcements, one for <em>each state change </em>in the doorbell. </p><pre>- id: '1640995128073'
  alias: G4 Doorbell Announcement with Alexa
  description: G4 Doorbell Announcement with Alexa
  trigger:
  - platform: state
    entity_id: binary_sensor.front_door_doorbell
    to: 'on'
  condition: []
  action:
  - service: notify.alexa_media_everywhere
    data:
      data:
        type: announce
        method: speak
      message: Someone is at the front door
  mode: single</pre>
<p>It works! There's a ton of cool stuff I can automate now!</p>
<hr>
<p><strong>Sponsor:</strong> Make login Auth0’s problem. Not yours. Provide the convenient login features your customers want, like social login, multi-factor authentication, single sign-on, passwordless, and more. <a href="https://hnsl.mn/34dSTyP">Get started for free.</a></p><br/><hr/>© 2025 Scott Hanselman. All rights reserved. <br/></div><div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/676711904/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/676711904/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/676711904/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/676711904/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</description><comments>https://feeds.feedblitz.com/~/676711904/0/scotthanselman~Using-Home-Assistant-to-integrate-a-Unifi-Protect-G-Doorbell-and-Amazon-Alexa-to-announce-visitors/comments#comments-start</comments><category>Home Server</category><category>Musings</category><content:encoded><![CDATA[<div><p>I am not a <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.home-assistant.io/">Home Assistant</a> expert, but it's clearly a massive and powerful ecosystem. I've interviewed <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://hanselminutes.com/788/automating-all-the-things-with-home-assistants-paulus-schoutsen">the creator of Home Assistant on my podcast</a> and I encourage you to check out that chat.</p> <p>Home Assistant can quickly become a hobby that overwhelms you. Every object (entity) in your house that is even remotely connected can become programmable. Everything. Even people! You can declare that any name:value pair that (for example) your phone can expose can be consumable by Home Assistant. Questions like "is Scott home" or "what's Scott's phone battery" can be associated with Scott the Entity in the Home Assistant Dashboard. </p> <blockquote> <p>I was amazed at the devices/objects that Home Assistant discovered that it could automate. Lights, remotes, Spotify, and more. You'll find that any internally connected device you have likely has an Integration available.</p></blockquote> <p>Temperature, Light Status, sure, that's easy Home Automation. But integrations and 3rd party code can give you details like "Is the Living Room dark" or "is there motion in the driveway." From these building blocks, you can then build your own IFTTT (If This Then That) automations, combining not just two systems, but any and all disparate systems.</p> <p>What's the best part? This all runs LOCALLY. Not in a cloud or the cloud or anyone's cloud. I've got my stuff running on a <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://amzn.to/3HnJ3IY">Raspberry Pi 4</a>. Even better I put a <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://amzn.to/3HnJ3IY">Power Over Ethernet (PoE) hat on my Rpi</a> so I have just one network wire into my hub that powers the Pi.</p> <p>I believe setting up <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.home-assistant.io/installation/raspberrypi/">Home Assistant on a Pi</a> is the best and easiest way to get started. That said, you can also run in a Docker Container, on a Synology or other NAS, or just on Windows or Mac in the background. It's up to you. Optionally, you can pay <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.nabucasa.com/">Nabu Casa</a> $5 for remote (outside your house) network access via transparent forwarding. But to be clear, it all still runs inside your house and not in the cloud.</p> <p><img title="Basic Home Assistant Setup" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Basic Home Assistant Setup" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-Home-Assistant_E31C/image_c613af81-10de-49d3-aead-6e174ca870ca.png" width="600" height="550"></p> <p>OK, to the main point. I used to have an Amazon Ring Doorbell that would integrate with Amazon Alexa and when you pressed the doorbell it would say "Someone is at the front door" on our all Alexas. It was a lovely little integration that worked nicely in our lives.</p> <p><img title="Front Door UniFi G4 Doorbell" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Front Door UniFi G4 Doorbell" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-Home-Assistant_E31C/image_165ff623-cdc3-40c0-9caf-46686032f539.png" width="485" height="357"></p> <p>However, I swapped out the Ring for a <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://hacs.xyz/">Unifi Protect G4 Doorbell</a> for a number of reasons. I don't want to pump video to outside services, so this doorbell integrates nicely with my <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.hanselman.com/blog/review-unifi-from-ubiquiti-networking-is-the-ultimate-prosumer-home-networking-solution">existing Unifi installation</a> and records video to a local hard drive. However, I lose any Alexa integration and this nice little "someone is at the door" announcement. So this seems like a perfect job for Home Assistant.</p> <p>Here's the general todo list:</p> <ul> <li>Install <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.home-assistant.io/getting-started/">Home Assistant</a></li> <li>Install <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://hacs.xyz/">Home Assistant Community Store</a></li> <ul> <li>This enables 3rd party "untrusted" integrations directly from GitHub. You'll need a GitHub account and it'll clone custom integrations directly into your local HA.</li> <li>I also recommend the Terminal &amp; SSH (9.2.2), File editor (5.3.3) add ons so you can see what's happening.</li></ul> <li>Get the <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/briis/unifiprotect">UniFi Protect 3rd party integration for Home Assistant</a></li> <ul> <li><strong>NOTE</strong>: Unifi Protect support is being promoted in Home Assistant v2022.2 so you won't need this step soon as it'll be included.</li> <li>"The UniFi Protect Integration adds support for retrieving Camera feeds and Sensor data from a UniFi Protect installation on either an Ubiquiti CloudKey+, Ubiquiti UniFi Dream Machine Pro or UniFi Protect Network Video Recorder."</li> <li>Authenticate and configure this integration.</li></ul> <li>Get the <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://github.com/custom-components/alexa_media_player">Alexa Media Player</a> integration</li> <ul> <li>This makes all your Alexas show up in Home Assistant as "media players" and also allows you to tts (text to speech) to them.</li> <li>Authenticate and configure this integration.</li></ul></ul> <p>I recommend going into your Alexa app and making a Multi-room Speaker Group called "everywhere." Not only because it's nice to be able to say "play the music everywhere" but you can also target that "Everywhere" group in Home Assistant.</p> <p>Go into your Home Assistant UI at <a title="http://homeassistant.local:8123/" href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~homeassistant.local:8123/">http://homeassistant.local:8123/</a> and into <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://www.home-assistant.io/docs/tools/dev-tools/">Developer Tools</a>. Under Services, try pasting in this YAML and clicking "call service."</p><pre>service: notify.alexa_media_everywhere
data:
  message: Someone is at the front door, this is a test
  data:
    type: announce
    method: speak</pre>
<p>If that works, you know you can automate Alexa and make it say things. Now, go to Configuration, Automation, and Add a new Automation. Here's mine. I used the UI to create it. Note that your Entity names may be different if you give your front doorbell camera a different name.</p>
<p><img title="Binary_sensor.front_door_doorbell" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Binary_sensor.front_door_doorbell" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-Home-Assistant_E31C/image_6c40ad44-b67e-422c-97c8-41741af21066.png" width="404" height="389"></p>
<p>Notice the format of Data, it's name value pairs within a single field's value.</p>
<p><img title="Alexa Action" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Alexa Action" src="https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Using-Home-Assistant_E31C/image_5a58a5af-dd88-40f5-9c62-93202dbdf409.png" width="815" height="682"></p>
<p>...but it also exists in a file called Automations.yaml. Note that the "to: 'on'" trigger is required or you'll get double announcements, one for <em>each state change </em>in the doorbell. </p><pre>- id: '1640995128073'
  alias: G4 Doorbell Announcement with Alexa
  description: G4 Doorbell Announcement with Alexa
  trigger:
  - platform: state
    entity_id: binary_sensor.front_door_doorbell
    to: 'on'
  condition: []
  action:
  - service: notify.alexa_media_everywhere
    data:
      data:
        type: announce
        method: speak
      message: Someone is at the front door
  mode: single</pre>
<p>It works! There's a ton of cool stuff I can automate now!</p>
<hr>
<p><strong>Sponsor:</strong> Make login Auth0’s problem. Not yours. Provide the convenient login features your customers want, like social login, multi-factor authentication, single sign-on, passwordless, and more. <a href="http://feeds.feedblitz.com/~/t/0/0/scotthanselman/~https://hnsl.mn/34dSTyP">Get started for free.</a></p>
<br/><hr/>© 2025 Scott Hanselman. All rights reserved. 
<br/></div><Img align="left" border="0" height="1" width="1" alt="" style="border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;" hspace="0" src="https://feeds.feedblitz.com/~/i/676711904/0/scotthanselman">
<div style="clear:both;padding-top:0.2em;"><a title="Like on Facebook" href="https://feeds.feedblitz.com/_/28/676711904/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/fblike20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Post to X.com" href="https://feeds.feedblitz.com/_/24/676711904/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/x.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by email" href="https://feeds.feedblitz.com/_/19/676711904/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/email20.png" style="border:0;margin:0;padding:0;"></a>&#160;<a title="Subscribe by RSS" href="https://feeds.feedblitz.com/_/20/676711904/scotthanselman"><img height="20" src="https://assets.feedblitz.com/i/rss20.png" style="border:0;margin:0;padding:0;"></a>&#160;</div>]]>
</content:encoded></item>
</channel></rss>

