79451858

Date: 2025-02-19 15:14:04
Score: 1.5
Natty:
Report link

You can get the access token by executing normal HTTP request using HttpClient:

var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("https://login.microsoftonline.com/<your_tenant_id>/oauth2/v2.0/token"),
    Content = new FormUrlEncodedContent(new Dictionary<string, string>
    {
        { "client_id", "<your_client_id>" },
        { "scope", "https://analysis.windows.net/powerbi/api/.default" },
        { "client_secret", "<your_client_secret>" },
        { "grant_type", "client_credentials" },
    }),
};

Reference: https://kalcancode.wordpress.com/2025/02/18/powerbiclient-how-to-get-access-token/

Reasons:
  • Probably link only (1):
  • Contains signature (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: kal