question

davidhwang-6618 avatar image
0 Votes"
davidhwang-6618 asked davidhwang-6618 commented

Farmbeats active directory application problem.


I am receiving this error when installing Farmbeats as an AAD application-

ERROR: Failed to connect to MSI. Please make sure MSI is configured correctly.
Get Token request returned: <Response [400]>
Invoke-RestMethod: /home/david/create_aad_script.ps1:209
Line |
209 | Invoke-RestMethod -Uri $MsGraphRequrl -Method PATCH -Body $PreAuthBo …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {"error":{"code":"InvalidAuthenticationToken","message":"CompactToken parsing failed
| with error code:
| 80049217","innerError":{"date":"2021-09-11T13:55:52","request-id":"02f26127-8106-4b49-8dec-1908050fefde","client-request-id":"02f26127-8106-4b49-8dec-1908050fefde"}}}


I have followed the procedure detailed here-
https://docs.microsoft.com/en-us/azure/industry/agriculture/install-azure-farmbeats#code-try-0

I am installing into the US east region, am the owner of the subscription and the resource group, and am the owner of the tenant.


Any help would be much appreciated!

azure-farmbeats
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @davidhwang-6618 was this error transient or still persists?

0 Votes 0 ·

still there

0 Votes 0 ·

1 Answer

SatishBoddu-MSFT avatar image
0 Votes"
SatishBoddu-MSFT answered davidhwang-6618 commented

Hello @davidhwang-6618 Please try again and let us know if you face any issues.

Your subscription ownership looks good, but it might be an issue with the email or maybe you want to revisit the steps?

I tried the Create AAD application Pre-Req step: Create an AAD application
Below steps I tried from my subscription's Powershell cloud shell.

 wget -q https://aka.ms/FarmBeatsAADScript -O ./create_aad_script.ps1
 cd
 ./create_aad_script.ps1

131256-image.png

Please comment in the below section, happy to help further!




image.png (129.8 KiB)
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Same error-
ERROR: Failed to connect to MSI. Please make sure MSI is configured correctly.
Get Token request returned: <Response [400]>
Invoke-RestMethod: /home/david/create_aad_script.ps1:209
Line |
209 | Invoke-RestMethod -Uri $MsGraphRequrl -Method PATCH -Body $PreAuthBo …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {"error":{"code":"InvalidAuthenticationToken","message":"CompactToken parsing failed
| with error code:
| 80049217","innerError":{"date":"2021-09-12T15:12:14","request-id":"f31c7013-7e0f-4cd1-ba4b-fcb4e3baa1a3","client-request-id":"f31c7013-7e0f-4cd1-ba4b-fcb4e3baa1a3"}}}


Here are the exact steps I took-
Deleted all Resource Groups in my account.
Deleted all users except- dhwang@twentyfortynine.onmicrosoft.com (Owner)
Went to the Create Azure Farmbeats page-
Chose the only available Subscription (I only have one)
Created a new service group named "fertileground"
Chose the EAST US region
Entered the email address- dhwang.twentyfortynine.onmicrosoft.com
Went to the Dependencies page and cwas redirected to- https://docs.microsoft.com/en-us/azure/industry/agriculture/install-azure-farmbeats
Clicked the TRY IT tag and chose to set up a storage account (default parameters).
Ran the following-
wget -q https://aka.ms/FarmBeatsAADScript -O ./create_aad_script.ps1
cd
./create_aad_script.ps1

Abend with the error above.

0 Votes 0 ·

Instead of onmicrosoft.com email id , could you please try with your original user ID like your Gmail id or Outlook email id or your corporate email id with which you have created your Azure Subscription Account?

0 Votes 0 ·

Satish-
Here is an experiment I tried-
Set up a brand new Azure account (dhwang.azure@gmail.com).
Logged into Azure.
Went to the Marketplace and installed Farmbeats following the exact instructions from here-
https://docs.microsoft.com/en-us/azure/industry/agriculture/install-azure-farmbeats#create-an-aad-application

After running these commands in the Cloud Shell instance (storage account was set up using default options)-
wget -q https://aka.ms/FarmBeatsAADScript -O ./create_aad_script.ps1
cd
./create_aad_script.ps1

and entering the following info-
FarmBeats Website Name: hwangtest
Azure login ID: dhwang.azure@gmaail.com
Subscription ID: SUBSCRIPTION ID COPIED FROM SUBCRIPTION INFO PAGE

I get the same error:
ERROR: Failed to connect to MSI. Please make sure MSI is configured correctly.
Get Token request returned: <Response [400]>
Invoke-RestMethod: /home/david/create_aad_script.ps1:209
Line |
209 | Invoke-RestMethod -Uri $MsGraphRequrl -Method PATCH -Body $PreAuthBo …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 Votes 0 ·
Show more comments