Achraf Ben Alaya
No Result
View All Result
  • Home
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
    • General Tips & Fix
  • AI
  • Cloud
  • Motivation
  • Courses
  • About
    • Resume
    • Privacy Policy
SUBSCRIBE
  • Home
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
    • General Tips & Fix
  • AI
  • Cloud
  • Motivation
  • Courses
  • About
    • Resume
    • Privacy Policy
No Result
View All Result
Achraf Ben Alaya
No Result
View All Result
ADVERTISEMENT
Home Blog Cloud Azure

Dapr – Service Invocation Part 1/2

achraf by achraf
August 17, 2021
in Azure, Blog, Cloud, Dapr
3 min read
0
Dapr – Service Invocation Part 1/2
0
SHARES
849
VIEWS
Share on FacebookShare on Twitter

This part belong to a serie of articles about dapr :

  1. Introduction to dapr
  2. Service Invocation
  3. Publish-Subscribe pub/sub
  4. State management
  5. Hosting using AKS (Azure Kubernetes Services)

In the previous part, we have introduced dapr  ,now we are going to start creating our services one by one for that and as a start  what we need is :

  1. Make sure Docker is running and Dapr services too .
  2. Have .Net  5 Insatlled
  3. Have visual studio installed .

Creating the API :

First of all we are going to create and empty solution and name it as you want to , and than we are need to add a : ASP .NET WEB API project to the solution  or you can just type

dotnet new webapi

The full solution can be found at this link :  https://bit.ly/3s5pz5C

Now, you may run the solution by running the following command :

dotnet run

after that when we go to visit: http://localhost:3902/api/cookies we will get as return a list of cookies

 

Runing the API :

What we really want to do is to run the solution using Dapr for that and in order to expose the cookies api using the dapr sidecar we need to run the command :

dapr run --app-id cookiesstoreapi --app-port 5001  --dapr-http-port 50001 dotnet run

This may be a bit strange for you so let’s explain all the parts of this command :

  • –app-id : each app/service must have a unique ID .
  • –app-port :  in launch settings i changed the parameters so the app runs on port 5001 when I use dotnet run.
  • –dapr-http-port : the port that dapr in listening to for this service.
  • dotnet run : this is how we run dotnet applications

 

Now when we run this cmd we can still get our cookirs from http://localhost:5001/api/cookies but also now we can get them from the side car using : http://localhost:50001/v1.0/invoke/cookiesstoreapi/method/api/cookies .

http://localhost:<dapr-http-port>/v1.0/invoke/<app-id>/method/<method-name>

 

Discovering the Services :

using the follow command we can see the running services by dapr  :

dapr dashboard

On http://localhost:8080/ u will find dapr dashboard that will present to you the running services also the dapr components :

zipkin

When the dapr is working and by veryfing the runing containers, one of them is a Zipkin container, so what is zipkin ?

Zipkin is a distributed tracing system. It helps gather timing data needed to troubleshoot latency problems in service architectures. Features include both the collection and lookup of this data.

running: Docker ps will show us the following containers  :

as you can see zipkin is runing on port : 9411

 

Zipkin let you trace your services and show you all the dependencies and we will see that in the next part .

 

ShareTweet
Previous Post

Going Dapr

Next Post

Dapr – Service Invocation Part 2/2

Related Posts

Azure

Honored to be recognized as a Microsoft Azure MVP for 2025-2026

July 20, 2025
92
AI

Model Context Protocol (MCP): The Future of AI Integration

April 21, 2025
242
Azure

Step-by-Step Guide: Azure Front Door + Storage Account Static Website + Custom Domain with Terraform

March 11, 2025
704
Network Security & Route Tables – Checking NSGs, route tables, and service endpoints for a targeted VNET or Subnet
Azure

Network Security & Route Tables – Checking NSGs, route tables, and service endpoints for a targeted VNET or Subnet

February 3, 2025
185
Understanding Generative AI and RAG Benefits
AI

Understanding Generative AI and RAG Benefits

January 12, 2025
138
Azure Communication Services Email Sending Simplified: From Setup to Execution and Monitoring
Azure

Azure Communication Services Email Sending Simplified: From Setup to Execution and Monitoring

December 8, 2024
2.2k
Next Post
Dapr – Service Invocation Part 1/2

Dapr - Service Invocation Part 2/2

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Terraform

Certifications

Microsoft certified trainer (MCT)

Recommended

Swagger & OpenAPI and Versioning for ASP.NET Core

Swagger & OpenAPI and Versioning for ASP.NET Core

December 8, 2020
1.6k

Model Context Protocol (MCP): The Future of AI Integration

April 21, 2025
242
Automated Monitoring of Azure App Registration Secrets with Automation Accounts and Logic Apps

Automated Monitoring of Azure App Registration Secrets with Automation Accounts and Logic Apps

October 7, 2024
882
The Differences Between Blazor Server And Blazor  WebAssembly

The Differences Between Blazor Server And Blazor WebAssembly

January 10, 2021
837
Navigating the Alphabet Soup: Unraveling Microsoft Acronyms

Navigating the Alphabet Soup: Unraveling Microsoft Acronyms

July 16, 2023
263
Deploy azure function from visual studio 2019

Deploy azure function from visual studio 2019

August 29, 2020
626
Facebook Twitter LinkedIn Youtube

Honored to be recognized as a Microsoft Azure MVP for 2025-2026

July 20, 2025

Model Context Protocol (MCP): The Future of AI Integration

April 21, 2025

Step-by-Step Guide: Azure Front Door + Storage Account Static Website + Custom Domain with Terraform

March 11, 2025

Categories

  • AI (2)
  • Apps (1)
  • Azure (64)
  • blazor (2)
  • Blog (91)
  • c# (7)
  • Cloud (66)
  • Courses (4)
  • Dapr (4)
  • docker (4)
  • Games (1)
  • General Tips & Fix (1)
  • Home (1)
  • Kubernetes Service (AKS) (1)
  • motivation (2)
  • Motivation (3)
  • News (9)
  • Resume (1)
  • sql (4)
  • Terrafrom (1)
  • Tricks, Tips and Fixes (4)
  • xamarin (5)
No Result
View All Result
  • Home
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
    • General Tips & Fix
  • AI
  • Cloud
  • Motivation
  • Courses
  • About
    • Resume
    • Privacy Policy