zoukankan      html  css  js  c++  java
  • CentOS 7.2 PowerShell下安装Azure Module

    目前Linux版本的PowerShell还是Alpha版本,所以很多功能不能使用。

    比如通过Powershell命令:install-module AzureRM在线安装Azure的Module。但我们可以通过变通的方式实现对Azure组件的安装:

    1. 如前文中所述,安装PowerShell,或者在下载rpm安装包后,用yum安装:

    yum install ./powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm

    2. 安装完成后,创建PowerShell Moudle的安装目录:

    mkdir -p /usr/local/share/powershell/Modules

    3. 进入PowerShell环境:

    powershell

    4. 安装Azure包:

    Install-Package -Name AzureRM.NetCore.Preview -Source https://www.powershellgallery.com/api/v2 -ProviderName NuGet -ExcludeVersion -Destination /usr/local/share/powershell/Modules

    5. Import Azure包:

    Import-Module AzureRM.NetCore.Preview

    下面就可以用Azure的命令进行登录,和管理Azure了:

    Login-AzureRmAccount -EnvironmentName AzureChinaCloud                                                                                      
    VERBOSE: To sign in, use a web browser to open the page https://aka.ms/deviceloginchina. Enter the code xxxxxxxx to authenticate.

    在PC上打开浏览器,出入链接和code,进行用户认证。认证后出现如下信息: Environment : AzureChinaCloud Account : admin
    @xxxx.partner.onmschina.cn TenantId : xxxx SubscriptionId : xxxx SubscriptionName : weiheng1 CurrentStorageAccount :
    通过PowerShell命令得到Azure的ResourceGroup信息:
    Get
    -AzureRmResourceGroup

    ResourceGroupName :
    Default-Networking Location : chinaeast ProvisioningState : Succeeded Tags : ResourceId : /subscriptions/xxxx/resourceGroups/Default-Networking
  • 相关阅读:
    P2679 子串
    线段树优化建边
    P2444 [POI2000]病毒
    P3966 [TJOI2013]单词
    4327: JSOI2012 玄武密码
    UVA1449 Dominating Patterns
    P1250 种树
    P2255 [USACO14JAN]记录奥林比克
    SP283 NAPTIME
    P3436 [POI2006]PRO-Professor Szu
  • 原文地址:https://www.cnblogs.com/hengwei/p/5804139.html
Copyright © 2011-2022 走看看