Service Bus: reading brokerproperties in _create_message throws ValueError
Line 258 of azure/servicebus/**init**.py is:

  broker_properties = ast.literal_eval(value)

This line often throws ValueError because the 'value' it's trying to eval is not value python (it's valid json).

Here's an example of a value coming from the broker properties from an Azure Service Bus message:

{"DeliveryCount":4,"EnqueuedTimeUtc":"Tue, 15 Apr 2014 20:52:34 GMT","ForcePersistence":false,"LockToken":"9b946475-8e67-4f60-8499-8a4c5cbb7bfc","LockedUntilUtc":"Mon, 18 Aug 2014 08:17:05 GMT","MessageId":"7014fa25dc8c418bb90312de1251d8a5","SequenceNumber":562975,"State":"Active","TimeToLive":604800}

Notice that ForcePersistence is "false", not "False".  This causes ast.literal_eval to fail.

This is a pretty serious bug as valid messages appear to be unreadable by the python azure sdk.  One suggested fix would be to replace line 258 with

  broker_properties = json.loads(value)

That seems to work fine.

diff --git a/azure/servicebus/__init__.py b/azure/servicebus/__init__.py
index 9094b26cb7..eeeb1de146 100644
--- a/azure/servicebus/__init__.py
+++ b/azure/servicebus/__init__.py
@@ -13,6 +13,7 @@
 # limitations under the License.
 #--------------------------------------------------------------------------
 import ast
+import json
 import sys
 
 from datetime import datetime
@@ -255,7 +256,7 @@ def _create_message(response, service_instance):
     # gets all information from respheaders.
     for name, value in response.headers:
         if name.lower() == 'brokerproperties':
-            broker_properties = ast.literal_eval(value)
+            broker_properties = json.loads(value)
         elif name.lower() == 'content-type':
             message_type = value
         elif name.lower() == 'location':
diff --git a/tests/test_servicebusservice.py b/tests/test_servicebusservice.py
index 9ae3c79682..d72448b7be 100644
--- a/tests/test_servicebusservice.py
+++ b/tests/test_servicebusservice.py
@@ -331,6 +331,22 @@ class ServiceBusTest(AzureTestCase):
         self.assertIsNotNone(received_msg)
         self.assertEqual(sent_msg.body, received_msg.body)
 
+    def test_receive_queue_message_with_broker_properties(self):
+        # Assert
+        sent_msg = Message(b'receive message')
+        sent_msg.broker_properties = \\
+            '{"ForcePersistence": false, "Label": "My label" }'
+        self._create_queue_and_send_msg(self.queue_name, sent_msg)
+
+        # Act
+        received_msg = self.sbs.receive_queue_message(self.queue_name, False)
+
+        # Assert
+        self.assertIsNotNone(received_msg)
+        self.assertEqual(sent_msg.body, received_msg.body)
+        self.assertEqual("My label", received_msg.broker_properties['Label'])
+        self.assertEqual(False, received_msg.broker_properties['ForcePersistence'])
+
     def test_receive_queue_message_read_delete_mode_throws_on_delete(self):
         # Assert
         sent_msg = Message(b'receive message')
['tests/test_servicebusservice.py', 'azure/servicebus/__init__.py']