Python Operation Azure Virtual machine

Source: Internet
Author: User

Python operation Azure Virtual machine download Microsoft's Python SDK
pip install azure

However, the default azure interface is azure not valid for domestic, the modified Python27\Lib\site-packages\azure\__init__.py file points toChina Azure

The source files are as follows:

# Live ServiceClient URLs‘.blob.core.windows.net‘‘.queue.core.windows.net‘‘.table.core.windows.net‘‘.servicebus.windows.net‘‘management.core.windows.net‘

Modified to:

# Live ServiceClient URLs‘.blob.core.chinacloudapi.cn‘‘.queue.core.chinacloudapi.cn‘‘.table.core.chinacloudapi.cn‘‘.servicebus.chinacloudapi.cn‘‘management.core.chinacloudapi.cn‘
Start and stop a virtual machine
fromimport‘xxxxxxxx‘# 订阅ID‘xxxxxxxx‘# pem 证书路径sms = ServiceManagementService(subscription_id, certificate_path)sms.shutdown_role(‘orange‘‘oranged‘‘oranged‘, post_shutdown_action=‘Stopped‘)sms.start_role(‘xxx‘‘xxx‘‘xxx‘)
LinuxMacCommand line Generation azureCertificate
365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pemopenssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer

Once the certificate is uploaded cer to the console certificate management, it can be manipulated in the code azure .

Python Operation Azure Virtual machine

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.