Skip to content

Commit 38f0e66

Browse files
committed
Merge pull request Azure#1100 from Azure/master
Merge master -> dev
2 parents 11c2382 + 09c3909 commit 38f0e66

File tree

70 files changed

+434
-195
lines changed

Some content is hidden

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

70 files changed

+434
-195
lines changed

ChangeLog.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
1-
## 2015.09.03 version 0.9.8
1+
## 2015.10.09 version 1.0 preview
2+
* Azure Resource Manager Management Cmdlets
3+
* New-AzureRmResourceGroup - Removed the template deployment parameters from this cmdlet. Template deployment will now be
4+
handled only through the New-AzureRmResourceGroupDeployment
5+
* Get-AzureRmResource - Will query directly against the Resource Provider. Removed parameters for tags from here. New cmdlets added for querying against the cache as listed below.
6+
* Get-AzureRmResourceGroup - Removed parameters for finding resources through tags. New cmdlet added for handling this
7+
functionality as mentioned below.
8+
* Find-AzureRmResource - Query against the cache.
9+
* Find-AzureRmResourceGroup - Tag parameter added for querying resource group containing specific tags.
10+
* Test-AzureResource - Cmdlet removed. Will be adding a better and reliable way to achieve this scenario which will be guaranteed to work against all Resource providers.
11+
* Test-AzureResourceGroup - Cmdlet removed. Will be adding a better and reliable way to achieve this scenario.
12+
* Get-AzureRmResourceProvider - This cmdlet has been renamed. Earlier it was called Get-AzureProvider. We have changed the output to include locations. Now you can use this to find out which providers and types are available for certain location.
13+
* Cmdlets added for policy
14+
* New-AzureRmPolicyDefinition, Get-AzureRmPolicyDefinition, Set-AzureRMPolicyDefinition, Remove-AzureRmPolicyDefinition
15+
* New-AzureRmPolicyAssignment, Get-AzureRmPolicyAssignment, Set-AzureRmPolicyAssignment, Remove-AzureRmPolicyAssignment
16+
* Consolidated Log cmdlets
17+
* Removed Get-AzureResourceLog, Get-AzureResourceGroupLog, Get-AzureProviderLog
18+
* Added new cmdlet Get-AzureLog which you can use to obtain logs at different scopes like resource group, resource, provider.
19+
* Removed Get-AzureLocation - the functionality is now provided through the Get-AzureRmResourceProvider
20+
21+
## 2015.09.03 version 0.9.8
222
* Azure Redis Cache cmdlets
323
* New-AzureRMRedisCache - 'RedisVersion' parameter is deprecated.
424
* Azure Compute (ARM) Cmdlets

build.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft*Azure*Commands*.dll" />
215215
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" />
216216
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.ps1" />
217+
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.psm1" />
217218
</ItemGroup>
218219

219220
<Message Importance="high" Text="$(LibrarySourceFolder)\Package\$(Configuration) does not contains any files to sign. Code sign will skip."

setup-powershellget/Setup/ShortcutStartup.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ To use Azure Service Management cmdlets please execute the following cmdlet:
9797
Install-Module Azure
9898
"@
9999
Write-Output $welcomeMessage
100-
101-
$VerbosePreference = "Continue"
102100
}
103101
}
104102
catch

setup-powershellget/azurecmd.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
66
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
77

8-
<?define version="0.10.0" ?>
8+
<?define version="1.0.0" ?>
99
<?define versionedStartMenuFolder="Microsoft Azure" ?>
1010
<?define staleStartMenuFolder="Windows Azure" ?>
1111

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Collections.Generic;
17+
using System.Linq;
18+
using System.Text;
19+
using System.Threading.Tasks;
20+
using Microsoft.Azure.Common.Authentication.Models;
21+
22+
namespace Microsoft.WindowsAzure.Commands.Common
23+
{
24+
public static class AzureSubscriptionExtensions
25+
{
26+
27+
public static string GetStorageAccountName(this AzureSubscription subscription)
28+
{
29+
if (subscription == null || !subscription.IsPropertySet(AzureSubscription.Property.StorageAccount))
30+
{
31+
return null;
32+
}
33+
34+
var result = subscription.GetProperty(AzureSubscription.Property.StorageAccount);
35+
if (!string.IsNullOrWhiteSpace(result))
36+
{
37+
try
38+
{
39+
var pairs = result.Split(new char[]{';'}, StringSplitOptions.RemoveEmptyEntries);
40+
foreach (var pair in pairs)
41+
{
42+
var sides = pair.Split(new char[] {'='}, 2, StringSplitOptions.RemoveEmptyEntries);
43+
if (string.Equals("AccountName", sides[0].Trim(), StringComparison.OrdinalIgnoreCase))
44+
{
45+
result = sides[1].Trim();
46+
break;
47+
}
48+
}
49+
}
50+
catch
51+
{
52+
// if there are any errors, return the unchanged account name
53+
}
54+
}
55+
56+
return result;
57+
}
58+
59+
}
60+
}

