Skip to content

Commit

Permalink
Merge pull request #1100 from Azure/master
Browse files Browse the repository at this point in the history
Merge master -> dev
  • Loading branch information
markcowl committed Oct 10, 2015
2 parents 11c2382 + 09c3909 commit 38f0e66
Show file tree
Hide file tree
Showing 70 changed files with 434 additions and 195 deletions.
22 changes: 21 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
## 2015.09.03 version 0.9.8
## 2015.10.09 version 1.0 preview
* Azure Resource Manager Management Cmdlets
* New-AzureRmResourceGroup - Removed the template deployment parameters from this cmdlet. Template deployment will now be
handled only through the New-AzureRmResourceGroupDeployment
* 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.
* Get-AzureRmResourceGroup - Removed parameters for finding resources through tags. New cmdlet added for handling this
functionality as mentioned below.
* Find-AzureRmResource - Query against the cache.
* Find-AzureRmResourceGroup - Tag parameter added for querying resource group containing specific tags.
* 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.
* Test-AzureResourceGroup - Cmdlet removed. Will be adding a better and reliable way to achieve this scenario.
* 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.
* Cmdlets added for policy
* New-AzureRmPolicyDefinition, Get-AzureRmPolicyDefinition, Set-AzureRMPolicyDefinition, Remove-AzureRmPolicyDefinition
* New-AzureRmPolicyAssignment, Get-AzureRmPolicyAssignment, Set-AzureRmPolicyAssignment, Remove-AzureRmPolicyAssignment
* Consolidated Log cmdlets
* Removed Get-AzureResourceLog, Get-AzureResourceGroupLog, Get-AzureProviderLog
* Added new cmdlet Get-AzureLog which you can use to obtain logs at different scopes like resource group, resource, provider.
* Removed Get-AzureLocation - the functionality is now provided through the Get-AzureRmResourceProvider

## 2015.09.03 version 0.9.8
* Azure Redis Cache cmdlets
* New-AzureRMRedisCache - 'RedisVersion' parameter is deprecated.
* Azure Compute (ARM) Cmdlets
Expand Down
1 change: 1 addition & 0 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft*Azure*Commands*.dll" />
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" />
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.ps1" />
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.psm1" />
</ItemGroup>

<Message Importance="high" Text="$(LibrarySourceFolder)\Package\$(Configuration) does not contains any files to sign. Code sign will skip."
Expand Down
2 changes: 0 additions & 2 deletions setup-powershellget/Setup/ShortcutStartup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ To use Azure Service Management cmdlets please execute the following cmdlet:
Install-Module Azure
"@
Write-Output $welcomeMessage

$VerbosePreference = "Continue"
}
}
catch
Expand Down
2 changes: 1 addition & 1 deletion setup-powershellget/azurecmd.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>

<?define version="0.10.0" ?>
<?define version="1.0.0" ?>
<?define versionedStartMenuFolder="Microsoft Azure" ?>
<?define staleStartMenuFolder="Windows Azure" ?>

Expand Down
60 changes: 60 additions & 0 deletions src/Common/Commands.Common/AzureSubscriptionExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.Common.Authentication.Models;

