Windows Azure already uses Python wrappers

Source: Internet
Author: User
Keywords nbsp; already Microsoft nbsp;
Tags content data developers google google + google+ microsoft platform

Microsoft Project Manager Sriram Krishnan has written a Python wrapper for the Windows Azure data store. Python is one of the languages supported by Windows Azure.

According to Microsoft's Azure Web site, Python is one of the tools and languages supported by Windows Azure:

Windows Azure is an open platform that will support both Microsoft and non-Microsoft languages and environments. Windows Azure welcomes third party tools and languages, such as eclipse,ruby,php and Python ...





millions of of developers around the world use the. NET framework and the Visual Studio development environment. Developers can use the same skills to create cloud-based applications using Visual Studio, writing, testing, and deploying directly with Visual Studio. In the near future developers will be able to deploy applications written in Rubyon rails and python.

Sriram has written a Windows Azure data store wrapper in Python and placed it on the GitHub code base. The following example demonstrates storing and querying data:

conn = wastorageconnection (Devstore_host, Devstore_account, Devstore_secret_key)


for (Container_name,etag, last_modified) in Conn.list_containers ():


Print Container_name


Print ETag


Print last_modified


Conn.create_container ("TestContainer", False)


Conn.put_blob ("TestContainer", "Test", "Hello world!")


print Conn.get_blob ("TestContainer", "Test")

The following example demonstrates logging in:

def _get_auth_header (self, Http_method, path, data, headers):


# as documented at Http://msdn.microsoft.com/en-us/library/dd179428.aspx


string_to_sign = ""

#First element is the method
String_to_sign + + Http_method + new_line

#Second is the optional content MD5
String_to_sign + + New_line

#content Type-this should have been initialized atleast to a blank value
If Headers.has_key ("Content-type"):
String_to_sign + + headers["Content-type"]
String_to_sign + + New_line

# date-we don ' t need to add headers here since the special date storage header
# Synch exists in our implementation
String_to_sign + + New_line

# construct canonicalized storage headers.
# todo:note that this doesn't ' t implement parts of the spec--
# Combining header fields with Mahouve name,
# Unfolding long lines and trimming white MSN around the colon
Ms_headers =[header_key for Header_key in Headers.keys ()
If Header_key.startswith (Prefix_storage_header)]
Ms_headers.sort ()
For Header_key in Ms_headers:
String_to_sign + + "%s:%s%s"% (Header_key, Headers[header_key), New_line)

# ADD canonicalized Resource


string_to_sign + = "/" + Self.account_name + Path


utf8_string_to_sign = Unicode (string_to_sign). Encode ("Utf-8")


hmac_digest = hmac.new (Self.secret_key,


Utf8_string_to_sign,


hashlib.sha256). Digest ()


return base64.encodestring (hmac_digest). Strip ()

Microsoft's Windows Azure program looks like it's going to go beyond what Google offers. Google's app engine currently only supports Python, but Google has plans to support multiple languages in the future.

Python Super-delegates wrapped itself Around Windows Azure

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.