let Source = () => let Source = Json.Document(Web.Contents("https://login.microsoftonline.com/"&#"TenantId"&"/oauth2/token", [ Headers=[Accept="application/json", ContentType="application/x-www-form-urlencoded"], Content=Text.ToBinary( "grant_type=client_credentials &resource=https://api.loganalytics.io &client_id="&#"LogAnalyticsPrincipalId"&" &client_secret="&#"LogAnalyticsPrincipalSecret" ) ]))[access_token] in Source in Source