zoukankan      html  css  js  c++  java
  • 使用 Python 管理 Azure:基础配置

    Azure 提供了丰富的 Python SDK 来对 Azure 进行开发管理,包括使用 Azure 的开源框架在 Azure 上创建 web 应用程序,对 Azure 的虚拟机,存储等进行管理,本系列会简单介绍如何在 ASM 和 ARM 模式下对 Azure 进行管理。

    1.  首先我们需要配置基本的开发环境,得益于 Python 的多平台支持, Azure 也同样提供了 Linux, Windows 和 Mac 的 SDK 版本,让不同平台的 python 开发者都可以快速创建基于 Azure 的应用.

    2. 在开始测试之前,你需要一个 Azure 账号,可以在Azure的官网上申请测试,或者使用 web-direct 的方式付费,如果你的企业已经有了 Azure 账户,请找你的企业管理员获得一个测试账号.安装 Python 目前主要的 Python 版本有2.X系列和3.X系列, 他们在函数功能、写法,使用上都有一些差别,而最主要的是2.x目前最新是2.7.x将会逐步退出舞台,但目前由于使用广泛,所以兼容性比较好,特别是你有一些老的 python 应用,而 python 3.x 是未来的方向,而且逐渐获得了广泛使用,所以没有什么特别的要求,建议使用 Python 3.X 

    3. 下载安装 python:

    4. Python 安装完成以后,可以在 Windows 平台,Linux 平台,Mac 平台,使用 pip 来安装 Azure 的 SDK, 安装之前,记得先升级一下你的 pip 版本:
    python -m pip install --upgrade pip
    5. 安装 Azure 的 SDK:

    Windows 上安装 Azure SDK:

    pip install azure

    Linux 上安装 Azure SDK:

    sudo pip install azure

     

    6. 除了安装标准的 Azure 库之外,如果你还要用 python 开发 storage,servicebus,要开发一些 legacy 的程序,请继续安装如下 module:

    #安装Azure的存储库

    pip install azure-storage

     #安装ARM管理库
    pip install azure-mgmt
     #安装老的ASM管理库
    pip install azure-servicemanagement-legacy
    #安装servicebus的库
    pip install azure-servicebus
    如果,你看到所有上述魔窟都已安装,不妨试验一下升级安装,看看,是否已经安装最新的库了:
    pip install azure-storage –upgrade
    7. 或者,你也可以使用 Web Platform Installer 来安装,他会帮你安装默认的 python和SDK:

    Microsoft Azure SDK for Python 2.7

    Microsoft Azure SDK for Python 3.4

     
    最后的测试,如果各位还有兴趣,可以通过这里来进行查看,也欢迎找我交流。
     
     
  • 相关阅读:
    learning scala view collection
    scala
    learning scala dependency injection
    learning scala implicit class
    learning scala type alise
    learning scala PartialFunction
    learning scala Function Recursive Tail Call
    learning scala Function Composition andThen
    System.Threading.Interlocked.CompareChange使用
    System.Threading.Monitor的使用
  • 原文地址:https://www.cnblogs.com/cbits/p/7494240.html
Copyright © 2011-2022 走看看