az group create --name crgar-aks-sidecar-rg --location eastus az aks create --resource-group crgar-aks-sidecar-rg --name crgar-aks-sidecar-aks --node-count 1 --enable-addons monitoring --generate-ssh-keys --attach-acr crgarakspublicacr
az aks get-credentials --resource-group crgar-aks-sidecar-rg --name crgar-aks-sidecar-aks --admin
dotnet new webapi -n daprdemo replace framework in -cs by v6 dotnet run
change:
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
by
// // Configure the HTTP request pipeline.
// if (app.Environment.IsDevelopment())
// {
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("./swagger/v1/swagger.json", "DAPR API");
c.RoutePrefix = "";
});
app.UseDeveloperExceptionPage();
// }
// app.UseHttpsRedirection();
dotnet add package Dapr.AspNetCore
In Program.cs, add:
builder.Services.AddDaprClient();
dapr run --app-id daprapi --app-port 6002 --dapr-http-port 3602 --dapr-grpc-port 60002 --app-ssl dotnet run dapr run --app-id client --app-port 6003 --dapr-http-port 3603 --dapr-grpc-port 60003 --app-ssl dotnet run
dapr init --kubernetes dapr status -k dapr mtls -k kubectl get pods --namespace dapr-system
.Net Generate assets for build & debug
Dapr: Scafold dapr Task
Debug: Select and start deb Debug Configu
az acr login -n crgarakspublicacr
docker run -p 4444:80 crgarakspublicacr.azurecr.io/daprdemo:1.0.10
kubectl apply -f .\deployments\k8s.yaml
kubectl get pods kubectl get services
kubectl apply -f .\deployments\k8s.yaml
dapr dashboard -k -p 8082 dapr mtls renew-certificate