0

I am running the Azure Billing API sample (ConsoleApp-Billing-Usage) and getting a failure on the acquire token call with the description:

The request body must contain the following parameter: 'client_secret or client_assertion'.

Any help would be appreciated.

Aman Sharma
  • 1,930
  • 1
  • 17
  • 31
Marc
  • 1
  • 1

2 Answers2

0

@Marc - in order to make the call with the console app, you will need to register an application in AAD (instructions here: https://msdn.microsoft.com/en-us/library/azure/dn132599.aspx#BKMK_Adding). Once you register the application in your directory, you can paste the tenant domain name, app ID (client ID) and the secret (client secret) from the azure portal into the console app's app config and that should make it work for you.

0

As @Moinak pointed, you need to setup the authentication appropriately with Azure AD.

I have described all the details of pre-requisites along with alternate methods to authenticate in this blog including a Code Sample: Azure Authentication - Authenticating any Azure API Request in your Application

The method in the Sample you are using is the one which will prompt the end user.

Alternate and more relevant link to follow instructions for that sample is here: Code Samples: Usage API. Follow the section "How To Run This Sample" in that link.

Remi Guan
  • 21,506
  • 17
  • 64
  • 87
Aman Sharma
  • 1,930
  • 1
  • 17
  • 31