utils Module

Functions

create_sas_token

Create a SAS token.

create_sas_token(key_name, shared_access_key, scope, expiry=datetime.timedelta(seconds=3600))

Parameters

key_name
bytes
Required

The username/key name/policy name for the token.

shared_access_key
bytes
Required

The shared access key to generate the token from.

scope
bytes
Required

The token permissions scope.

expiry
timedelta
default value: 1:00:00

The lifetime of the generated token. Default is 1 hour.

Return type

data_factory

Wrap a Python type in the equivalent C AMQP type. If the Python type has already been wrapped in a ~uamqp.types.AMQPType object - then this will be used to select the appropriate C type.

  • bool => c_uamqp.BoolValue
  • int => c_uamqp.IntValue, LongValue, DoubleValue
  • str => c_uamqp.StringValue
  • bytes => c_uamqp.BinaryValue
  • list/set/tuple => c_uamqp.ListValue
  • dict => c_uamqp.DictValue (AMQP map)
  • float => c_uamqp.DoubleValue
  • uuid.UUID => c_uamqp.UUIDValue
data_factory(value, encoding='UTF-8')

Parameters

value
AMQPType
Required

The value to wrap.

encoding
default value: UTF-8

Return type

get_running_loop

get_running_loop()

parse_connection_string

Parse a connection string such as those provided by the Azure portal. Connection string should be formatted like: Key=Value;Key=Value;Key=Value. The connection string will be parsed into a dictionary.

parse_connection_string(connect_str)

Parameters

connect_str
str
Required

The connection string.

Return type