Unable to connect to Azure Blockchain Workbench APIs RRS feed

  • Question

  • We are trying to connect to the Blockchain APIs through two ways. One - through Postman and Two - through a react.js mobile application.

    When we tried through Postman - we tried the below links to help guide us :

    • https://github.com/Azure-Samples/blockchain/tree/master/blockchain-workbench/rest-api-samples/postman
    • Authenticate using: https://github.com/Azure-Samples/blockchain/tree/master/blockchain-workbench/auth-samples/postman-user

    However we hit the error : response type 'token' is not enabled for the application. 

    This had an error code of AADSTS700051.  Please help resolve it.


    Wednesday, May 20, 2020 5:37 PM

All replies

  • Hello Rajiv,

    Thanks for reaching out to us!

    We are investigating the issue, will soon get back to you!

    Thanks & Regards ^Satish Boddu -MSFT Azure CXP Community

    Thursday, May 21, 2020 12:07 AM
  • Hello Rajiv Ramanjani,

    Sorry for the much delay in resolution, our team is working on this issue and soon there will be an update. This is taking much longer time than we expected, please be assured that we have a dedicated team working on the resolution. Thanks again for your patience. Please comment further if you have any further questions on this issue.

    Thanks & Regards ^Satish Boddu -MSFT Azure CXP Community

    Monday, June 1, 2020 9:23 PM
  • Hi Ranjiv,

    Sorry you were having trouble accessing Workbench via the APIs.  This sounds like you are having trouble specifically around the access token.  I wanted to walk through a few things to see if maybe we can find where the break is, as there is no break here on Workbench, I just setup a new instance to validate this.

    • After provisioning a new instance of Workbench, you will be given a PowerShell command to run to create the application in AAD.  https://docs.microsoft.com/en-us/azure/blockchain/workbench/deploy#azure-ad-configuration-script  Do this first.
    • Now create a sample application (so we can test later).  Get the JSON and the SOL from here for a sample application.  HelloBlockchain.json and HelloBlockchain.sol.
    • Next you should create a service principal that will access the API.  To do this you can use cloud shell from this page: https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli?view=azure-cli-latest.  You will want to run:  az ad sp create-for-rbac --name abwsp1
    • After creating this sp, you will then need to adjust some permissions for this service principal.  Go to AAD in the Azure Management portal and then to App Registrations.  The new SP, abwsp1, should listed there.  Click on this and then select API permissions under this SP.  Click Add permissions, then My Apis, and select the Application object.  It should be named some like: Azure Blockchain Workbench.  Then click on Application permissions and check the box for Administrator.  After doing this, then you will need to grant admin consent and confirm.
    • The last thing you need to configure is to allow the new service principal access to the api.  You can do this by navigating back to you deployment for workbench, then under your api web app, select Access Control (IAM) in the left navigation and Add a new role assignment, adding the abwsp1 as a contributor.
    • Now back to Postman.  You will need to import the collection.  This collection is here.
    • Then you will need to update a few global parameters to generate the correct access token.  Edit the new collection, click on variables and add you workbench base url.
    • Also, update pre-request script to include your AAD tenant.  Then update the resource to the app id for workbench, the client_id to the abwsp1 id, and the client secret from output when you create abwsp1 (it will look like a guid).

    After that you can then select an API to call, for instance get all applications.  You should see this sample application that you deployed above.

    Thursday, June 4, 2020 6:14 AM
  • Sample output:

    Thursday, June 4, 2020 6:16 AM
  • Additionally, Mahdi wrote up a great walkthrough of this here.  The AAD screens are a little bit dated the flow is the same.  This also demonstrates using the API from an Azure Function.
    Thursday, June 4, 2020 12:22 PM
  • Sign in to the Azure services portal.

    In the left-hand navigation pane, select Resource groups.

    Choose the resource group name your deployed Blockchain Workbench.

    Select the TYPE column heading to sort the list alphabetically by type.

    There are two resources with type App Service. Select the resource of type App Service with the "-api" suffix.

    In the App Service Overview, copy the URL value, which represents the API endpoint URL to your deployed Blockchain Workbench.
    • Edited by Charles-L Thursday, June 4, 2020 3:13 PM
    Thursday, June 4, 2020 3:11 PM
  • Hello Rajiv Ramanjani,

    Please have a look at the above responses and let us know if that resolves your issue.

    Friday, June 5, 2020 9:38 AM