Skip to content

Commit 3b46bef

Browse files
committed
Merge remote-tracking branch 'refs/remotes/Azure/dev' into dev
2 parents 113634e + 3d592ee commit 3b46bef

File tree

183 files changed

+21043
-24516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+21043
-24516
lines changed

ChangeLog.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,38 @@
11
##2016.06.04 version 1.5.0
2+
* Azure Resource Manager
3+
- (Get/Set/New/Remove)-AzureRmResourceGroup cmdlets will now use the new autorest generated ARM assembly
4+
- (Get/New/Remove)-AzureRmResourceGroupDeployment cmdlets will now use the new autorest generated ARM assembly
5+
- (Get/Register)-AzureRmProviderFeature cmdlets will now use the new autorest generated ARM assembly
6+
- (Get/Register/Unregister)-AzureRmResourceProvider cmdlets will now use the new autorest generated ARM assembly
7+
- Use a constant backoff interval when polling for deployment progress in New-AzureRmResourceGroupDeployment cmdlet
8+
- Add support to specify file share paths for cmdlets that take input file as parameter
9+
- Improve error message when Move-AzureRmResource cmdlet fails
10+
- Improve error message when New-AzureRmResourceGroupDeployment cmdlet fails
11+
- Enable object and array type parameters for template deployment
12+
- Preserve casing for resource properties in New/Set-AzureRmResource cmdlet
13+
- PropertyObject parameter is now optional in New-AzureRmResource cmdlet
214
* Azure Storage
315
* Fix get Storage Account throttling failures when run it on subscription with many accounts
416
- Get-AzureRmStorageAccount
517
- Get-AzureStorageAccount
18+
* Azure Batch
19+
* Added Batch account usage cmdlets
20+
- Get-BatchPoolUsageMetrics
21+
- Get-BatchPoolStatistics
22+
- Get-BatchJobStatistics
23+
* Added application packages and task dependencies cmdlets
24+
- Get-AzureRmBatchApplication
25+
- Get-AzureRmBatchApplicationPackage
26+
- New-AzureRmBatchApplication
27+
- New-AzureRmBatchApplicationPackage
28+
- Set-AzureRmBatchApplication
29+
- Remove-AzureRmBatchApplicationPackage
30+
- Remove-AzureRmBatchApplication
31+
* Added bulk task option to New-AzureBatchTask cmdlet
32+
633
##2016.05.04 version 1.4.0
734
* Azure Resource Manager
8-
- Get-AzureRmLocation cmdley: New cmdlet Lists all public Azure locatiosn with available provider namespaces
35+
- Get-AzureRmLocation cmdlet: New cmdlet Lists all public Azure locatiosn with available provider namespaces
936
- Get-AzureRMResourceGroupDeploymentOperations: Improved output format
1037
- Get-AzureRMDeployment: Responses contain all error details
1138
- Added cmdlet help anbd examples

setup/azurecmdfiles.wxi

Lines changed: 83 additions & 7 deletions
Large diffs are not rendered by default.

src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@
180180
</ProjectReference>
181181
</ItemGroup>
182182
<ItemGroup>
183+
<None Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\AzureRM.Resources.ps1">
184+
<Link>ScenarioTests\AzureRM.Resources.ps1</Link>
185+
</None>
183186
<None Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\AzureRM.Storage.ps1">
184187
<Link>ScenarioTests\AzureRM.Storage.ps1</Link>
185188
</None>

src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/ScenarioTests/ApiManagementTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ private void RunPowerShellTest(params string[] scripts)
177177
_helper.RMResourceModule,
178178
_helper.RMStorageDataPlaneModule,
179179
_helper.GetRMModulePath("AzureRM.ApiManagement.psd1"),
180-
"AzureRM.Storage.ps1");
180+
"AzureRM.Storage.ps1",
181+
"AzureRM.Resources.ps1");
181182

182183
_helper.RunPowerShellTest(scripts);
183184
}

src/ResourceManager/AzureBatch/Commands.Batch.Test/Commands.Batch.Test.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@
274274
<Compile Include="Tasks\StopBatchTaskCommandTests.cs" />
275275
</ItemGroup>
276276
<ItemGroup>
277+
<None Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\AzureRM.Resources.ps1">
278+
<Link>ScenarioTests\AzureRM.Resources.ps1</Link>
279+
</None>
277280
<None Include="MSSharedLibKey.snk" />
278281
<None Include="packages.config">
279282
<SubType>Designer</SubType>