namespace Microsoft.WindowsAzure.Commands.Common
{
public static class AzureSubscriptionExtensions
{

public static string GetStorageAccountName(this AzureSubscription subscription)
{
if (subscription == null || !subscription.IsPropertySet(AzureSubscription.Property.StorageAccount))
{
return null;
}

var result = subscription.GetProperty(AzureSubscription.Property.StorageAccount);
if (!string.IsNullOrWhiteSpace(result))
{
try
{
var pairs = result.Split(new char[]{';'}, StringSplitOptions.RemoveEmptyEntries);
foreach (var pair in pairs)
{
var sides = pair.Split(new char[] {'='}, 2, StringSplitOptions.RemoveEmptyEntries);
if (string.Equals("AccountName", sides[0].Trim(), StringComparison.OrdinalIgnoreCase))
{
result = sides[1].Trim();
break;
}
}
}
catch
{
// if there are any errors, return the unchanged account name
}
}

return result;
}

}
}
1 change: 1 addition & 0 deletions src/Common/Commands.Common/Commands.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
<Compile Include="AzurePowerShell.cs" />
<Compile Include="AzureRmProfileProvider.cs" />
<Compile Include="AzureSMProfileProvder.cs" />
<Compile Include="AzureSubscriptionExtensions.cs" />
<Compile Include="Constants.cs" />
<Compile Include="ContextExtensions.cs" />
<Compile Include="IProfileProvider.cs" />
Expand Down
1 change: 0 additions & 1 deletion src/Common/Commands.Common/GeneralUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,5 @@ public static void ClearCurrentStorageAccount(bool clearSMContext = false)
}
}
}

}
}
6 changes: 3 additions & 3 deletions src/Common/Storage/Azure.Storage.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@{

# Version number of this module.
ModuleVersion = '0.9.10'
ModuleVersion = '0.10.0'

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

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

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

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

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
Expand Down
6 changes: 3 additions & 3 deletions src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@{

# Version number of this module.
ModuleVersion = '0.9.10'
ModuleVersion = '0.10.0'

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

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

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

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

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
Expand Down
6 changes: 3 additions & 3 deletions src/ResourceManager/Automation/AzureRM.Automation.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@{

# Version number of this module.
ModuleVersion = '0.9.10'
ModuleVersion = '0.10.0'

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

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

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

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

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
Expand Down
6 changes: 3 additions & 3 deletions src/ResourceManager/AzureBackup/AzureRM.Backup.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@{

# Version number of this module.
ModuleVersion = '0.9.10'
ModuleVersion = '0.10.0'

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

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

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

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

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
Expand Down
6 changes: 3 additions & 3 deletions src/ResourceManager/AzureBatch/AzureRM.Batch.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@{

# Version number of this module.
ModuleVersion = '0.9.10'
ModuleVersion = '0.10.0'

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

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

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

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

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
using System;
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Linq;
using Microsoft.Azure.Common.Authentication;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ static AzureRMCmdlet()
}
}

/// <summary>
/// Creates new instance from AzureRMCmdlet and add the RPRegistration handler.
/// </summary>
public AzureRMCmdlet()
{
AzureSession.ClientFactory.RemoveHandler(typeof(RPRegistrationDelegatingHandler));
AzureSession.ClientFactory.AddHandler(new RPRegistrationDelegatingHandler(
() => AzureSession.ClientFactory.CreateClient<ResourceManagementClient>(DefaultContext, AzureEnvironment.Endpoint.ResourceManager),
() => new ResourceManagementClient(
AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(DefaultContext, AzureEnvironment.Endpoint.ResourceManager),
DefaultContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager)),
s => _debugMessages.Enqueue(s)));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.Commands.ResourceManager.Common.Properties;
using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.IdentityModel.Clients.ActiveDirectory;

namespace Microsoft.Azure.Commands.ResourceManager.Common
{
public static class AzureRMProfileExtensions
{
/// <summary>
/// Set the context for the current profile, preserving token cache information
/// </summary>
/// <param name="profile">The profile to change the context for</param>
/// <param name="newContext">The new context, with no token cache information.</param>
public static void SetContextWithCache(this AzureRMProfile profile, AzureContext newContext)
{
if (profile == null)
{
throw new ArgumentNullException("profile", Resources.ProfileCannotBeNull);
}

if (newContext == null)
{
throw new ArgumentNullException("newContext", Resources.ContextCannotBeNull);
}

newContext.TokenCache = TokenCache.DefaultShared.Serialize();
profile.Context = newContext;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
<ItemGroup>
<Compile Include="AccessTokenExtensions.cs" />
<Compile Include="AzureRmCmdlet.cs" />
<Compile Include="AzureRMProfileExtensions.cs" />
<Compile Include="Generated\AuthorizationClient.cs" />
<Compile Include="Generated\AuthorizationClientExtensions.cs" />
<Compile Include="Generated\DeploymentOperationOperations.cs" />
Expand Down
Loading

0 comments on commit 38f0e66

Please sign in to comment.