79457817

Date: 2025-02-21 15:18:16
Score: 1
Natty:
Report link

The exception is caused by a failure to connect to the database.

It was using the production connection string because the ASPNETCORE_ENVIRONMENT environment variable was not set in the Developer Command Prompt.

The production connection string uses:

Authentication=Active Directory Managed Identity

The "local" connection string uses:

Authentication=Active Directory Interactive

I set the environment variable:

SET ASPNETCORE_ENVIRONMENT=local

Once it was using the correct Authentication for running from a local computer it was able to connect to the Azure SQL database and successfully scaffold the objects.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Troy Turley