title: Python Azure sdk: How to retrieve secrets from keyvault?
body: <p>I need to retrieve secrets from keyvault. This is my code so far:</p>
  
  <pre><code>from azure.mgmt.keyvault import KeyVaultManagementClient
  from azure.common.credentials import ServicePrincipalCredentials
  
  
  subscription_id = 'x'
  # See above for details on creating different types of AAD credentials
  credentials = ServicePrincipalCredentials(
      client_id = 'x',
      secret = 'x',
      tenant = 'x'
  )
  
  kv_client = KeyVaultManagementClient(credentials, subscription_id)
  
  for vault in kv_client.vaults.list():
      print(vault)
  </code></pre>
  
  <p>But I am getting this error:</p>
  
  <blockquote>
    <p>msrestazure.azure_exceptions.CloudError: Azure Error:
    AuthorizationFailed Message: The client 'x' with object id 'x' does
    not have authorization to perform action
    'Microsoft.Resources/subscriptions/resources/read' over scope
    '/subscriptions/x'.</p>
  </blockquote>
  
  <p>Now I am able to access the same keyvault with same credentials using C# code/ POwershell so there is definitely nothing wrong with authorization. Not sure why it isnt working using SDK. Please help.</p>