Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azurite not starting automatically in Visual Studio 2022

I am unable to use a Blob Storage because in Visual Studio 2022 Azureite seems not to start automatically. Therefore I don't have access to databases etc.

Azure.Core: No connection could be made because the target machine actively refused it. System.Net.Http: No connection could be made because the target machine actively refused it. System.Private.CoreLib: No connection could be made because the target machine actively refused it.

While starting VS I should see some information in the Output window that Azure Tools are being updated. I can't see any.

How can this be resolved?

like image 760
Nina Avatar asked Nov 21 '25 10:11

Nina


2 Answers

I was unable to get Azurite to start automatically when running a Function project locally from VS2022, but fixed this issue by removing and re-adding the Azurite Service Dependency from the project.

After performing these steps, Azurite automatically starts now when I run the Function app locally in VS2022, with no need to manually start it via command line.:

  1. Right click "Connected Services" and choose "Manage Connected Services": Manage Connected Services

  2. Inside menu, disconnect "Storage Azurite emulator (Local)" if it is there. Otherwise, skip this step: Disconnect Storage Azurite emulator (Local)

  3. Click the "+" to add a dependency, select "Storage Azurite emulator (Local)", and click "Next":AddStorage Azurite emulator (Local)

  4. Configure the following:

  • Connection string name: AzureWebJobsStorage
  • Connection string value: UseDevelopmentStorage=true
  • Save connection string value in (radio button): Do not save value anywhere.
  • Note that the connection string name and value should correspond to the contents of your local.settings.json file. Click "Next".Configure Azuritelocal.settings.json
  1. Uncheck "C# code file(s)", "NuGet packages", and "Secrets store" from the summary of changes and click "Finish":Summary of changes

  2. When finished, you will see something like this: Finished configuration

like image 143
digital_jedi Avatar answered Nov 24 '25 07:11

digital_jedi


First check which projects you are using in startup. Mine fails to start if using the "Configure Startup Projects | Multiple Startup Projects" options and the functions project I have (which knows to start Azurite) has not already been executed.

In this scenario:

  1. Select your Azure functions project to be "Single Startup Project"

  2. F5 to debug (should now be successful in starting azurite)

  3. Switch back to multiple projects startup (should work, Azurite is already started)

This is essentially the same as "find your azurite location and start manually", but easier from within VS. It might work properly if the multiple projects startup order is changed to start with the Azure Functions project.

like image 27
Paul Devenney Avatar answered Nov 24 '25 07:11

Paul Devenney



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!