title: Cannot get access token for Azure Cognitive Services (for tts)
body: <p>I can't seem to get authorization for the Azure cognitive services access token. I'm using the example code (modified to take my key) that the azure team posted to github.</p>
  
  <p>I've gone through the documentation and as far as I can tell I'm doing everything right. I've also used the "Unified Speech Services for free trials" and that also doesn't work.</p>
  
  <pre class="lang-py prettyprint-override"><code>class TextToSpeech(object):
      def __init__(self, subscription_key):
          self.subscription_key = subscription_key
          self.tts = "testing the TTS abilities of Azure using python"
          #self.tts = input("What would you like to convert to speech: ")
          self.timestr = time.strftime("%Y%m%d-%H%M")
          self.access_token = None
  
      '''
      The TTS endpoint requires an access token. This method exchanges your
      subscription key for an access token that is valid for ten minutes.
      '''
      def get_token(self):
          fetch_token_url = "https://eastus.api.cognitive.microsoft.com/sts/v1.0/issuetoken"
          headers = {
              'Ocp-Apim-Subscription-Key': self.subscription_key
          }
          response = requests.post(fetch_token_url, headers=headers)
          self.access_token = str(response.text)
  
  if __name__ == "__main__":
      app = TextToSpeech(subscription_key)
      app.get_token()
  </code></pre>
  
  <p>Here is the output of the access token</p>
  
  <pre class="lang-py prettyprint-override"><code>'{"error":{"code":"401","message": "Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource."}}'
  </code></pre>
  
  <p>What I should be getting is the temporary access token but for some reason I get the above error and I have no idea why.</p>