src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/BatchController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ public void RunPsTestWorkflow(
107107
"Microsoft.Azure.Commands.Batch.Test.dll",
108108
helper.RMProfileModule,
109109
helper.RMResourceModule,
110-
helper.GetRMModulePath("AzureRM.Batch.psd1"));
110+
helper.GetRMModulePath("AzureRM.Batch.psd1"),
111+
"AzureRM.Resources.ps1");
111112

112113
try
113114
{

src/ResourceManager/Cdn/Commands.Cdn.Test/Commands.Cdn.Test.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@
124124
</Reference>
125125
</ItemGroup>
126126
<ItemGroup>
127+
<None Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\AzureRM.Resources.ps1">
128+
<Link>ScenarioTests\AzureRM.Resources.ps1</Link>
129+
</None>
127130
<None Include="MSSharedLibKey.snk" />
128131
<None Include="packages.config">
129132
<SubType>Designer</SubType>

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/TestController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ public void RunPsTestWorkflow(
136136
"ScenarioTests\\" + callingClassName + ".ps1",
137137
_helper.RMProfileModule,
138138
_helper.RMResourceModule,
139-
@"AzureRM.Cdn.psd1");
139+
@"AzureRM.Cdn.psd1",
140+
"AzureRM.Resources.ps1");
140141
try
141142
{
142143
if (scriptBuilder != null)
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
function Get-AzureRmResourceGroup
2+
{
3+
[CmdletBinding()]
4+
param(
5+
[string] [Parameter(Position=0, ValueFromPipelineByPropertyName=$true)] [alias("ResourceGroupName")] $Name,
6+
[string] [Parameter(Position=1, ValueFromPipelineByPropertyName=$true)] $Location,
7+
[string] [Parameter(ValueFromPipelineByPropertyName=$true)] $Id,
8+
[switch] $Force)
9+
BEGIN {
10+
$context = Get-Context
11+
$client = Get-ResourcesClient $context
12+
}
13+
PROCESS {
14+
if($Name -eq $null) {
15+
$getTask = $client.ResourceGroups.ListAsync($null, [System.Threading.CancellationToken]::None)
16+
$rg = $getTask.Result
17+
$resourceGroup = List-ResourceGroup
18+
Write-Output $resourceGroup
19+
} else {
20+
$getTask = $client.ResourceGroups.GetAsync($Name, [System.Threading.CancellationToken]::None)
21+
$rg = $getTask.Result
22+
$resourceGroup = Get-ResourceGroup $Name $Location $rg.ResourceGroup.Id
23+
Write-Output $resourceGroup
24+
}
25+
}
26+
END {}
27+
}
28+
29+
function Get-AzureRmResourceProvider
30+
{
31+
[CmdletBinding()]
32+
param(
33+
[string] [Parameter(Position=0, ValueFromPipelineByPropertyName=$true)] $ProviderNamespace)
34+
BEGIN {
35+
$context = Get-Context
36+
$client = Get-ResourcesClient $context
37+
}
38+
PROCESS {
39+
$getTask = $client.Providers.GetAsync($ProviderNamespace, [System.Threading.CancellationToken]::None)
40+
$pr = $getTask.Result
41+
$provider = Get-Provider $pr.Provider.Namespace
42+
Write-Output $provider
43+
}
44+
END {}
45+
}
46+
47+
function New-AzureRmResourceGroup
48+
{
49+
[CmdletBinding()]
50+
param(
51+
[string] [Parameter(Position=0, ValueFromPipelineByPropertyName=$true)] [alias("ResourceGroupName")] $Name,
52+
[string] [Parameter(Position=1, ValueFromPipelineByPropertyName=$true)] $Location,
53+
[string] [Parameter(ValueFromPipelineByPropertyName=$true)] $Tags,
54+
[switch] $Force)
55+
BEGIN {
56+
$context = Get-Context
57+
$client = Get-ResourcesClient $context
58+
}
59+
PROCESS {
60+
$createParams = New-Object -Type Microsoft.Azure.Management.Resources.Models.ResourceGroup
61+
$createParams.Location = $Location
62+
$createTask = $client.ResourceGroups.CreateOrUpdateAsync($Name, $createParams, [System.Threading.CancellationToken]::None)
63+
$rg = $createTask.Result
64+
$resourceGroup = Get-ResourceGroup $Name $Location
65+
Write-Output $resourceGroup
66+
}
67+
END {}
68+
}
69+
70+
function New-AzureRmResourceGroupDeployment
71+
{
72+
[CmdletBinding()]
73+
param(
74+
[string] [alias("ResourceGroupName")] $Name,
75+
[string] $TemplateFile,
76+
[string] $serverName,
77+
[string] $databaseName,
78+
[string] $storageName,
79+
[string] $version,
80+
[string] $EnvLocation,
81+
[string] $administratorLogin,
82+
[switch] $Force)
83+
BEGIN {
84+
$context = Get-Context
85+
$client = Get-ResourcesClient $context
86+
}
87+
PROCESS {
88+
$createParams = New-Object -Type Microsoft.Azure.Management.Resources.Models.Deployment
89+
$createTask = $client.Deployments.CreateOrUpdateAsync($Name, $Name, $createParams, [System.Threading.CancellationToken]::None)
90+
$rg = $createTask.Result
91+
}
92+
END {}
93+
}
94+
95+
function Remove-AzureRmResourceGroup
96+
{
97+
[CmdletBinding()]
98+
param(
99+
[string] [Parameter(Position=0, ValueFromPipelineByPropertyName=$true)] [alias("ResourceGroupName")] $Name,
100+
[switch] $Force)
101+
BEGIN {
102+
$context = Get-Context
103+
$client = Get-ResourcesClient $context
104+
}
105+
PROCESS {
106+
$deleteTask = $client.ResourceGroups.DeleteAsync($Name, [System.Threading.CancellationToken]::None)
107+
$rg = $deleteTask.Result
108+
}
109+
END {}
110+
}
111+
112+
function Get-Context
113+
{
114+
[Microsoft.Azure.Commands.Common.Authentication.Models.AzureContext]$context = $null
115+
$profile = [Microsoft.WindowsAzure.Commands.Common.AzureRmProfileProvider]::Instance.Profile
116+
if ($profile -ne $null)
117+
{
118+
$context = $profile.Context
119+
}
120+
return $context
121+
}
122+
123+
function Get-ResourcesClient
124+
{
125+
param([Microsoft.Azure.Commands.Common.Authentication.Models.AzureContext] $context)
126+
$factory = [Microsoft.Azure.Commands.Common.Authentication.AzureSession]::ClientFactory
127+
[System.Type[]]$types = [Microsoft.Azure.Commands.Common.Authentication.Models.AzureContext], [Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment+Endpoint]
128+
$method = [Microsoft.Azure.Commands.Common.Authentication.IClientFactory].GetMethod("CreateClient", $types)
129+
$closedMethod = $method.MakeGenericMethod([Microsoft.Azure.Management.Resources.ResourceManagementClient])
130+
$arguments = $context, [Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment+Endpoint]::ResourceManager
131+
$client = $closedMethod.Invoke($factory, $arguments)
132+
return $client
133+
}
134+
135+
function Get-ResourceGroup {
136+
param([string] $name, [string] $location, [string] $id)
137+
$rg = New-Object PSObject -Property @{"ResourceGroupName" = $name; "Location" = $location; "ResourceId" = $id}
138+
return $rg
139+
}
140+
141+
function Get-Provider {
142+
param([string] $name)
143+
$rtype = New-Object PSObject -Property @{"ResourceTypeName" = "virtualMachines"; "Locations" = @("East US"); "ApiVersions" = @("2015-01-01"); }
144+
$pr = New-Object PSObject -Property @{"ProviderNamespace" = $name; "RegistrationState" = "Registered"; "Locations" = @("East US"); "ResourceTypes" = $rtype;}
145+
return $pr
146+
}
147+
148+
function List-ResourceGroup {
149+
$rg = New-Object PSObject -Property @{"ResourceGroupName" = $name; "Location" = $location; }
150+
return $rg
151+
}

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/AzureRM.Storage.ps1

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,23 @@ function New-AzureRmStorageAccount
2727
[string] [Parameter(Position=0, ValueFromPipelineByPropertyName=$true)] $ResourceGroupName,
2828
[string] [Parameter(Position=1, ValueFromPipelineByPropertyName=$true)][alias("StorageAccountName")] $Name,
2929
[string] [Parameter(Position=2, ValueFromPipelineByPropertyName=$true)] $Location,
30-
[string] [Parameter(Position=3, ValueFromPipelineByPropertyName=$true)] $Type)
30+
[string] [Parameter(Position=3, ValueFromPipelineByPropertyName=$true)] $typeString)
3131
BEGIN {
3232
$context = Get-Context
3333
$client = Get-StorageClient $context
3434
}
3535
PROCESS {
3636
$createParms = New-Object -Type Microsoft.Azure.Management.Storage.Models.StorageAccountCreateParameters
37-
$createParms.AccountType = [Microsoft.Azure.Management.Storage.Models.AccountType]::StandardLRS
37+
if ($typeString -eq $null)
38+
{
39+
$Type = [Microsoft.Azure.Management.Storage.Models.AccountType]::StandardLRS
40+
}
41+
else
42+
{
43+
$Type = Parse-Type $typeString
44+
}
45+
46+
$createParms.AccountType = $Type
3847
$createParms.Location = $Location
3948
$getTask = $client.StorageAccounts.CreateAsync($ResourceGroupName, $name, $createParms, [System.Threading.CancellationToken]::None)
4049
$sa = $getTask.Result
@@ -43,6 +52,28 @@ function New-AzureRmStorageAccount
4352

4453
}
4554

