It looks like there may be a problem with the way the access token is being used in the Azure DevOps pipeline. Here are a few things you can try to troubleshoot the issue:
- Verify the scope of the token: Make sure the personal access token (PAT) has the necessary scope to perform the operation you're attempting. In Databricks, you can check the token's scope by going to the user settings and clicking on "Access Tokens". Ensure that the token has the necessary scopes to perform the PATCH operation.
- Verify the connection: Check the connection between Azure DevOps and Databricks. Go to the "Service connections" page in Azure DevOps and make sure the connection is active and has the correct credentials.
- Verify the headers: You can add a task to the pipeline that prints out the headers being sent to Databricks. This can help you identify if the headers are being properly set in the pipeline. You can use a command-line task to run the "curl" command with the appropriate options to print out the headers.
- Check the Databricks logs: Check the Databricks logs to see if there are any error messages that indicate why the access token is invalid.
- Check for IP restrictions: Ensure that IP access limits are not enabled on the Databricks workspace. If it is enabled, make sure that the IP address of the Azure DevOps agent is included in the whitelist.
I hope this helps you troubleshoot the issue. Let me know if you have any further questions!