@@ -9,128 +9,57 @@ This repository contains a set of PowerShell cmdlets for developers and administ
9
9
10
10
## Features
11
11
12
- * Account
13
- * Get and import Azure publish settings
14
- * Login with Microsoft account or Organizational account through Microsoft Azure Active Directory
12
+ * Account management
13
+ * Login with Microsoft account, Organizational account, or Service Principal through Microsoft Azure Active Directory
14
+ * Save Credentials to disk with Save-AzureRmProfile and load saved credentials using Select-AzureRmProfile
15
15
* Environment
16
16
* Get the different out-of-box Microsoft Azure environments
17
- * Add/Set/Remove customized environments (like your Windows Azure Pack environments)
18
- * Get Azure publish settings for a particular environment
19
- * Subscription
20
- * Manage Azure subscription
21
- * Manage AffinityGroup
22
- * Website
23
- * Manage website, such as CRUD, start and stop.
24
- * Manage slot
25
- * Manage WebJob
26
- * Deploy project via WebDeploy
27
- * Diagnostics
28
- * Configure site and application diagnostics
29
- * Log streaming
30
- * Save log
31
- * Cloud Services
32
- * Create scaffolding for cloud service and role. Role support includes Node.js and PHP.
33
- * Manage cloud service and role, such as CRUD, start and stop.
34
- * Manage extension.
35
- * Start/Stop Azure emulator.
36
- * Manage certificate.
37
- * Manage cloud service extensions
38
- * Remote desktop
39
- * Diagnostics
40
- * Microsoft Antimalware
41
- * Windows Azure Diagnostics
42
- * Storage
43
- * Manage storage account and access key.
44
- * Manage storage container and blob, with paging.
45
- * Copy storage blob.
46
- * Manage storage table.
47
- * Manage storage queue.
48
- * Create SAS token.
49
- * Manage metrics and logging.
50
- * Configure timeout
51
- * SQL Database
52
- * CRUD support for database server, database and firewall rule.
53
- * Get database server quota.
54
- * Get/Set database server service objective.
55
- * Manage database copies and active geo-replication.
56
- * Get dropped databases that can be restored.
57
- * Issue requests to restore a live or dropped database to a point in time.
58
- * Issue requests to recover a database from an unavailable database server.
59
- * Manage database and database server auditing policy.
60
- * Service Bus
61
- * Manage service bus namespaces.
62
- * VM
63
- * Manage VM, such as CRUD, import/export and start/stop/restart.
64
- * Manage VM image and VM image disks.
65
- * Manage disk, such as CRUD.
66
- * Manage VM endpoint, such as CRUD and ACL.
67
- * Get/Set VM sub net.
68
- * Manage certificate and SSH key.
69
- * PowerShell remoting
70
- * Manage extension
71
- * BG Info
72
- * Chef
73
- * Puppet
74
- * Custom Script
75
- * Access
76
- * Microsoft Antimalware
77
- * PowerShell DSC
78
- * Windows Azure Diagnostics
79
- * Public IP, reserved IP and internal load balancer
80
- * Deployment
81
- * Manage deployment, such as CRUD, move, upgrade and restore.
82
- * Get/Create DNS settings of a deployment.
83
- * VNet
84
- * Manage virtual network config, connection and gateway.
85
- * Manage static IP
86
- * Azure Media Services
87
- * Create, read and delete Media Services Accounts
88
- * Generate new account keys for Media Services Accounts
89
- * HDInsight
90
- * Manage clusters, such as CRUD, add/set storage
91
- * Manage jobs, such as CRUD, start/stop/wait/invoke
92
- * Manage HTTP service access. such as grant/revoke
93
- * Store
94
- * View available Microsoft Azure Store Add-On plans.
95
- * Purchase, view, upgrade and remove Microsoft Azure Store Add-On instances.
96
- * Utility
97
- * Test whether a name is available. Currently support cloud service name, storage account name and service bus namespace name.
98
- * Get the list of geo locations supported by Azure.
99
- * Get the list of OS supported by Azure.
100
- * Direct you to Azure portal.
17
+ * Add/Set/Remove customized environments (like your Azure Stack or Windows Azure Pack environments)
18
+ * Management and data plane cmdlets for Azure services in ARM and RDFE
19
+ * VM
20
+ * Storage
21
+ * Network
22
+ * App Service (Websites)
23
+ * SQL Database
24
+ * KeyVault
25
+ * Operational Insights
26
+ * Automation
27
+ * Batch
28
+ * Backup
29
+ * RecoveryServices and SiteRecovery
30
+ * Stream Analytics
31
+ * Traffic Manager
32
+ * DataFactories
33
+ * DNS
34
+ * HDInsight
35
+ * Express Route
36
+ * Scheduler
37
+ * StorSimple
38
+ * Redis Cache
39
+
101
40
* Windows Azure Pack
102
41
* Web Site: CRUD web site, deployment, configure and get log, start/stop/restart/show web site
103
42
* Service Bus: CRD namespace
104
43
* VM: CRUD VM, get OS disk, size profile and VM template, start/stop/restart/suspend/resume VM
105
44
* VNET: CRUD VNET and subnet.
106
45
* Cloud Service: CRUD cloud service.
107
- * ExpressRoute
108
- * Manage dedicated circuit
109
- * Manage BGP peering
110
- * Scheduler
111
- * Manage job collections
112
- * Manage HTTP and storage queue jobs
113
- * Resource Manager
114
- * Manage resource groups and deployments
115
- * Query and download gallery templates
116
- * Manage individual resources
117
- * Traffic Manager
118
- * Manage profiles and endpoints
119
- * Azure Automation
120
- * Manage automation accounts
121
- * Manage automation jobs, runbooks and schedules
46
+ * Windows Azure Stack
47
+ * Azure Stack Administration
48
+ * Storage Servcie Management
49
+
122
50
123
51
For detail descriptions and examples of the cmdlets, type
124
52
* ``` help azure ``` to get all the cmdlets.
125
- * ``` help node-dev``` to get all Node.js development related cmdlets.
126
- * ` ` ` help php-dev` ` ` to get all PHP development related cmdlets.
53
+ * ``` help azurerm ``` to get all the Azure Resource Manaber (ARM) cmdlets.
127
54
* ``` help <cmdlet name> ``` to get the details of a specific cmdlet.
128
55
129
56
## Supported Environments
130
57
131
58
* [ Microsoft Azure] ( http://www.azure.microsoft.com )
59
+ * [ Azure Stack] ( https://azure.microsoft.com/en-us/overview/azure-stack/ )
132
60
* [ Windows Azure Pack] ( http://www.microsoft.com/en-us/server-cloud/windows-azure-pack.aspx )
133
61
* [ Microsoft Azure China] ( http://www.windowsazure.cn/ )
62
+ * [ USGovernment] ( https://azure.microsoft.com/en-us/features/gov/ )
134
63
135
64
## Installation
136
65
@@ -142,27 +71,31 @@ For detail descriptions and examples of the cmdlets, type
142
71
143
72
You can also find the standalone installers for all the versions at [ Downloads] ( https://github.com/Azure/azure-powershell/releases )
144
73
74
+ ### PowerShell Gallery
75
+ 1 . Install [ Windows Management Framework 5 ot PowerShellGet cmdlets] ( https://www.powershellgallery.com/GettingStarted?section=Get%20Started )
76
+ 2 . In an elevated PowerShell session, run ``` Install-Module AzureRM ```
77
+ 3 . run ``` Install-AzureRm ```
78
+ 4 . Top install RDFE cmdlets, run ``` Install-Module Azure ```
79
+
145
80
### Source Code
146
81
147
82
1 . Download the source code from GitHub repo
148
83
2 . Follow the [ Microsoft Azure PowerShell Developer Guide] ( https://github.com/Azure/azure-powershell/wiki/Microsoft-Azure-PowerShell-Developer-Guide )
149
84
150
85
### Supported PowerShell Versions
151
86
152
- * 0.6 .9 or lower
153
- * [Windows PowerShell 2.0 ](http: // technet.microsoft.com/en-us/scriptcenter/dd742419)
154
- * [Windows PowerShell 3.0 ](http: // www.microsoft.com/en-us/download/details.aspx?id=34595)
155
- * 0.6 .10 to higher
156
- * [Windows PowerShell 3.0 ](http: // www.microsoft.com/en-us/download/details.aspx?id=34595)
87
+ * [ Windows Management Framework 3] (http://www.microsoft.com/en-us/download/details.aspx?id=34595 )
88
+ * [ Windows Management Framework 4] (https://www.microsoft.com/en-us/download/details.aspx?id=40855 )
89
+ * [ Windows Management Framework 5] (https://www.microsoft.com/en-us/download/details.aspx?id=50395 )
157
90
158
91
## Get Started
159
92
160
93
In general, following are the steps to start using Microsoft Azure PowerShell
161
94
162
95
* Get yourself authenticated with Microsoft Azure. For details, please check out [ this article] ( http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/ ) .
163
96
* Option 1: Login with your Microsoft account or Organizational account directly from PowerShell. Microsoft Azure Active Directory authentication is used in this case. No management certificate is needed.
164
- * Starting from 0.8 . 6 , you can use ` ` Add- AzureAccount - Credential ` ` to avoid the browser pop up for Organizational account.
165
- * Option 2 : Download and import a publish settings file which contains a management certificate.
97
+ * Starting from 1.0.0 , you can use ``` Add-AzureRmAccount -Credential ` `` to avoid the browser pop up for Organizational account.
98
+ * To use RDFE cmdlets, use ``` Add-AzureAccount ```
166
99
* Use the cmdlets
167
100
168
101
The first step can be different for different environment you are targeting. Following are detail instructions for each supported environment.
@@ -175,46 +108,19 @@ If you use both mechanisms on the same subscription, Microsoft Azure Active Dire
175
108
176
109
``` powershell
177
110
# Pop up an embedded browser control for you to login
178
- Add-AzureAccount
111
+ Add-AzureRmAccount
179
112
180
113
# use the cmdlets to manage your services/applications
181
- New-AzureWebsite -Name mywebsite -Location "West US"
182
- ` ` `
183
-
184
- #### Use publish settings file (Management certificate authentication)
185
-
186
- ` ` ` powershell
187
- # Download a file which contains the publish settings information of your subscription.
188
- # This will open a browser window and ask you to log in to get the file.
189
- Get-AzurePublishSettingsFile
190
-
191
- # Import the file you just downloaded.
192
- # Notice that the file contains credential of your subscription so you don't want to make it public
193
- # (like check in to source control, etc.).
194
- Import-AzurePublishSettingsFile "<file location>"
195
-
196
- # Use the cmdlets to manage your services/applications
197
- New-AzureWebsite -Name mywebsite -Location "West US"
114
+ New-AzureRmResourceGroup -Name myresourceGroup -Location "West US"
198
115
```
199
116
200
117
### Microsoft Azure China
201
118
202
119
``` powershell
203
- # Check the environment supported by your Microsoft Azure PowerShell installation.
204
- Get-AzureEnvironment
205
-
206
- # Download a file which contains the publish settings information of your subscription.
207
- # Use the -Environment parameter to target Microsoft Azure China.
208
- # This will open a browser window and ask you to log in to get the file.
209
- Get-AzurePublishSettingsFile -Environment "AzureChinaCloud"
120
+ Add-AzureRmAccount -EnvironmentName AzureChinaCloud
210
121
211
- # Import the file you just downloaded.
212
- # Notice that the file contains credential of your subscription so you don't want to make it public
213
- # (like check in to source control, etc.).
214
- Import-AzurePublishSettingsFile "<file location>"
215
-
216
- # Use the cmdlets to manage your services/applications
217
- New-AzureWebsite -Name mywebsite -Location "China East"
122
+ # use the cmdlets to manage your services/applications
123
+ New-AzureRmResourceGroup -Name myresourceGroup -Location "Chine East"
218
124
```
219
125
220
126
### Windows Azure Pack
@@ -245,35 +151,21 @@ Import-WAPackPublishSettingsFile "<file location>"
245
151
# Use the cmdlets to manage your services/applications
246
152
New-WAPackWebsite -Name mywebsite
247
153
```
248
- ## 2 Modes
249
-
250
- Starting from 0.8 .0 , we are adding a separate mode for Resource Manager . You can use the following cmdlet to switch between the
251
-
252
- * Service management: cmdlets using the Azure service management API
253
- * Resource manager: cmdlets using the Azure Resource Manager API
254
-
255
- They are not designed to work together.
256
-
257
- ```powershell
258
- Switch-AzureMode AzureServiceManagement
259
- Switch-AzureMode AzureResourceManager
260
- ```
261
154
262
155
## Find Your Way
263
156
264
157
All the cmdlets can be put into 3 categories:
265
158
266
- 1. Cmdlets support both Microsoft Azure and Windows Azure Pack
267
- 2. Cmdlets only support both Microsoft Azure
268
- 3. Cmdlets only support Windows Azure Pack
159
+ 1 . ARM management cmdlets use the noun 'AzureRm' (New-AzureRmResourceGroup, Get-AzureRmVM)
160
+ 2 . Legacy RDFE management cmdlets use the noun ' Azure' (Get-AzureVM)
161
+ 3 . Data plane cmdlets that work in ARM or RDFE use the noun Azure (Get-AzureBlob)
269
162
270
- * For category 1, we are using an "Azure" prefix in the cmdlet name and adding an alias with "WAPack" prefix.
271
- * For category 2, we are using an "Azure" prefix in the cmdlet name.
272
- * For category 2, we are using an "WAPack" prefix in the cmdlet name.
273
163
274
164
So you can use the following cmdlet to find out all the cmdlets for your environment
275
165
276
166
``` powershell
167
+ # Return all the cmdlets for Azure Resource Manager (ARM)
168
+ Get-Command *AzureRm*
277
169
# Return all the cmdlets for Microsoft Azure
278
170
Get-Command *Azure*
279
171
0 commit comments