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
831
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
138
Azure

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

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

Understanding Generative AI and RAG Benefits

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

PowerShell Automation for Azure Networks: Detailed VNET and Subnet Analysis

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

Block the default URL assigned to the azure web app using azure application gateway

Block the default URL assigned to the azure web app using azure application gateway

May 31, 2023
579
Azure Policy for governance

Azure Policy for governance

August 29, 2020
1.4k
Sql tips and tricks

Sql tips

August 29, 2020
631
You forget to shutdown your virtual machine on your way home ? send an email and save your time

You forget to shutdown your virtual machine on your way home ? send an email and save your time

February 6, 2021
532
Welcome to Azure Resource Mover service

Welcome to Azure Resource Mover service

February 2, 2021
216
How To Send Mail Using SQL Server

How To Send Mail Using SQL Server

April 20, 2020
296
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