src/Common/Commands.Common/Commands.Common.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
<Compile Include="AzurePowerShell.cs" />
149149
<Compile Include="AzureRmProfileProvider.cs" />
150150
<Compile Include="AzureSMProfileProvder.cs" />
151+
<Compile Include="AzureSubscriptionExtensions.cs" />
151152
<Compile Include="Constants.cs" />
152153
<Compile Include="ContextExtensions.cs" />
153154
<Compile Include="IProfileProvider.cs" />

src/Common/Commands.Common/GeneralUtilities.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,5 @@ public static void ClearCurrentStorageAccount(bool clearSMContext = false)
442442
}
443443
}
444444
}
445-
446445
}
447446
}

src/Common/Storage/Azure.Storage.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.9.10'
12+
ModuleVersion = '0.10.0'
1313

1414
# ID used to uniquely identify this module
1515
GUID = '00612bca-fa22-401d-a671-9cc48b010e3b'
@@ -24,7 +24,7 @@ CompanyName = 'Microsoft Corporation'
2424
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
27-
Description = 'Microsoft Azure PowerShell - Storage'
27+
Description = 'Microsoft Azure PowerShell - Storage service cmdlets. Manages blobs, queues, tables and files in Microsoft Azure storage accounts'
2828

2929
# Minimum version of the Windows PowerShell engine required by this module
3030
PowerShellVersion = '3.0'
@@ -45,7 +45,7 @@ CLRVersion='4.0'
4545
ProcessorArchitecture = 'None'
4646

4747
# Modules that must be imported into the global environment prior to importing this module
48-
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
48+
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.10.0'})
4949

5050
# Assemblies that must be loaded prior to importing this module
5151
RequiredAssemblies = @()

src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.9.10'
12+
ModuleVersion = '0.10.0'
1313

1414
# ID used to uniquely identify this module
1515
GUID = 'f875725d-8ce4-423f-a6af-ea880bc63f13'
@@ -24,7 +24,7 @@ CompanyName = 'Microsoft Corporation'
2424
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
27-
Description = 'Microsoft Azure PowerShell - Api Management'
27+
Description = 'Microsoft Azure PowerShell - Api Management service cmdlets for Azure Resource Manager'
2828

2929
# Minimum version of the Windows PowerShell engine required by this module
3030
PowerShellVersion = '3.0'
@@ -45,7 +45,7 @@ CLRVersion='4.0'
4545
ProcessorArchitecture = 'None'
4646

4747
# Modules that must be imported into the global environment prior to importing this module
48-
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
48+
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.10.0'})
4949

5050
# Assemblies that must be loaded prior to importing this module
5151
RequiredAssemblies = @()

src/ResourceManager/Automation/AzureRM.Automation.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.9.10'
12+
ModuleVersion = '0.10.0'
1313

1414
# ID used to uniquely identify this module
1515
GUID = 'bcea1c70-a32b-48c3-a05c-323e1c02f4d3'
@@ -24,7 +24,7 @@ CompanyName = 'Microsoft Corporation'
2424
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
27-
Description = 'Microsoft Azure PowerShell - Automation'
27+
Description = 'Microsoft Azure PowerShell - Automation service cmdlets for Azure Resource Manager'
2828

2929
# Minimum version of the Windows PowerShell engine required by this module
3030
PowerShellVersion = '3.0'
@@ -45,7 +45,7 @@ CLRVersion='4.0'
4545
ProcessorArchitecture = 'None'
4646

4747
# Modules that must be imported into the global environment prior to importing this module
48-
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
48+
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.10.0'})
4949

5050
# Assemblies that must be loaded prior to importing this module
5151
RequiredAssemblies = @()

src/ResourceManager/AzureBackup/AzureRM.Backup.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.9.10'
12+
ModuleVersion = '0.10.0'
1313

1414
# ID used to uniquely identify this module
1515
GUID = '0b1d76f5-a928-4b8f-9c83-df26947568d4'
@@ -24,7 +24,7 @@ CompanyName = 'Microsoft Corporation'
2424
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
27-
Description = 'Microsoft Azure PowerShell - AzureBackup'
27+
Description = 'Microsoft Azure PowerShell - Azure Backup service cmdlets for Azure Resource Manager'
2828

