Hi,
I've constructed an AWS lambda function which is used to auto rotate my Service Principal Secret in the Databricks account.
Authentication is setup with OAuth2, the api call for the token generation is successful but when executing the api call to create secret it fails with Bad Request
Below is a result tested using Postman. I've masked the account_id and client_id.
POST https://accounts.cloud.databricks.com/api/2.0/accounts/q243434j-mock-121k-23kj-342131kjhhh3/serviceP...
Headers
Authorisation: Bearer jsdjshadadhashd348795h235i52ih35i2h5...
Content-Type: application/json
Body
{
"lifetime": "31536000s"
}
{"error_code":"BAD_REQUEST","message":"Invalid service principal id 'q243434j-t373-121k-23kj-342131kjhhh3'","details":[{"@type":"type.googleapis.com/google.rpc.RequestInfo","request_id":"728394h-mock-40b1-86ce-1d1991u91283","serving_data":""}]}
The SP client_id was quadruple checked. Any assistance would be appreciated.