GithubHelp home page GithubHelp logo

azure-helper's Introduction

Azure Helper介绍

Azure Helper @azure_Managerbot可以辅助管理azure账号,进行创建机器,开关机,换IP,删除机器等操作,同时采用多线程的方式批量创建机器,创建n台机器用时1min左右。

Azure Helper创建的机器均为安全组全开、随机用户名、随机密码的机器。

Azure Helper采用rest api进行操作,降低登录开机导致的风控问题,但并不代表可以完全规避风控,请自行决定是否使用。

Azure Helper使用

面板基于rest api进行部署操作,所以我们需要先获取api,获取api目前只可以通过cli进行获取,可以采用azure提供的cloudshell进行获取,也可以通过本地安装的azure cli进行获取,官方教程

通过本地安装cli进行获取

1)windows端:azure cli:https://aka.ms/installazurecliwindows

下载并安装azure提供的cli安装文件安装 打开cmd或者powershell输入 az login --use-device-codeaz login命令进行登录

前者需要手动打开https://aka.ms/devicelogin输入code进行登录,后者会调用默认的浏览器自动打开登录界面,两者各有利弊,前者可以在开号的环境下进行登录操作,而后者更方便,请自行选择。

登录完成之后运行下面命令开通订阅的开机权限以及申请api

:: For cmd
az provider register --namespace Microsoft.Compute && az provider register --namespace Microsoft.Security && az provider register --namespace Microsoft.Network && az provider register --namespace Microsoft.Storage && az provider register --namespace Microsoft.ResourceHealth && az provider register --namespace Microsoft.ChangeAnalysis && az provider register --namespace Microsoft.Advisor && az provider register --namespace Microsoft.PolicyInsights && az provider register --namespace Microsoft.GuestConfiguration  && az ad sp create-for-rbac --role owner
# For powershell
az provider register --namespace Microsoft.Compute
az provider register --namespace Microsoft.Security
az provider register --namespace Microsoft.Network
az provider register --namespace Microsoft.Storage
az provider register --namespace Microsoft.ResourceHealth
az provider register --namespace Microsoft.ChangeAnalysis
az provider register --namespace Microsoft.Advisor
az provider register --namespace Microsoft.PolicyInsights
az provider register --namespace Microsoft.GuestConfiguration
az ad sp create-for-rbac --role owner

获取api结果

2) macOS端:对于 macOS 平台,可以通过 homebrew 包管理器安装 Azure CLI。

如果系统中没有可用的 Homebrew,请先安装 Homebrew,然后继续。

安装 CLI 时,可以先更新 brew 存储库信息,然后运行 install 命令:brew update && brew install azure-cli

后续步骤同windows端

az provider register --namespace Microsoft.Compute && az provider register --namespace Microsoft.Security && az provider register --namespace Microsoft.Network && az provider register --namespace Microsoft.Storage && az provider register --namespace Microsoft.ResourceHealth && az provider register --namespace Microsoft.ChangeAnalysis && az provider register --namespace Microsoft.Advisor && az provider register --namespace Microsoft.PolicyInsights && az provider register --namespace Microsoft.GuestConfiguration  && az ad sp create-for-rbac --role owner

3)Linux端:

(1)使用 apt 安装 Azure CLI

curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

(2)使用 yum 安装 Azure CLI

1.导入 Microsoft 存储库密钥。

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

2.创建本地 azure-cli 存储库信息。

sudo sh -c 'echo -e "[azure-cli]
name=Azure CLI
baseurl=https://packages.microsoft.com/yumrepos/azure-cli
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/azure-cli.repo'

3.使用 yum install 命令安装。

sudo yum install azure-cli

后续步骤同windows端

az provider register --namespace Microsoft.Compute && az provider register --namespace Microsoft.Security && az provider register --namespace Microsoft.Network && az provider register --namespace Microsoft.Storage && az provider register --namespace Microsoft.ResourceHealth && az provider register --namespace Microsoft.ChangeAnalysis && az provider register --namespace Microsoft.Advisor && az provider register --namespace Microsoft.PolicyInsights && az provider register --namespace Microsoft.GuestConfiguration  && az ad sp create-for-rbac --role owner

通过cloudshell进行获取

在azure管理后台打开cloudshell,直接输入命令即可获取api,无需登录操作

az provider register --namespace Microsoft.Compute && az provider register --namespace Microsoft.Security && az provider register --namespace Microsoft.Network && az provider register --namespace Microsoft.Storage && az provider register --namespace Microsoft.ResourceHealth && az provider register --namespace Microsoft.ChangeAnalysis && az provider register --namespace Microsoft.Advisor && az provider register --namespace Microsoft.PolicyInsights && az provider register --namespace Microsoft.GuestConfiguration  && az ad sp create-for-rbac --role owner

note

由于每个订阅在第一次开机之前都需要先申请有关权限,也就是命令中的az provider register --namespace相关部分,而这一操作是需要一点时间的,所以在获取api之后需要等几分钟再去bot中开机,不然在创建机器时会报错。

参考文档/故障排除:Azure cli

授权码:

EHqhJBrjSoEGkHUnxyVPPTIN nHEGCKBkottvoaEgdUlNsvmI LtflPAzPoqpVjsvcWypsTkYj KCbIbwgUjCLRLQNEgYEKhkWq fKnkVWMVDXPMsZalfynUxagS xDxFpMfYKLsbnrFSfhEvBjIQ vBsbLIDWbaOrVMPuxWbqIioC EWDcQENywkTLnnXDTVMvmOLr BUBAeyxVMjgGHxSSWRwaGYjm DhfxopwbfWSyblYtSaWVYQTM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.