2929
# Minimum version of the Windows PowerShell engine required by this module
3030
PowerShellVersion = '3.0'
@@ -45,7 +45,7 @@ CLRVersion='4.0'
4545
ProcessorArchitecture = 'None'
4646

4747
# Modules that must be imported into the global environment prior to importing this module
48-
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
48+
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.10.0'})
4949

5050
# Assemblies that must be loaded prior to importing this module
5151
RequiredAssemblies = @()

src/ResourceManager/AzureBatch/AzureRM.Batch.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.9.10'
12+
ModuleVersion = '0.10.0'
1313

1414
# ID used to uniquely identify this module
1515
GUID = 'a8f00f40-1c1a-49b5-9db3-24076b75c3cf'
@@ -24,7 +24,7 @@ CompanyName = 'Microsoft Corporation'
2424
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
27-
Description = 'Microsoft Azure PowerShell - Batch'
27+
Description = 'Microsoft Azure PowerShell - Batch service cmdlets for Azure Resource Manager'
2828

2929
# Minimum version of the Windows PowerShell engine required by this module
3030
PowerShellVersion = '3.0'
@@ -45,7 +45,7 @@ CLRVersion='4.0'
4545
ProcessorArchitecture = 'None'
4646

4747
# Modules that must be imported into the global environment prior to importing this module
48-
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
48+
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.10.0'})
4949

5050
# Assemblies that must be loaded prior to importing this module
5151
RequiredAssemblies = @()

src/ResourceManager/Common/Commands.ResourceManager.Common/AccessTokenExtensions.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
using System;
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
216
using System.Linq;
317
using Microsoft.Azure.Common.Authentication;
418

src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMCmdlet.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,16 @@ static AzureRMCmdlet()
4343
}
4444
}
4545

46+
/// <summary>
47+
/// Creates new instance from AzureRMCmdlet and add the RPRegistration handler.
48+
/// </summary>
4649
public AzureRMCmdlet()
4750
{
4851
AzureSession.ClientFactory.RemoveHandler(typeof(RPRegistrationDelegatingHandler));
4952
AzureSession.ClientFactory.AddHandler(new RPRegistrationDelegatingHandler(
50-
() => AzureSession.ClientFactory.CreateClient<ResourceManagementClient>(DefaultContext, AzureEnvironment.Endpoint.ResourceManager),
53+
() => new ResourceManagementClient(
54+
AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(DefaultContext, AzureEnvironment.Endpoint.ResourceManager),
55+
DefaultContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager)),
5156
s => _debugMessages.Enqueue(s)));
5257
}
5358

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Collections.Generic;
17+
using System.Linq;
18+
using System.Text;
19+
using System.Threading.Tasks;
20+
using Microsoft.Azure.Commands.ResourceManager.Common.Properties;
21+
using Microsoft.Azure.Common.Authentication.Models;
22+
using Microsoft.IdentityModel.Clients.ActiveDirectory;
23+
24+
namespace Microsoft.Azure.Commands.ResourceManager.Common
25+
{
26+
public static class AzureRMProfileExtensions
27+
{
28+
/// <summary>
29+
/// Set the context for the current profile, preserving token cache information
30+
/// </summary>
31+
/// <param name="profile">The profile to change the context for</param>
32+
/// <param name="newContext">The new context, with no token cache information.</param>
33+
public static void SetContextWithCache(this AzureRMProfile profile, AzureContext newContext)
34+
{
35+
if (profile == null)
36+
{
37+
throw new ArgumentNullException("profile", Resources.ProfileCannotBeNull);
38+
}
39+
40+
if (newContext == null)
41+
{
42+
throw new ArgumentNullException("newContext", Resources.ContextCannotBeNull);
43+
}
44+
45+
newContext.TokenCache = TokenCache.DefaultShared.Serialize();
46+
profile.Context = newContext;
47+
}
48+
}
49+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
<ItemGroup>
139139
<Compile Include="AccessTokenExtensions.cs" />
140140
<Compile Include="AzureRmCmdlet.cs" />
141+
<Compile Include="AzureRMProfileExtensions.cs" />
141142
<Compile Include="Generated\AuthorizationClient.cs" />
142143
<Compile Include="Generated\AuthorizationClientExtensions.cs" />
143144
<Compile Include="Generated\DeploymentOperationOperations.cs" />

0 commit comments

Comments
 (0)