55+
function Set-AzureRmStorageAccount
56+
{
57+
[CmdletBinding()]
58+
param(
59+
[string] [Parameter(Position=0, ValueFromPipelineByPropertyName=$true)] $ResourceGroupName,
60+
[string] [Parameter(Position=1, ValueFromPipelineByPropertyName=$true)][alias("StorageAccountName")] $Name,
61+
[string] [Parameter(Position=2, ValueFromPipelineByPropertyName=$true)] $Type,
62+
[Hashtable[]] [Parameter(Position=3, ValueFromPipelineByPropertyName=$true)] $Tags)
63+
BEGIN {
64+
$context = Get-Context
65+
$client = Get-StorageClient $context
66+
}
67+
PROCESS {
68+
$createParms = New-Object -Type Microsoft.Azure.Management.Storage.Models.StorageAccountUpdateParameters
69+
$createParms.AccountType = [Microsoft.Azure.Management.Storage.Models.AccountType]::StandardLRS
70+
$getTask = $client.StorageAccounts.UpdateAsync($ResourceGroupName, $Name, $createParms, [System.Threading.CancellationToken]::None)
71+
$sa = $getTask.Result
72+
}
73+
END {}
74+
}
75+
76+
4677
function Get-AzureRmStorageAccountKey
4778
{
4879
[CmdletBinding()]
@@ -91,6 +122,14 @@ function Get-Context
91122
return $context
92123
}
93124

