Azure FunctionsVisual Studio

Azurite emulator cannot be started

After installing Visual Studio 2022 and working with Azure Functions I noticed that a new storage emulator is being used called Azurite.

Azurite is an open source Azure Storage API compatible server (emulator). Based on Node.js, Azurite provides cross platform experiences for customers wanting to try Azure Storage easily in a local environment. Azurite simulates most of the commands supported by Azure Storage with minimal dependencies.

https://github.com/Azure/Azurite

This seemed to replace the old Azure Storage Emulator you would run previously when doing local development. I quickly came across an issue where the Azurite emulator cannot be started because port 10000 is already in use. This is also applied to ports 10001 and 10002 which it uses. Here are the contents of the Service Dependencies from the Visual Studio 2022 Output pane:

Ensuring Azure Functions Core Tools are up to date. This may take a few minutes...
Azure Functions Core Tools are up to date.
DotNetCore31-FunctionApp: Azurite emulator cannot be started because port 10000 is already in use. Another instance of the Azurite emulator or Azure Storage emulator might be already running on your machine.
DotNetCore31-FunctionApp: We detected that Azure Storage emulator is running on your machine. The Azure Storage emulator is now deprecated. Microsoft recommends that you use the Azurite emulator for local development with Azure Storage. Follow the directions in the link 'https://go.microsoft.com/fwlink/?LinkID=2167087' to install and run Azurite emulator.
Unable to start dependency 'functions.storage1'.
Ensuring Azure Functions Core Tools are up to date. This may take a few minutes...
Azure Functions Core Tools are up to date.
Ensuring Azure Functions Core Tools are up to date. This may take a few minutes...
Azure Functions Core Tools are up to date.
DotNetCore31-FunctionApp: Azurite emulator cannot be started because port 10000 is already in use. Another instance of the Azurite emulator or Azure Storage emulator might be already running on your machine.
DotNetCore31-FunctionApp: We detected that Azure Storage emulator is running on your machine. The Azure Storage emulator is now deprecated. Microsoft recommends that you use the Azurite emulator for local development with Azure Storage. Follow the directions in the link 'https://go.microsoft.com/fwlink/?LinkID=2167087' to install and run Azurite emulator.
Unable to start dependency 'storage1'.
DotNetCore31-FunctionApp: Azurite emulator cannot be started because port 10000 is already in use. Another instance of the Azurite emulator or Azure Storage emulator might be already running on your machine.
DotNetCore31-FunctionApp: We detected that Azure Storage emulator is running on your machine. The Azure Storage emulator is now deprecated. Microsoft recommends that you use the Azurite emulator for local development with Azure Storage. Follow the directions in the link 'https://go.microsoft.com/fwlink/?LinkID=2167087' to install and run Azurite emulator.
Unable to start dependency 'storage1'.

Let’s drop into Windows Terminal and take a look at what process is using that port:

Get-Process -Id (Get-NetTCPConnection -LocalPort 10002).OwningProcess

After stopping the Node process and re-running Azurite (I restarted Visual Studio) we can see everything starts up as expected:

Ensuring Azure Functions Core Tools are up to date. This may take a few minutes...
Azure Functions Core Tools are up to date.
DotNetCore31-FunctionApp: azurite.cmd --location "C:\Users\ccampbell\AppData\Local\Temp\Azurite" --debug "C:\Users\ccampbell\AppData\Local\Temp\Azurite\debug.log"
DotNetCore31-FunctionApp: Azurite Blob service is starting at http://127.0.0.1:10000
DotNetCore31-FunctionApp: Azurite Blob service is successfully listening at http://127.0.0.1:10000
DotNetCore31-FunctionApp: Azurite Queue service is starting at http://127.0.0.1:10001
DotNetCore31-FunctionApp: Azurite Queue service is successfully listening at http://127.0.0.1:10001
DotNetCore31-FunctionApp: Azurite Table service is starting at http://127.0.0.1:10002
DotNetCore31-FunctionApp: Azurite Table service is successfully listening at http://127.0.0.1:10002

