I'm having great difficulty getting the azure auth backend working. Our vault servers have MSI enabled am I'm trying to use that to allow them to talk to Azure, but when I attempt to do a vault write auth/azure/login (with a valid role, jwt, resource_group_name and vm_name), I get an error message back:
Error writing data to auth/azure/login: Error making API request.
URL: PUT
https://127.0.0.1:8200/v1/auth/azure/loginCode: 500. Errors:
* unable to retrieve virtual machine metadata: compute.VirtualMachinesClient#Get: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Status=403 Code="AuthorizationFailed" Message="The client 'XXX' with object id 'YYY' does not have authorization to perform action 'Microsoft.Compute/virtualMachines/read' over scope '/subscriptions/ZZZ/resourceGroups/CCC/providers/Microsoft.Compute/virtualMachines/DDD'."
(I've edited out sensitive parts of the response).
I'm not at all confident that I have correctly configured the AD App part of the config. I'm assuming with this method (MSI) that I don't need to populate the client_id and client_secret parts of the azure auth config. At the moment, I have created an AD App Registration of the type Webapp/API, but I can't work out how to associate my vault servers with it, or add the appropriate permissions to the app (or work out what the appropriate permissions are!).