Generative AI Funny Number 1

September 26, 2024

I have a tutoring student I'm working with to help them understand how to transition a standalone web application into a distributed application using cloud services. Typically, I do a lot of preparation, have a good amount of code ready to execute, and then review the source code with the student to explain the rationale behind the design, the chosen code structure, etc. However, I'm trying to shift from demos and extensive talking to more pair programming. There are things that can only be learned by doing or by watching how it is one, not just by reading the code of the end product.

I was doing some last-minute prep for the tutoring session where I was planning to integrate message queuing via Azure Storage Account message queues. I've worked with storage account message queues before, but not so much that the code just rolls off my fingers. This is the perfect time to get some help from generative AI, like Microsoft CoPilot. So I ask CoPilot:

"I need some C# sample code to connect to and place a message in an Azure Storage Account message queue."

CoPilot responds by explaining the .NET CLI command to create a console app, followed by the .NET CLI commands to install the necessary NuGet packages, which it says are Azure.Storage.Queues and Azure.Identity. It then shows the code that uses a storage account connection string. I think to myself, "I wonder why the Azure.Identity package is necessary if we're going to connect via storage account connection strings." So I ask CoPilot:

"Why is Azure.Identity needed if I'm using a storage account connection string?"

CoPilot replies with a detailed explanation that includes:

"In the example I provided, the Azure.Identity package was included out of habit."

Out of habit!

Generative AI has habits? LOL.

I love CoPilot. Sometimes it amazes me, sometimes it makes me laugh, other times mad, and other times it's just plain entertaining.