This was not a great experience on the first day I started to use Visual Studio 2022 with Azure Functions as I had to go off and figure out why the Azure emulator could not be started instead of just working on my application. You can go and change the default ports ft you like which is mentioned in the documentation. For more information on Azurite check out the docs on their GitHub repository.

I hope this helps with anyone new to the Azurite emulator in Visual Studio 2022.

Enjoy!

References

https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio

https://github.com/Azure/Azurite

AzureAzure ADAzure B2CBlazor

Blazor WASM hosted in ASP.NET Core templates with Azure B2C and Azure AD authentication using Backend for Frontend (BFF)

I have implemented many Blazor WASM ASP.NET Core hosted applications now for both Azure AD and Azure B2C authentication. I always implement security …

Blazor WASM hosted in ASP.NET Core templates with Azure B2C and Azure AD authentication using Backend for Frontend (BFF)
Application InsightsAzureAzure API Management

Emit custom metrics from Azure API Management

In the July release of Azure API Management, they’ve added the feature to emit custom metrics to Application Insights.  If you follow my blog, you …

Emit custom metrics from Azure API Management
AzureAzure API Management

Dynamically expose Open API definitions in Azure API Management

Open API is currently the most common used API standard out there.  API Management has full support for this standard.  The basis of this standard is…

Dynamically expose Open API definitions in Azure API Management
Personal DevelopmentYear in Review

Year in Review 2021

Happy New Year everyone! To kick off the new year I’d like to share with you what happened in 2021, what it meant to me, and where I plan on going in 2022.

So let’s kick off my 2021 year in review!

Year in stats 2021

  • Twitter: 1284 followers
  • LinkedIn: 587 followers
  • GitHub: 25 followers, 75 repositories
  • Blog (all time): 149.7K views and 116.3K visitors
  • Medium: 163 followers
  • YouTube: 0 subscribers (just opened an account in December)

What I achieved in 2021

2021 was a busy year. I was fortunate enough to keep busy on a large on-prem migration to Azure while also working on numerous app modernization projects in .NET working with Azure Functions, Azure App Service, Azure Cosmos DB, Azure App Configuration, Azure Key Vault, Azure Storage, Azure Cache for Redis, Azure Static Web Apps, Azure Logic Apps, Azure API Management, Azure Front Door, Azure CDN, Azure Data Factory, Azure Cognitive Services, and Application Insights / Monitoring. It was like being a kid in a candy shop. It’s amazing what you can build with these services, each of them having their appropriate place in the larger picture/architecture.

Here is a short summary of some of my highlights:

  • Microsoft MVP (Azure) renewed for a 4th consecutive year
  • Spoke virtually across the globe
    • Local .NET and Azure user groups
    • Best of Build 2021 Canadian Edition (Microsoft)
    • Global Azure 2021 bootcamp (Microsoft)
    • Roadmap for MVP Series Event about Selecting an MVP hosting / Cloud Computing Platform (Azure) for Silicon Halton
  • Taught an Azure Workshop for Light House Labs (Microsoft)
  • Submitted a video to the Festive Tech Calendar
  • Mentored numerous people
  • I was fortunate to be able to take further training in Azure related material
  • Worked on successful cloud a migration project
  • Worked on numerous app modernization projects
  • Started a YouTube channel in December
  • Hosted the first live YouTube session for Canada’s Technology Triangle User Group

This year I continued to work from home and I like it as I get to spend more time with my family and with 3 young kids, I get to see more of them during the day and have those special moments that I would have otherwise missed had I been in the office. On the other hand, I do miss the social setting and engaging with my co-workers in person, and it felt like I was living in Teams for half my day.

