title: "encoding with 'idna' codec failed (UnicodeError: label too long)" when I call the following django api code to upload a file to Azure Blob Storage
body: <pre><code>import os
  
  from azure.storage.blob import BlockBlobService, baseblobservice
  from django.http import JsonResponse
  from rest_framework.decorators import api_view
  
  
  @api_view(['GET', 'POST'])
  def upload_to_blob(request):
      try:
          container_name = 'xyzxyzxyz'
          connection_string = "DefaultEndpointsProtocol=https;AccountName=dapblobstorage;AccountKey=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh==;"
          local_file_path = "D:\Work\\uploadToBLOB API\\test\\a4.csv"
          upload_location = "kuldeep/api"
  
          block_blob_service = BlockBlobService(connection_string)
  
          if os.path.exists(local_file_path):
              block_blob_service.create_blob_from_path(container_name=container_name
                                                      , blob_name=(upload_location.strip('/') + '/' + os.path.basename(local_file_path))
                                                      , file_path=local_file_path)
  
          return JsonResponse({'message': f'{os.path.basename(local_file_path)} uploaded successfully!'}, status=200, safe=False)
      except Exception as err:
          loggers.error(err, exc_info=True)
          return JsonResponse({'message': f'File upload failed with error - {err}'}, status=500, safe=False)
  
  </code></pre>
  
  <p>Response : {"message": "File upload failed with error - encoding with 'idna' codec failed (UnicodeError: label too long)"}</p>
  
  <p>Please Help!</p>