125+
function Parse-Type
126+
{
127+
param([string] $type)
128+
$type = $type.Replace("_", "")
129+
$returnSkuName = [System.Enum]::Parse([Microsoft.Azure.Management.Storage.Models.AccountType], $type)
130+
return $returnSkuName;
131+
}
132+
94133
function Get-StorageClient
95134
{
96135
param([Microsoft.Azure.Commands.Common.Authentication.Models.AzureContext] $context)

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
<Reference Include="Microsoft.Azure.Common.NetFramework">
5050
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
5151
</Reference>
52+
<Reference Include="Microsoft.Azure.Management.ResourceManager">
53+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ResourceManager.1.1.1-preview\lib\net45\Microsoft.Azure.Management.ResourceManager.dll</HintPath>
54+
</Reference>
5255
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5356
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.20.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
5457
<Private>True</Private>
@@ -72,6 +75,9 @@
7275
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.1.0\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
7376
<Private>True</Private>
7477
</Reference>
78+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure">
79+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.1.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
80+
</Reference>
7581
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7682
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.0.1-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
7783
<Private>True</Private>
@@ -145,6 +151,7 @@
145151
<Compile Include="Mocks\MockCommandRuntime.cs" />
146152
<Compile Include="Mocks\MockDeploymentClientFactory.cs" />
147153
<Compile Include="PermissiveRecordMatcherWithApiExclusion.cs" />
154+
<Compile Include="PageExtensions.cs" />
148155
<Compile Include="ProfileClient.cs" />
149156
<Compile Include="PSCmdletExtensions.cs" />
150157
<Compile Include="Constants.cs" />
@@ -162,6 +169,9 @@
162169
<None Include="Assert.ps1">
163170
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
164171
</None>
172+
<None Include="AzureRM.Resources.ps1">
173+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
174+
</None>
165175
<None Include="AzureRM.Storage.ps1">
166176
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
167177
</None>

0 commit comments

Comments
 (0)