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
818
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

AI

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

April 21, 2025
110
Azure

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

March 11, 2025
231
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
137
Understanding Generative AI and RAG Benefits
AI

Understanding Generative AI and RAG Benefits

January 12, 2025
96
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
1.6k
PowerShell Automation for Azure Networks: Detailed VNET and Subnet Analysis
Azure

PowerShell Automation for Azure Networks: Detailed VNET and Subnet Analysis

November 2, 2024
502
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

How to setup nginx reverse proxy && load balancer for aspnet core apps with Docker and azure kubernetes service (AKS)

How to setup nginx reverse proxy && load balancer for aspnet core apps with Docker and azure kubernetes service (AKS)

November 23, 2022
871
Navigating Azure Identities: System-Assigned vs. User-Assigned with Real-World Scenarios

Navigating Azure Identities: System-Assigned vs. User-Assigned with Real-World Scenarios

October 9, 2023
301
Migrate and modernize your applications on Azure – Part –1 (Migrate Database)

Migrate and modernize your applications on Azure – Part –1 (Migrate Database)

April 3, 2021
319
How to Claim My Free Microsoft Certification Voucher

How to Claim My Free Microsoft Certification Voucher

October 15, 2020
773
Elevate Your API Reliability: Deep Dive into Load Balancing and Failover Strategies in Azure API Management

Elevate Your API Reliability: Deep Dive into Load Balancing and Failover Strategies in Azure API Management

December 29, 2023
353
Migrate and modernize your applications on Azure

Migrate and modernize your applications on Azure – Part – 00 (creating .Net 5.0 application )

March 29, 2021
315
Facebook Twitter LinkedIn Youtube

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
Network Security & Route Tables – Checking NSGs, route tables, and service endpoints for a targeted VNET or Subnet

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

February 3, 2025

Categories

  • AI (2)
  • Apps (1)
  • Azure (63)
  • blazor (2)
  • Blog (91)
  • c# (7)
  • Cloud (65)
  • Courses (3)
  • 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