Azure / Azure/app-service-linux-docs

Azure App Service built-in authentication on gRPC not working

Aperta
#167 0 commenti 4 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
150
Fork
90
Merge medio
2m
PR unite (30g)
1

Descrizione

I deployed into Azure App Service a .NET 7 [sample hello gRPC API][1] on Linux OS

public class GreeterService : Greeter.GreeterBase
{
private readonly ILogger _logger;

public GreeterService(ILogger logger)
{
_logger = logger;
}

public override Task SayHello(HelloRequest request,
ServerCallContext context)
{
_logger.LogInformation("Saying hello to {Name}", request.Name);
return Task.FromResult(new HelloReply
{
Message = "Hello " + request.Name
});
}
}

It is functioning properly and responding with the Hello greeting after I called it using Postman.

Now that I've attempted to use the built-in [Authentication][2] functionality on Azure App Service with Microsoft Identity Platform, I haven't encountered any problems using Postman to call it without authentication.

Did you realize that gRPC is compatible with Azure App Service Authentication?

This is my appsettings.json

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http2"
}
}
}

and this the Program.cs

using GrpcGreeter.Services;
using System.Reflection;

var builder = WebApplication.CreateBuilder(args);

// Additional configuration is required to successfully run gRPC on macOS.
// For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682

// Add services to the container.
builder.Services.AddGrpc();
builder.Services.AddGrpcReflection();


var app = builder.Build();

// Configure the HTTP request pipeline.
app.MapGrpcReflectionService();
app.MapGrpcService();
app.MapGet("/", () => "Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909");

app.Run();

[1]: https://learn.microsoft.com/en-us/aspnet/core/grpc/?view=aspnetcore-7.0
[2]: https://learn.microsoft.com/en-us/azure/app-service/overview-authentication-authorization

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia con l’esempio hello gRPC collegato per .NET 7, appsettings.json e Program.cs, quindi confronta la distribuzione con la documentazione di Azure App Service Authentication. Riproduci la chiamata Postman non autenticata e determina se Azure App Service Authentication supporta questa configurazione gRPC; documenta il risultato della compatibilità e la configurazione o limitazione richiesta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, csharp, grpc
Ambito
api, authentication, cloud
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
28/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.