What didn’t happen

  • Certifications. Once again I had planned out 2 Azure certifications for the year but ended up pushing to 2022 due to priorities with clients and just trying to deal with another year of Covid.
  • Blogging. This year I focused on learning more Azure and sharing that with the community with virtual events. As a result my blogging was side lined. There were numerous days where I wanted to write about something but I writers block in transitioning the idea to a post. Good thing is I have a bagful of ideas now to write about in 2022.

What’s to come in 2022

I see 2022 as a year of exciting opportunities and light on the horizon with regards to the global pandemic (Covid-19) coming to an end (hey I can dream). I’m looking forward to finally adding some Azure certifications and continuing to expand my knowledge deeper into Azure. I will continue to speak at user groups and conferences. Speaking of which I’ll be doing monthly YouTube live sessions for Canada’s Technology Triangle User Group that I run and I’d like to start doing my own YouTube videos. With regards to presentations and user groups and conferences, I already have a few speaking engagements lined up for January, February and March, and I will be submitting a few call for speaker topics for the Global Azure Bootcamp (Mississauga) in April and hopefully, we do another Best of Build 22 Canadian Edition later in June.

I had a lot of fun teaching Azure workshops last year that I’m going to look for a few more to do this year. There is always something new to learn in Azure and sharing that with the community and helping organizations better leverage the cloud is a very fulfilling experience.

I already know that there will be no in-person Microsoft MVP Summit this year and that it will be online and virtual again, so I’m excited for that event to connect with the MVP community and to learn what I can from the Azure product teams. So far I’ve only been able to attend one in-person summit and I’m hoping my Microsoft MVP is renewed again so that I have another opportunity in 2023. Hopefully, the world is in a much better place for in-person events like this to resume again.

I doubt there will be a Microsoft Build or Ignite conference this year in person, but that would be a conference I would look forward to attending in 2023 if possible. Only time will tell.

I also want to take some vacation to Mexico, but that might be something for 2023, well see.

Happy New Year, and may you all have a fantastic year! Stay safe and I look forward to connecting with you at some point.

Enjoy!

Application InsightsAzureAzure API Management

Send API inspector traces to Application Insights

In the December 2020 release of Azure API Management, there was a release note that drew my attention: You can now log API inspector traces to …

Send API inspector traces to Application Insights
AzureAzure API Management

Layered API design in Azure API Management — Your Azure Coach

Designing and composing APIs is a very subjective matter and there are many ways to success (and even more to failure).  One approach I’ve always liked is the way MuleSoft describes it.  They define three layers of APIs: Experience APIs: purpose-built APIs for specific apps, also known as BFFs (Backend for Frontend) Process APIs: domain-driven business…

Layered API design in Azure API Management — Your Azure Coach
AzureAzure API Management

Azure API Management – What are my networking options? — Karim Vaes

Introduction A very common discussion to have with enterprises around Azure API Management (“APIM”) is the aspect of network integration. At the end of the day, the response to that is very simple… Only the developer & premium SKU allow VNET integration. The integration is achieved by doing “injection”, which means that the service is […]

Azure API Management – What are my networking options? — Karim Vaes
AzureCommunity

Global Azure 2022 is happening!

Ready for another #GlobalAzure event? Global Azure 2022 is happening May 5-7. Please take a look at this blog post for more details and how you can help.

https://blog.globalazure.net/Blog/Post/283/It-is-time-for-Global-Azure-2022

Enjoy!

AIAnalyticsAzureDeveloperDevOps

Highlights from Microsoft Build 2021 | Digital Event

I’m happy to announce a Highlights from Microsoft Build 2021 digital event next Thursday, July 15. Please join me and other local experts as we look to provide key insights from the event that will help you expand your skillset, find technical solutions, and innovate for the challenges of tomorrow.

Here are the topics that will be covered:

  • .NET 6 and ASP.NET Core 6 and C#10
  • Internet of Things
  • DevOps
  • Kubernetes
  • Power Platform
  • Artificial Intelligence
  • Azure Functions
  • Entity Framework
  • Power BI

For more details about this event, please visit https://www.meetup.com/CTTDNUG/events/279130746/

Enjoy!