zoukankan      html  css  js  c++  java
  • PowerShell管理Azure

    PowerShell第一次连接Azure
    1.下载Azure SDK,安装azure powershell
    http://azure.microsoft.com/zh-cn/downloads/?rnd=1
    2.下载azure公共设置文件(下载中国版即可,此文件包含一个编码的管理证书。该证书将作为管理你的订阅和相关服务的各个方面的凭据。请将此文件存储在一个安全位置或在使用后将其删除。)
    Get-AzurePublishSettingsFile -Environment "AzureChinaCloud"(中国版)、Get-AzurePublishSettingsFile -Environment "AzureCloud"(国际版)
    3.导入上一步下载的azure公共设置文件,设置完成
    Import-AzurePublishSettingsFile "<file location>"
    4.查看azure上的虚机
    get-azurevm

    1.选择当前使用中的订阅
    Get-AzureSubscription | ? {$_.isDefault -eq $true}|Select-AzureSubscription
    2.选择StorageAccount
    $SAccount = Get-AzureStorageAccount| ? {$_.label -eq "pic"}
    3.选择StorageKey
    $skey = (Get-AzureStorageKey -StorageAccountName "pic").primary
    4.
    $dcontext = New-AzureStorageContext -StorageAccountName "pic" -StorageAccountKey $skey
    5.
    Get-AzureStorageContainer -Context $dContext


    #获取证书
    $subscription = Get-AzureSubscription -ExtendedDetails | ? {$_.IsDefault -eq $true}
    $cert = $subscription.certificate
    $sid = $subscription.SubscriptionId

  • 相关阅读:
    Linux查看密码
    zabbix 邮件报警配置
    Linux 修改zabbix server的web访问端口
    Zabbix 配置监控主机
    Linux 安装zabbix
    Json解析注解 ---@SerializedName
    IntelliJ IDEA 设置背景图片
    @Override is not allowed when implementing interface method
    nginx ------反向代理和负载均衡
    IntelliJ IDEA 性能优化
  • 原文地址:https://www.cnblogs.com/dreamer-fish/p/4670270.html
Copyright © 2011-2022 走看看