Esse código faz a publicação de um arquivo .PBIX no serviço web do Power BI atráves da Rest API.
Para conseguir os dados para preencher as variáveis client_id e client_secret, basta criar um app no azure active directory seguindo essa documentação: https://docs.microsoft.com/pt-br/power-bi/developer/embedded/register-app