Azure / azure-functions-signalrservice-extension

Azure Functions bindings for SignalR Service. Project moved to https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService .
MIT License
97 stars 46 forks source link

Add support to `DefaultAzureCredential` authentication via `Azure.Identity` library #269

Closed ilya-git closed 2 years ago

ilya-git commented 2 years ago

Right now the connection string supports Managed Identity like this:

Endpoint={signalr_service_endpoint};AuthType=aad;Version=1.0;

This is very nice and useful, but the problem is that for local development I would still have to revert to AccessKey and cannot use e.g. Azure CLI or Environment variables authentication that Azure.Identity provides via DefaultAzureCredential.

It would be very nice if we can have AuthType like aaddefault or some similar way of using it so that we won't need to supply secrets like access key for running locally.

Y-Sindo commented 2 years ago

It is supported in #265 , and will be released in next month.

ilya-git commented 2 years ago

How could it be turned on? Or the existing connection string would just "work"?

By the way if I use this connection string locally there are no errors, everything seems to work, but messages don't come trhough.

Y-Sindo commented 2 years ago

How could it be turned on? Or the existing connection string would just "work"?

It is different with connection string. From the view of JSON, it uses a JSON object instead of one JSON key-value pair to configure a SignalR Service connection. For example, you can use the following configuration to get a DefaultAzureCredential.

{
    "AzureSignalRConnectionString": {
        "serviceUri": "https://{SignalRHost}"
    }
}

Detailed documents will be provided once released.

By the way if I use this connection string locally there are no errors, everything seems to work, but messages don't come trhough.

This is another issue. You could open another issue and give more details about your problem.

ilya-git commented 2 years ago

Thanks for help, I will wait for the release and documentation! I know it is another issue, but since it was never officially supported to do what I tried, it's not very important for me that it gets fixed, just weird that there were no errors :)

Y-Sindo commented 2 years ago

Thanks for help, I will wait for the release and documentation! I know it is another issue, but since it was never officially supported to do what I tried, it's not very important for me that it gets fixed, just weird that there were no errors :)

Thank you for your feedback. The log problem of function environment is indeed mentioned by some users. We will consider provide a trouble shooting guide for this in the future.

Y-Sindo commented 2 years ago

@ilya-git A quick update about the logging problem, you can see Configure Log Level to ger more logs.

Y-Sindo commented 2 years ago

It is supported in v1.6.0