diff --git a/ChangeLog.md b/ChangeLog.md
index 30180d017260..64c48979ad09 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -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
diff --git a/build.proj b/build.proj
index 053f39a02271..bfda35c81d8c 100644
--- a/build.proj
+++ b/build.proj
@@ -214,6 +214,7 @@
+
-
+
diff --git a/src/Common/Commands.Common/AzureSubscriptionExtensions.cs b/src/Common/Commands.Common/AzureSubscriptionExtensions.cs
new file mode 100644
index 000000000000..7be35662bc98
--- /dev/null
+++ b/src/Common/Commands.Common/AzureSubscriptionExtensions.cs
@@ -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;
+ }
+
+ }
+}
diff --git a/src/Common/Commands.Common/Commands.Common.csproj b/src/Common/Commands.Common/Commands.Common.csproj
index 9546b1199367..6a2a6519ba57 100644
--- a/src/Common/Commands.Common/Commands.Common.csproj
+++ b/src/Common/Commands.Common/Commands.Common.csproj
@@ -148,6 +148,7 @@
+
diff --git a/src/Common/Commands.Common/GeneralUtilities.cs b/src/Common/Commands.Common/GeneralUtilities.cs
index d76ad5fa229a..ccf454082b35 100644
--- a/src/Common/Commands.Common/GeneralUtilities.cs
+++ b/src/Common/Commands.Common/GeneralUtilities.cs
@@ -442,6 +442,5 @@ public static void ClearCurrentStorageAccount(bool clearSMContext = false)
}
}
}
-
}
}
\ No newline at end of file
diff --git a/src/Common/Storage/Azure.Storage.psd1 b/src/Common/Storage/Azure.Storage.psd1
index 70e49fec200a..c05b65b35313 100644
--- a/src/Common/Storage/Azure.Storage.psd1
+++ b/src/Common/Storage/Azure.Storage.psd1
@@ -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'
@@ -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'
@@ -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 = @()
diff --git a/src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1 b/src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1
index dc100a7d7ed5..1c9d78acc997 100644
--- a/src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1
+++ b/src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1
@@ -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'
@@ -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'
@@ -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 = @()
diff --git a/src/ResourceManager/Automation/AzureRM.Automation.psd1 b/src/ResourceManager/Automation/AzureRM.Automation.psd1
index 7e7f658a4ca9..2eb24fb608e0 100644
--- a/src/ResourceManager/Automation/AzureRM.Automation.psd1
+++ b/src/ResourceManager/Automation/AzureRM.Automation.psd1
@@ -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'
@@ -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'
@@ -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 = @()
diff --git a/src/ResourceManager/AzureBackup/AzureRM.Backup.psd1 b/src/ResourceManager/AzureBackup/AzureRM.Backup.psd1
index 8f9ce8488534..de4a65774490 100644
--- a/src/ResourceManager/AzureBackup/AzureRM.Backup.psd1
+++ b/src/ResourceManager/AzureBackup/AzureRM.Backup.psd1
@@ -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'
@@ -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'
@@ -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 = @()
diff --git a/src/ResourceManager/AzureBatch/AzureRM.Batch.psd1 b/src/ResourceManager/AzureBatch/AzureRM.Batch.psd1
index 18db766319dd..f37c80a0731f 100644
--- a/src/ResourceManager/AzureBatch/AzureRM.Batch.psd1
+++ b/src/ResourceManager/AzureBatch/AzureRM.Batch.psd1
@@ -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'
@@ -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'
@@ -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 = @()
diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/AccessTokenExtensions.cs b/src/ResourceManager/Common/Commands.ResourceManager.Common/AccessTokenExtensions.cs
index b0d2563c5d43..a546769f5940 100644
--- a/src/ResourceManager/Common/Commands.ResourceManager.Common/AccessTokenExtensions.cs
+++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/AccessTokenExtensions.cs
@@ -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;
diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMCmdlet.cs b/src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMCmdlet.cs
index 534e719037ac..2d3ad79efe06 100644
--- a/src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMCmdlet.cs
+++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMCmdlet.cs
@@ -43,11 +43,16 @@ static AzureRMCmdlet()
}
}
+ ///
+ /// Creates new instance from AzureRMCmdlet and add the RPRegistration handler.
+ ///
public AzureRMCmdlet()
{
AzureSession.ClientFactory.RemoveHandler(typeof(RPRegistrationDelegatingHandler));
AzureSession.ClientFactory.AddHandler(new RPRegistrationDelegatingHandler(
- () => AzureSession.ClientFactory.CreateClient(DefaultContext, AzureEnvironment.Endpoint.ResourceManager),
+ () => new ResourceManagementClient(
+ AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(DefaultContext, AzureEnvironment.Endpoint.ResourceManager),
+ DefaultContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager)),
s => _debugMessages.Enqueue(s)));
}
diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMProfileExtensions.cs b/src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMProfileExtensions.cs
new file mode 100644
index 000000000000..e2dc5eed060c
--- /dev/null
+++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMProfileExtensions.cs
@@ -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
+ {
+ ///
+ /// Set the context for the current profile, preserving token cache information
+ ///
+ /// The profile to change the context for
+ /// The new context, with no token cache information.
+ 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;
+ }
+ }
+}
diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj b/src/ResourceManager/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj
index 71534f031656..57f80edf2d29 100644
--- a/src/ResourceManager/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj
+++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj
@@ -138,6 +138,7 @@
+
diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/Resources.Designer.cs b/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/Resources.Designer.cs
index 3622d8e6e313..e8836fe4a665 100644
--- a/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/Resources.Designer.cs
+++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/Resources.Designer.cs
@@ -8,10 +8,10 @@
//
//------------------------------------------------------------------------------
-namespace Microsoft.Azure.Commands.ResourceManager.Common.Properties
-{
-
-
+namespace Microsoft.Azure.Commands.ResourceManager.Common.Properties {
+ using System;
+
+
///
/// A strongly-typed resource class, for looking up localized strings, etc.
///
@@ -60,6 +60,15 @@ internal Resources() {
}
}
+ ///
+ /// Looks up a localized string similar to Context cannot be null. Please log in using Add-AzureRmAccount..
+ ///
+ public static string ContextCannotBeNull {
+ get {
+ return ResourceManager.GetString("ContextCannotBeNull", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Microsoft Azure PowerShell Data Collection Confirmation.
///
@@ -135,6 +144,15 @@ public static string NoSubscriptionFound {
}
}
+ ///
+ /// Looks up a localized string similar to Profile cannot be null. Please run Add-AzureRmAccount..
+ ///
+ public static string ProfileCannotBeNull {
+ get {
+ return ResourceManager.GetString("ProfileCannotBeNull", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Attempting to register resource provider '{0}'.
///
diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/Resources.resx b/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/Resources.resx
index f1be5d7daeec..42973da7336d 100644
--- a/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/Resources.resx
+++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/Properties/Resources.resx
@@ -117,6 +117,9 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Context cannot be null. Please log in using Add-AzureRmAccount.
+
Microsoft Azure PowerShell Data Collection Confirmation
@@ -151,6 +154,9 @@ Select Y to enable data collection [Y/N]:
The provided account {0} does not have access to any subscriptions. Please try logging in with different credentials.
+
+ Profile cannot be null. Please run Add-AzureRmAccount.
+
Attempting to register resource provider '{0}'
diff --git a/src/ResourceManager/Common/Commands.ResourceManager.Common/RPRegistrationDelegatingHandler.cs b/src/ResourceManager/Common/Commands.ResourceManager.Common/RPRegistrationDelegatingHandler.cs
index 4bc45f617e86..62e6f4e8cdca 100644
--- a/src/ResourceManager/Common/Commands.ResourceManager.Common/RPRegistrationDelegatingHandler.cs
+++ b/src/ResourceManager/Common/Commands.ResourceManager.Common/RPRegistrationDelegatingHandler.cs
@@ -48,8 +48,6 @@ public RPRegistrationDelegatingHandler(Func createClie
protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
- ResourceManagementClient = createClient();
-
HttpResponseMessage responseMessage = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
if (IsProviderNotRegistereError(responseMessage))
{
@@ -61,6 +59,7 @@ protected override async Task SendAsync(HttpRequestMessage
registeredProviders.Add(providerName);
try
{
+ ResourceManagementClient = createClient();
writeDebug(string.Format(Resources.ResourceProviderRegisterAttempt, providerName));
ResourceManagementClient.Providers.Register(providerName);
Provider provider = null;
diff --git a/src/ResourceManager/Compute/AzureRM.Compute.psd1 b/src/ResourceManager/Compute/AzureRM.Compute.psd1
index f0b2248dd478..007c20830ef2 100644
--- a/src/ResourceManager/Compute/AzureRM.Compute.psd1
+++ b/src/ResourceManager/Compute/AzureRM.Compute.psd1
@@ -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 = '0a83c907-1ffb-4d87-a492-c65ac7d7ed37'
@@ -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 - Compute'
+Description = 'Microsoft Azure PowerShell - Compute service cmdlets for Azure Resource Manager. Manages virtual machines, hosted services, and related resources in Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/DataFactories/AzureRM.DataFactories.psd1 b/src/ResourceManager/DataFactories/AzureRM.DataFactories.psd1
index df860e6e8271..1e187935a9ba 100644
--- a/src/ResourceManager/DataFactories/AzureRM.DataFactories.psd1
+++ b/src/ResourceManager/DataFactories/AzureRM.DataFactories.psd1
@@ -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 = 'e3c0f6bc-fe96-41a0-88f4-5e490a91f05d'
@@ -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 - DataFactories'
+Description = 'Microsoft Azure PowerShell - DataFactories service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/Dns/AzureRM.Dns.psd1 b/src/ResourceManager/Dns/AzureRM.Dns.psd1
index a40559d1082b..b5c380a00ee3 100644
--- a/src/ResourceManager/Dns/AzureRM.Dns.psd1
+++ b/src/ResourceManager/Dns/AzureRM.Dns.psd1
@@ -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 = '5e5ed8bc-27bf-4380-9de1-4b22ba0920b2'
@@ -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 - Dns'
+Description = 'Microsoft Azure PowerShell - Dns service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/HDInsight/AzureRM.HDInsight.psd1 b/src/ResourceManager/HDInsight/AzureRM.HDInsight.psd1
index ee47bdce76c0..e7c2987b6e5a 100644
--- a/src/ResourceManager/HDInsight/AzureRM.HDInsight.psd1
+++ b/src/ResourceManager/HDInsight/AzureRM.HDInsight.psd1
@@ -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 = '3fd1475f-cb23-4ffb-bf08-33d94b7d1acb'
@@ -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 - HDInsight'
+Description = 'Microsoft Azure PowerShell - HDInsight service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/Insights/AzureRM.Insights.psd1 b/src/ResourceManager/Insights/AzureRM.Insights.psd1
index 2884dec6e8c4..09964ef0e789 100644
--- a/src/ResourceManager/Insights/AzureRM.Insights.psd1
+++ b/src/ResourceManager/Insights/AzureRM.Insights.psd1
@@ -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 = '698c387c-bd6b-41c6-82ce-721f1ef39548'
@@ -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 - Insights'
+Description = 'Microsoft Azure PowerShell - Insights service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/KeyVault/AzureRM.KeyVault.psd1 b/src/ResourceManager/KeyVault/AzureRM.KeyVault.psd1
index 3641951f0667..a0e053c3cfef 100644
--- a/src/ResourceManager/KeyVault/AzureRM.KeyVault.psd1
+++ b/src/ResourceManager/KeyVault/AzureRM.KeyVault.psd1
@@ -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 = 'fa236c1f-6464-4d6a-a48d-db47c0e7923d'
@@ -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 - KeyVault'
+Description = 'Microsoft Azure PowerShell - KeyVault service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/AddAzureKeyVaultKey.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/AddAzureKeyVaultKey.cs
index 947528113132..254ef0f98653 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/AddAzureKeyVaultKey.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/AddAzureKeyVaultKey.cs
@@ -34,7 +34,7 @@ namespace Microsoft.Azure.Commands.KeyVault
/// 4 .Create a HSM or software key by importing key material with given key
/// attributes
///
- [Cmdlet(VerbsCommon.Add, "AzureRmKeyVaultKey",
+ [Cmdlet(VerbsCommon.Add, "AzureKeyVaultKey",
DefaultParameterSetName = CreateParameterSet,
HelpUri = Constants.KeyVaultHelpUri)]
[OutputType(typeof(KeyBundle))]
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultKey.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultKey.cs
index 93fcf472b4cc..29f82674b41d 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultKey.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultKey.cs
@@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.KeyVault
///
/// Requests that a backup of the specified key be downloaded and stored to a file
///
- [Cmdlet(VerbsData.Backup, "AzureRmKeyVaultKey", HelpUri = Constants.KeyVaultHelpUri)]
+ [Cmdlet(VerbsData.Backup, "AzureKeyVaultKey", HelpUri = Constants.KeyVaultHelpUri)]
[OutputType(typeof(String))]
public class BackupAzureKeyVaultKey : KeyVaultCmdletBase
{
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/GetAzureKeyVaultKey.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/GetAzureKeyVaultKey.cs
index 79a1966e4bac..2623d9579d52 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/GetAzureKeyVaultKey.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/GetAzureKeyVaultKey.cs
@@ -21,7 +21,7 @@
namespace Microsoft.Azure.Commands.KeyVault
{
- [Cmdlet(VerbsCommon.Get, "AzureRmKeyVaultKey",
+ [Cmdlet(VerbsCommon.Get, "AzureKeyVaultKey",
DefaultParameterSetName = ByVaultNameParameterSet,
HelpUri = Constants.KeyVaultHelpUri)]
[OutputType(typeof(List), typeof(KeyBundle))]
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/GetAzureKeyVaultSecret.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/GetAzureKeyVaultSecret.cs
index 4a486c192cf3..3a3911e875f1 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/GetAzureKeyVaultSecret.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/GetAzureKeyVaultSecret.cs
@@ -21,7 +21,7 @@
namespace Microsoft.Azure.Commands.KeyVault
{
- [Cmdlet(VerbsCommon.Get, "AzureRmKeyVaultSecret",
+ [Cmdlet(VerbsCommon.Get, "AzureKeyVaultSecret",
DefaultParameterSetName = ByVaultNameParameterSet,
HelpUri = Constants.KeyVaultHelpUri)]
[OutputType(typeof(List), typeof(Secret))]
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RemoveAzureKeyVaultKey.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RemoveAzureKeyVaultKey.cs
index ea8c2c8cc4dd..fd55f20be13b 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RemoveAzureKeyVaultKey.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RemoveAzureKeyVaultKey.cs
@@ -20,7 +20,7 @@
namespace Microsoft.Azure.Commands.KeyVault
{
- [Cmdlet(VerbsCommon.Remove, "AzureRmKeyVaultKey",
+ [Cmdlet(VerbsCommon.Remove, "AzureKeyVaultKey",
SupportsShouldProcess = true,
ConfirmImpact = ConfirmImpact.High,
HelpUri = Constants.KeyVaultHelpUri)]
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RemoveAzureKeyVaultSecret.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RemoveAzureKeyVaultSecret.cs
index d28d73f0d7f6..746f637e5f8a 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RemoveAzureKeyVaultSecret.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RemoveAzureKeyVaultSecret.cs
@@ -20,7 +20,7 @@
namespace Microsoft.Azure.Commands.KeyVault
{
- [Cmdlet(VerbsCommon.Remove, "AzureRmKeyVaultSecret",
+ [Cmdlet(VerbsCommon.Remove, "AzureKeyVaultSecret",
SupportsShouldProcess = true,
ConfirmImpact = ConfirmImpact.High,
HelpUri = Constants.KeyVaultHelpUri)]
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RestoreAzureKeyVaultKey.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RestoreAzureKeyVaultKey.cs
index c76614d9c3e2..46f33f0cf538 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RestoreAzureKeyVaultKey.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RestoreAzureKeyVaultKey.cs
@@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.KeyVault
///
/// Restores the backup key into a vault
///
- [Cmdlet(VerbsData.Restore, "AzureRmKeyVaultKey", HelpUri = Constants.KeyVaultHelpUri)]
+ [Cmdlet(VerbsData.Restore, "AzureKeyVaultKey", HelpUri = Constants.KeyVaultHelpUri)]
[OutputType(typeof(KeyBundle))]
public class RestoreAzureKeyVaultKey : KeyVaultCmdletBase
{
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultKeyAttribute.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultKeyAttribute.cs
index 79d154332aa5..f4fb3f25f1db 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultKeyAttribute.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultKeyAttribute.cs
@@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.KeyVault
/// Update attribute of a key vault key.
///
[Alias("Set-AzureKeyVaultKey")]
- [Cmdlet(VerbsCommon.Set, "AzureRmKeyVaultKeyAttribute", HelpUri = Constants.KeyVaultHelpUri)]
+ [Cmdlet(VerbsCommon.Set, "AzureKeyVaultKeyAttribute", HelpUri = Constants.KeyVaultHelpUri)]
[OutputType(typeof(KeyBundle))]
public class SetAzureKeyVaultKeyAttribute : KeyVaultCmdletBase
{
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultSecret.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultSecret.cs
index 55c175558b42..fe9d92a37a24 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultSecret.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultSecret.cs
@@ -20,7 +20,7 @@
namespace Microsoft.Azure.Commands.KeyVault
{
- [Cmdlet(VerbsCommon.Set, "AzureRmKeyVaultSecret", HelpUri = Constants.KeyVaultHelpUri)]
+ [Cmdlet(VerbsCommon.Set, "AzureKeyVaultSecret", HelpUri = Constants.KeyVaultHelpUri)]
[OutputType(typeof(Secret))]
public class SetAzureKeyVaultSecret : KeyVaultCmdletBase
{
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultSecretAttribute.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultSecretAttribute.cs
index c67b068df682..a7c77837308a 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultSecretAttribute.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/SetAzureKeyVaultSecretAttribute.cs
@@ -20,7 +20,7 @@
namespace Microsoft.Azure.Commands.KeyVault
{
- [Cmdlet(VerbsCommon.Set, "AzureRmKeyVaultSecretAttribute", HelpUri = Constants.KeyVaultHelpUri)]
+ [Cmdlet(VerbsCommon.Set, "AzureKeyVaultSecretAttribute", HelpUri = Constants.KeyVaultHelpUri)]
[OutputType(typeof(Secret))]
public class SetAzureKeyVaultSecretAttribute : KeyVaultCmdletBase
{
diff --git a/src/ResourceManager/Network/AzureRM.Network.psd1 b/src/ResourceManager/Network/AzureRM.Network.psd1
index 8ee727943271..6755c9615aa1 100644
--- a/src/ResourceManager/Network/AzureRM.Network.psd1
+++ b/src/ResourceManager/Network/AzureRM.Network.psd1
@@ -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 = 'eb75c732-e274-4a20-b502-e9958e63484a'
@@ -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 - Network'
+Description = 'Microsoft Azure PowerShell - Network service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/OperationalInsights/AzureRM.OperationalInsights.psd1 b/src/ResourceManager/OperationalInsights/AzureRM.OperationalInsights.psd1
index 418704f1b874..27e3577c057b 100644
--- a/src/ResourceManager/OperationalInsights/AzureRM.OperationalInsights.psd1
+++ b/src/ResourceManager/OperationalInsights/AzureRM.OperationalInsights.psd1
@@ -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 = 'e827799a-7abf-4538-a61f-94dc52a48bd4'
@@ -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 - OperationalInsights'
+Description = 'Microsoft Azure PowerShell - OperationalInsights service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/Profile/AzureRM.Profile.psd1 b/src/ResourceManager/Profile/AzureRM.Profile.psd1
index 737e51ce6071..7f7e795f2a4a 100644
--- a/src/ResourceManager/Profile/AzureRM.Profile.psd1
+++ b/src/ResourceManager/Profile/AzureRM.Profile.psd1
@@ -9,7 +9,7 @@
@{
# Version number of this module.
-ModuleVersion = '0.9.11'
+ModuleVersion = '0.10.0'
# ID used to uniquely identify this module
GUID = '342714fc-4009-4863-8afb-a9067e3db04b'
@@ -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 - Profile'
+Description = 'Microsoft Azure PowerShell - Profile credential management cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/AzureRMProfileTests.cs b/src/ResourceManager/Profile/Commands.Profile.Test/AzureRMProfileTests.cs
index 8ca2d32b944a..8388f684e677 100644
--- a/src/ResourceManager/Profile/Commands.Profile.Test/AzureRMProfileTests.cs
+++ b/src/ResourceManager/Profile/Commands.Profile.Test/AzureRMProfileTests.cs
@@ -19,6 +19,7 @@
using System;
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
using System.Collections.Generic;
+using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
namespace Microsoft.Azure.Commands.ResourceManager.Common.Test
@@ -131,5 +132,18 @@ public void NoSubscriptionsInListThrows()
AzureSubscription subValue;
Assert.False(client.TryGetSubscription(DefaultTenant.ToString(), DefaultSubscription.ToString(), out subValue));
}
+
+ [Fact]
+ [Trait(Category.AcceptanceType, Category.CheckIn)]
+ public void SetContextPreservesTokenCache()
+ {
+ AzureRMProfile profile = null;
+ AzureContext context = new AzureContext(null, null, null, null);
+ Assert.Throws(() =>profile.SetContextWithCache(context));
+ profile = new AzureRMProfile();
+ Assert.Throws(() => profile.SetContextWithCache(null));
+ profile.SetContextWithCache(context);
+ Assert.Equal(TokenCache.DefaultShared.Serialize(), profile.Context.TokenCache);
+ }
}
}
diff --git a/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs b/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs
index dc3e1a7eee56..a0a4f38fb9b5 100644
--- a/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs
+++ b/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs
@@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.Profile
///
/// Cmdlet to change current Azure context.
///
- [Cmdlet(VerbsCommon.Set, "AzureRMContext", DefaultParameterSetName =TenantIdAndSubscriptionIdParameterSet)]
+ [Cmdlet(VerbsCommon.Set, "AzureRmContext", DefaultParameterSetName =TenantIdAndSubscriptionIdParameterSet)]
[Alias("Select-AzureRmSubscription")]
[OutputType(typeof(PSAzureContext))]
public class SetAzureRMContextCommand : AzureRMCmdlet
@@ -55,8 +55,8 @@ protected override void ProcessRecord()
{
if (ParameterSetName == ContextParameterSet)
{
- AzureRmProfileProvider.Instance.Profile.Context = new AzureContext(Context.Subscription, Context.Account,
- Context.Environment, Context.Tenant);
+ AzureRmProfileProvider.Instance.Profile.SetContextWithCache(new AzureContext(Context.Subscription, Context.Account,
+ Context.Environment, Context.Tenant));
}
else
{
diff --git a/src/ResourceManager/Profile/Commands.Profile/Microsoft.Azure.Commands.Profile.dll-Help.xml b/src/ResourceManager/Profile/Commands.Profile/Microsoft.Azure.Commands.Profile.dll-Help.xml
index 04ff1058f9c1..cae9dfa3e623 100644
--- a/src/ResourceManager/Profile/Commands.Profile/Microsoft.Azure.Commands.Profile.dll-Help.xml
+++ b/src/ResourceManager/Profile/Commands.Profile/Microsoft.Azure.Commands.Profile.dll-Help.xml
@@ -1760,7 +1760,7 @@ Subscription Name: Contoso Subscription 1
- Save-AzureRMProfile
+ Save-AzureRmProfile
Save the current authentication information for use in other PowerShell sessions.
@@ -1768,7 +1768,7 @@ Subscription Name: Contoso Subscription 1
Save
- AzureRMProfile
+ AzureRmProfile
@@ -1776,13 +1776,13 @@ Subscription Name: Contoso Subscription 1
- Save-AzureRMProfile
+ Save-AzureRmProfile
Profile
If provided, saves the given profile to the provided path. If no profile is provided, the currently active profile will be saved.
- AzureRMProfile
+ AzureRmProfile
Path
@@ -1813,9 +1813,9 @@ Subscription Name: Contoso Subscription 1
If provided, saves the given profile to the provided path. If no profile is provided, the currently active profile will be saved.
- AzureRMProfile
+ AzureRmProfile
- AzureRMProfile
+ AzureRmProfile
@@ -1919,7 +1919,7 @@ Subscription Name: Contoso Subscription 1
- Select-AzureRMProfile
+ Select-AzureRmProfile
Load authentication information from the given file. This sets the current context and azure environment metadata used by all cmdlets in the current session.
@@ -1927,7 +1927,7 @@ Subscription Name: Contoso Subscription 1
Select
- AzureRMProfile
+ AzureRmProfile
@@ -1935,13 +1935,13 @@ Subscription Name: Contoso Subscription 1
- Select-AzureRMProfile
+ Select-AzureRmProfile
Profile
The profile to select as the current profile in the given session.
- AzureRMProfile
+ AzureRmProfile
InformationAction
@@ -1959,7 +1959,7 @@ Subscription Name: Contoso Subscription 1
- Select-AzureRMProfile
+ Select-AzureRmProfile
Path
@@ -1989,9 +1989,9 @@ Subscription Name: Contoso Subscription 1
The profile to select as the current profile in the given session.
- AzureRMProfile
+ AzureRmProfile
- AzureRMProfile
+ AzureRmProfile
@@ -2085,7 +2085,7 @@ Subscription Name: Contoso Subscription 1
- Set-AzureRMContext
+ Set-AzureRmContext
Set the tenant, subscription, and environment to be used by cmdlets in this session.
@@ -2093,7 +2093,7 @@ Subscription Name: Contoso Subscription 1
Set
- AzureRMContext
+ AzureRmContext
@@ -2101,7 +2101,7 @@ Subscription Name: Contoso Subscription 1
- Set-AzureRMContext
+ Set-AzureRmContext
TenantId
@@ -2132,7 +2132,7 @@ Subscription Name: Contoso Subscription 1
- Set-AzureRMContext
+ Set-AzureRmContext
TenantId
@@ -2156,7 +2156,7 @@ Subscription Name: Contoso Subscription 1
- Set-AzureRMContext
+ Set-AzureRmContext
SubscriptionId
@@ -2180,7 +2180,7 @@ Subscription Name: Contoso Subscription 1
- Set-AzureRMContext
+ Set-AzureRmContext
Tenant
diff --git a/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs b/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs
index 3d553a1abcb0..dcec21991609 100644
--- a/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs
+++ b/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs
@@ -105,11 +105,11 @@ public AzureContext SetCurrentContext(string subscriptionId, string tenantId)
{
if (!string.IsNullOrWhiteSpace(tenantId))
{
- _profile.Context = new AzureContext(
+ _profile.SetContextWithCache(new AzureContext(
_profile.Context.Subscription,
_profile.Context.Account,
_profile.Context.Environment,
- new AzureTenant() { Id = new Guid(tenantId) });
+ new AzureTenant() { Id = new Guid(tenantId) }));
if (_profile.Context.Account != null)
{
@@ -139,11 +139,11 @@ public AzureContext SetCurrentContext(string subscriptionId, string tenantId)
newSubscription.Name = null;
}
- _profile.Context = new AzureContext(
+ _profile.SetContextWithCache(new AzureContext(
newSubscription,
_profile.Context.Account,
_profile.Context.Environment,
- _profile.Context.Tenant);
+ _profile.Context.Tenant));
}
return _profile.Context;
diff --git a/src/ResourceManager/Profile/Commands.Profile/Profile/SaveAzureRMProfile.cs b/src/ResourceManager/Profile/Commands.Profile/Profile/SaveAzureRMProfile.cs
index ef1aec4e42ef..ecaddc706af0 100644
--- a/src/ResourceManager/Profile/Commands.Profile/Profile/SaveAzureRMProfile.cs
+++ b/src/ResourceManager/Profile/Commands.Profile/Profile/SaveAzureRMProfile.cs
@@ -25,7 +25,7 @@ namespace Microsoft.Azure.Commands.Profile
///
/// Saves Microsoft Azure profile.
///
- [Cmdlet(VerbsData.Save, "AzureRMProfile"), OutputType(typeof(PSAzureProfile))]
+ [Cmdlet(VerbsData.Save, "AzureRmProfile"), OutputType(typeof(PSAzureProfile))]
public class SaveAzureRMProfileCommand : AzureRMCmdlet
{
[Parameter(Mandatory = false, Position = 0, ValueFromPipelineByPropertyName = true)]
diff --git a/src/ResourceManager/Profile/Commands.Profile/Profile/SelectAzureRMProfile.cs b/src/ResourceManager/Profile/Commands.Profile/Profile/SelectAzureRMProfile.cs
index 58060fa9f06c..410aa662d539 100644
--- a/src/ResourceManager/Profile/Commands.Profile/Profile/SelectAzureRMProfile.cs
+++ b/src/ResourceManager/Profile/Commands.Profile/Profile/SelectAzureRMProfile.cs
@@ -25,7 +25,7 @@ namespace Microsoft.Azure.Commands.Profile
///
/// Selects Microsoft Azure profile.
///
- [Cmdlet(VerbsCommon.Select, "AzureRMProfile"), OutputType(typeof(PSAzureProfile))]
+ [Cmdlet(VerbsCommon.Select, "AzureRmProfile"), OutputType(typeof(PSAzureProfile))]
public class SelectAzureRMProfileCommand : AzureRMCmdlet
{
internal const string InMemoryProfileParameterSet = "InMemoryProfile";
diff --git a/src/ResourceManager/RedisCache/AzureRM.RedisCache.psd1 b/src/ResourceManager/RedisCache/AzureRM.RedisCache.psd1
index 7ecfb4e8e8e7..5f2b40ccd5ff 100644
--- a/src/ResourceManager/RedisCache/AzureRM.RedisCache.psd1
+++ b/src/ResourceManager/RedisCache/AzureRM.RedisCache.psd1
@@ -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 = '820628d7-6938-488a-8760-43373a5ffce6'
@@ -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 - RedisCache'
+Description = 'Microsoft Azure PowerShell - RedisCache service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/Resources/AzureRM.Resources.psd1 b/src/ResourceManager/Resources/AzureRM.Resources.psd1
index 46753548826c..f7890b0226f7 100644
--- a/src/ResourceManager/Resources/AzureRM.Resources.psd1
+++ b/src/ResourceManager/Resources/AzureRM.Resources.psd1
@@ -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 = 'ab3ca893-26fe-44b0-bd3c-8933df144d7b'
@@ -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 - Resources'
+Description = 'Microsoft Azure PowerShell - Azure Resource Manager cmdlets. Manages subscriptions, tenants, resource groups, deployment templates, providers, and resource permissions in Azure Resource Manager. Provides cmdlets for managing resources generically across resource providers.'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1 b/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1
index 518bef77e7fa..6304f2a8b5b9 100644
--- a/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1
+++ b/src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1
@@ -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 = '81d522a4-6e5d-4105-8f58-376204c47458'
diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupCommand.cs
index 1b1bc0c7925f..4de3b4d03ea1 100644
--- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupCommand.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupCommand.cs
@@ -14,7 +14,10 @@
using Microsoft.Azure.Commands.Resources.Models;
using System.Collections.Generic;
+using System.IO;
using System.Management.Automation;
+using System.Reflection;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.Azure.Commands.Resources
{
@@ -22,7 +25,7 @@ namespace Microsoft.Azure.Commands.Resources
/// Filters resource groups.
///
[Cmdlet(VerbsCommon.Get, "AzureRmResourceGroup", DefaultParameterSetName = ResourceGroupNameParameterSet), OutputType(typeof(List))]
- public class GetAzureResourceGroupCommand : ResourcesBaseCmdlet
+ public class GetAzureResourceGroupCommand : ResourcesBaseCmdlet, IModuleAssemblyInitializer
{
///
/// List resources group by name parameter set.
@@ -57,5 +60,25 @@ protected override void ProcessRecord()
ResourcesClient.FilterResourceGroups(name: this.Name, tag: null, detailed: false, location: this.Location),
true);
}
+
+ ///
+ /// Load global aliases and script cmdlets for ARM
+ ///
+ public void OnImport()
+ {
+ try
+ {
+ System.Management.Automation.PowerShell invoker = null;
+ invoker = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace);
+ invoker.AddScript(File.ReadAllText(FileUtilities.GetContentFilePath(
+ Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
+ "ResourceManagerStartup.ps1")));
+ invoker.Invoke();
+ }
+ catch
+ {
+ // This may throw exception for tests, ignore.
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceManagerStartup.ps1 b/src/ResourceManager/Resources/Commands.Resources/ResourceManagerStartup.ps1
index bdb140883a2c..3c8c12e400ab 100644
--- a/src/ResourceManager/Resources/Commands.Resources/ResourceManagerStartup.ps1
+++ b/src/ResourceManager/Resources/Commands.Resources/ResourceManagerStartup.ps1
@@ -12,20 +12,6 @@
# limitations under the License.
# ----------------------------------------------------------------------------------
-@{
- # Sql aliases
- "Get-AzureRmSqlDatabaseServerAuditingPolicy" = "Get-AzureRmSqlServerAuditingPolicy";
- "Remove-AzureRmSqlDatabaseServerAuditing" = "Remove-AzureRmSqlServerAuditing";
- "Set-AzureRmSqlDatabaseServerAuditingPolicy" = "Set-AzureRmSqlServerAuditingPolicy";
- "Use-AzureRmSqlDatabaseServerAuditingPolicy" = "Use-AzureRmSqlServerAuditingPolicy";
-
- # Storage aliases
- "Get-AzureRmStorageContainerAcl" = "Get-AzureRmStorageContainer";
- "Start-CopyAzureStorageBlob" = "Start-AzureRmStorageBlobCopy";
- "Stop-CopyAzureStorageBlob" = "Stop-AzureRmStorageBlobCopy";
-}.GetEnumerator() | Select @{Name='Name'; Expression={$_.Key}}, @{Name='Value'; Expression={$_.Value}} | New-Alias -Description "AzureAlias"
-
-
# Authorization script commandlet that builds on top of existing Insights comandlets.
# This commandlet gets all events for the "Microsoft.Authorization" resource provider by calling the "Get-AzureRmResourceProviderLog" commandlet
diff --git a/src/ResourceManager/SiteRecovery/AzureRM.SiteRecovery.psd1 b/src/ResourceManager/SiteRecovery/AzureRM.SiteRecovery.psd1
index 2cbda9d1cff4..67eba130c34d 100644
--- a/src/ResourceManager/SiteRecovery/AzureRM.SiteRecovery.psd1
+++ b/src/ResourceManager/SiteRecovery/AzureRM.SiteRecovery.psd1
@@ -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 = 'd1de7560-48e1-48f3-bc8c-4eea3af2bbe1'
@@ -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 - SiteRecovery'
+Description = 'Microsoft Azure PowerShell - SiteRecovery service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/Sql/AzureRM.Sql.psd1 b/src/ResourceManager/Sql/AzureRM.Sql.psd1
index fb207dc703a9..eb25701f91f7 100644
--- a/src/ResourceManager/Sql/AzureRM.Sql.psd1
+++ b/src/ResourceManager/Sql/AzureRM.Sql.psd1
@@ -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 = '150d9544-6348-4373-806f-10cd0b4de4cb'
@@ -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 - Sql'
+Description = 'Microsoft Azure PowerShell - Sql service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj
index 8a7b9430fb63..7046ecef47c5 100644
--- a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj
+++ b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj
@@ -234,6 +234,9 @@
+
+ PreserveNewest
+
diff --git a/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/GetAzureSqlServer.cs b/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/GetAzureSqlServer.cs
index ea570c9fc74b..7e0bebfd8d1b 100644
--- a/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/GetAzureSqlServer.cs
+++ b/src/ResourceManager/Sql/Commands.Sql/Server/Cmdlet/GetAzureSqlServer.cs
@@ -13,8 +13,11 @@
// ----------------------------------------------------------------------------------
using System.Collections.Generic;
+using System.IO;
using System.Management.Automation;
+using System.Reflection;
using Microsoft.Azure.Commands.Sql.Server.Model;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.Azure.Commands.Sql.Server.Cmdlet
{
@@ -22,7 +25,7 @@ namespace Microsoft.Azure.Commands.Sql.Server.Cmdlet
/// Defines the Get-AzureRmSqlServer cmdlet
///
[Cmdlet(VerbsCommon.Get, "AzureRmSqlServer", ConfirmImpact = ConfirmImpact.None)]
- public class GetAzureSqlServer : AzureSqlServerCmdletBase
+ public class GetAzureSqlServer : AzureSqlServerCmdletBase, IModuleAssemblyInitializer
{
///
/// Gets or sets the name of the database server to use.
@@ -74,5 +77,25 @@ protected override IEnumerable ApplyUserInputToModel(IEnume
{
return model;
}
+
+ ///
+ /// Add Sql aliases
+ ///
+ public void OnImport()
+ {
+ try
+ {
+ System.Management.Automation.PowerShell invoker = null;
+ invoker = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace);
+ invoker.AddScript(File.ReadAllText(FileUtilities.GetContentFilePath(
+ Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
+ "SqlStartup.ps1")));
+ invoker.Invoke();
+ }
+ catch
+ {
+ // This may throw exception for tests, ignore.
+ }
+ }
}
}
diff --git a/src/ResourceManager/Sql/Commands.Sql/SqlStartup.ps1 b/src/ResourceManager/Sql/Commands.Sql/SqlStartup.ps1
new file mode 100644
index 000000000000..d1624c618418
--- /dev/null
+++ b/src/ResourceManager/Sql/Commands.Sql/SqlStartup.ps1
@@ -0,0 +1,22 @@
+# ----------------------------------------------------------------------------------
+#
+# 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.
+# ----------------------------------------------------------------------------------
+
+@{
+ # Sql aliases
+ "Get-AzureRmSqlDatabaseServerAuditingPolicy" = "Get-AzureRmSqlServerAuditingPolicy";
+ "Remove-AzureRmSqlDatabaseServerAuditing" = "Remove-AzureRmSqlServerAuditing";
+ "Set-AzureRmSqlDatabaseServerAuditingPolicy" = "Set-AzureRmSqlServerAuditingPolicy";
+ "Use-AzureRmSqlDatabaseServerAuditingPolicy" = "Use-AzureRmSqlServerAuditingPolicy";
+}.GetEnumerator() | Select @{Name='Name'; Expression={$_.Key}}, @{Name='Value'; Expression={$_.Value}} | New-Alias -Description "AzureAlias"
+
diff --git a/src/ResourceManager/Storage/AzureRM.Storage.psd1 b/src/ResourceManager/Storage/AzureRM.Storage.psd1
index 2be2bac364fd..204f3580ea7c 100644
--- a/src/ResourceManager/Storage/AzureRM.Storage.psd1
+++ b/src/ResourceManager/Storage/AzureRM.Storage.psd1
@@ -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 = 'da67eaa7-4cb1-4bfa-a194-8bf3faae8ac5'
@@ -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 management cmdlets for Azure Resource Manager. Creates and manages storage accounts in Azure Resource Manager.'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -46,8 +46,8 @@ ProcessorArchitecture = 'None'
# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(
- @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' },
- @{ ModuleName = 'Azure.Storage'; ModuleVersion = '0.9.10' }
+ @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.10.0'},
+ @{ ModuleName = 'Azure.Storage'; ModuleVersion = '0.10.0'}
)
# Assemblies that must be loaded prior to importing this module
diff --git a/src/ResourceManager/StreamAnalytics/AzureRM.StreamAnalytics.psd1 b/src/ResourceManager/StreamAnalytics/AzureRM.StreamAnalytics.psd1
index bc3ad7380887..d46f9efa833b 100644
--- a/src/ResourceManager/StreamAnalytics/AzureRM.StreamAnalytics.psd1
+++ b/src/ResourceManager/StreamAnalytics/AzureRM.StreamAnalytics.psd1
@@ -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 = '59713673-194f-418a-b1f2-ac60db82edf9'
@@ -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 - StreamAnalytics'
+Description = 'Microsoft Azure PowerShell - StreamAnalytics service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/Tags/AzureRM.Tags.psd1 b/src/ResourceManager/Tags/AzureRM.Tags.psd1
index c2cb2f7159ce..0d078baf8a62 100644
--- a/src/ResourceManager/Tags/AzureRM.Tags.psd1
+++ b/src/ResourceManager/Tags/AzureRM.Tags.psd1
@@ -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 = '59713673-194f-418a-b1f2-ac60db82edf9'
@@ -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 - Tags'
+Description = 'Microsoft Azure PowerShell - Tags service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/TrafficManager/AzureRM.TrafficManager.psd1 b/src/ResourceManager/TrafficManager/AzureRM.TrafficManager.psd1
index 6425d38a78ba..7e666e8cf3bf 100644
--- a/src/ResourceManager/TrafficManager/AzureRM.TrafficManager.psd1
+++ b/src/ResourceManager/TrafficManager/AzureRM.TrafficManager.psd1
@@ -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 = '59713673-194f-418a-b1f2-ac60db82edf9'
@@ -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 - TrafficManager'
+Description = 'Microsoft Azure PowerShell - TrafficManager service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/UsageAggregates/AzureRM.UsageAggregates.psd1 b/src/ResourceManager/UsageAggregates/AzureRM.UsageAggregates.psd1
index 5eba83c03581..8f72d515bf3a 100644
--- a/src/ResourceManager/UsageAggregates/AzureRM.UsageAggregates.psd1
+++ b/src/ResourceManager/UsageAggregates/AzureRM.UsageAggregates.psd1
@@ -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 = 'e43e47c8-8bff-4013-b003-ded1741f403a'
@@ -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 - UsageAggregates'
+Description = 'Microsoft Azure PowerShell - UsageAggregates service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ResourceManager/Websites/AzureRM.Websites.psd1 b/src/ResourceManager/Websites/AzureRM.Websites.psd1
index f9c04da5d9a4..0d484a1bfd51 100644
--- a/src/ResourceManager/Websites/AzureRM.Websites.psd1
+++ b/src/ResourceManager/Websites/AzureRM.Websites.psd1
@@ -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 = 'cc69c625-e961-43f4-8b50-0061eba6e4b6'
@@ -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 - Websites'
+Description = 'Microsoft Azure PowerShell - Websites service cmdlets for Azure Resource Manager'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
@@ -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 = @()
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/NewAzureDeployment.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/NewAzureDeployment.cs
index 3bf023b5faf3..6046108d14ec 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/NewAzureDeployment.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/NewAzureDeployment.cs
@@ -17,6 +17,7 @@
using System.Management.Automation;
using System.Net;
using Microsoft.Azure.Common.Authentication.Models;
+using Microsoft.WindowsAzure.Commands.Common;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Helpers;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
@@ -113,7 +114,7 @@ public virtual void NewPaaSDeploymentProcess()
AssertNoPersistenVmRoleExistsInDeployment(PVM.DeploymentSlotType.Production);
AssertNoPersistenVmRoleExistsInDeployment(PVM.DeploymentSlotType.Staging);
- var storageName = Profile.Context.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
+ var storageName = Profile.Context.Subscription.GetStorageAccountName();
Uri packageUrl;
if (this.Package.StartsWith(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase) ||
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureDeployment.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureDeployment.cs
index 114aa15cba3c..33b93a0d6de5 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureDeployment.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureDeployment.cs
@@ -23,6 +23,7 @@
using Microsoft.WindowsAzure.Management.Compute.Models;
using Microsoft.WindowsAzure.Management.Compute;
using Hyak.Common;
+using Microsoft.WindowsAzure.Commands.Common;
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices
{
@@ -198,7 +199,7 @@ public void ExecuteCommand()
if (string.Compare(ParameterSetName, "Upgrade", StringComparison.OrdinalIgnoreCase) == 0)
{
bool removePackage = false;
- var storageName = Profile.Context.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
+ var storageName = Profile.Context.Subscription.GetStorageAccountName();
Uri packageUrl = null;
if (Package.StartsWith(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase) ||
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs
index ed7caee7b15c..9333d2f6d08f 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs
@@ -210,7 +210,7 @@ protected override void ValidateParameters()
protected string GetStorageName()
{
- return Profile.Context.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
+ return Profile.Context.Subscription.GetStorageAccountName();
}
protected string GetStorageKey(string storageName)
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionCmdletCommonBase.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionCmdletCommonBase.cs
index 74f205f77d39..90c2a1271933 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionCmdletCommonBase.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionCmdletCommonBase.cs
@@ -44,21 +44,10 @@ internal static StorageCredentials GetStorageCredentials(this AzureSMCmdlet cmdl
}
else
{
- var storageAccountName = cmdlet.Profile.Context.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
-
- var storageClient = AzureSession.ClientFactory.CreateClient(
- cmdlet.Profile, cmdlet.Profile.Context.Subscription, AzureEnvironment.Endpoint.ServiceManagement);
-
- if (!string.IsNullOrEmpty(storageAccountName) && storageClient != null)
+ var storageAccount = cmdlet.Profile.Context.GetCurrentStorageAccount();
+ if (storageAccount != null)
{
- var keys = storageClient.StorageAccounts.GetKeys(storageAccountName);
-
- if (keys != null)
- {
- var storageAccountKey = string.IsNullOrEmpty(keys.PrimaryKey) ? keys.SecondaryKey : keys.PrimaryKey;
-
- credentials = new StorageCredentials(storageAccountName, storageAccountKey);
- }
+ credentials = storageAccount.Credentials;
}
}
diff --git a/src/ServiceManagement/Profile/Commands.Profile/Models/PsAzureSubscription.cs b/src/ServiceManagement/Profile/Commands.Profile/Models/PsAzureSubscription.cs
index d3eb9a0d2f88..1478f48af722 100644
--- a/src/ServiceManagement/Profile/Commands.Profile/Models/PsAzureSubscription.cs
+++ b/src/ServiceManagement/Profile/Commands.Profile/Models/PsAzureSubscription.cs
@@ -57,32 +57,5 @@ public PSAzureSubscription(AzureSubscription subscription, AzureSMProfile profil
public string CurrentStorageAccountName { get; set; }
public string TenantId { get; set; }
-
- public string GetAccountName()
- {
- var result = CurrentStorageAccountName;
- 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;
- }
}
}
diff --git a/src/ServiceManagement/Services/Commands.Utilities/CloudService/CloudServiceClient.cs b/src/ServiceManagement/Services/Commands.Utilities/CloudService/CloudServiceClient.cs
index e9b7fad50cc3..1f734ed34575 100644
--- a/src/ServiceManagement/Services/Commands.Utilities/CloudService/CloudServiceClient.cs
+++ b/src/ServiceManagement/Services/Commands.Utilities/CloudService/CloudServiceClient.cs
@@ -502,7 +502,7 @@ private PublishContext CreatePublishContext(
// If there's no storage service provided, try using the default one
if (string.IsNullOrEmpty(storageServiceName))
{
- storageServiceName = Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
+ storageServiceName = Subscription.GetStorageAccountName();
}
ServiceSettings serviceSettings = ServiceSettings.LoadDefault(
diff --git a/src/ServiceManagement/Services/Commands/Websites/EnableAzureWebsiteDiagnostic.cs b/src/ServiceManagement/Services/Commands/Websites/EnableAzureWebsiteDiagnostic.cs
index 79d491c40c1a..e09993e1d257 100644
--- a/src/ServiceManagement/Services/Commands/Websites/EnableAzureWebsiteDiagnostic.cs
+++ b/src/ServiceManagement/Services/Commands/Websites/EnableAzureWebsiteDiagnostic.cs
@@ -15,6 +15,7 @@
using System.Collections.Generic;
using System.Management.Automation;
using Microsoft.Azure.Common.Authentication.Models;
+using Microsoft.WindowsAzure.Commands.Common;
using Microsoft.WindowsAzure.Commands.Utilities.Websites;
using Microsoft.WindowsAzure.Commands.Utilities.Websites.Common;
using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.DeploymentEntities;
@@ -68,8 +69,14 @@ public override void ExecuteCmdlet()
}
else if (TableStorage.IsPresent || BlobStorage.IsPresent)
{
- properties[DiagnosticProperties.StorageAccountName] = string.IsNullOrEmpty(StorageAccountName) ?
- Profile.Context.Subscription.GetProperty(AzureSubscription.Property.StorageAccount) : StorageAccountName;
+ if (string.IsNullOrWhiteSpace(StorageAccountName))
+ {
+ properties[DiagnosticProperties.StorageAccountName] = Profile.Context.Subscription.GetStorageAccountName();
+ }
+ else
+ {
+ properties[DiagnosticProperties.StorageAccountName] = StorageAccountName;
+ }
if (TableStorage.IsPresent)
{
diff --git a/tools/AzureRM/AzureRM.psd1 b/tools/AzureRM/AzureRM.psd1
index 8e8428b65704..f80973beebc3 100644
Binary files a/tools/AzureRM/AzureRM.psd1 and b/tools/AzureRM/AzureRM.psd1 differ
diff --git a/tools/AzureRM/AzureRM.psm1 b/tools/AzureRM/AzureRM.psm1
index 1aa94cc1340d..4ac00b7be908 100644
--- a/tools/AzureRM/AzureRM.psm1
+++ b/tools/AzureRM/AzureRM.psm1
@@ -38,6 +38,28 @@ function Test-AdminRights([string]$Scope)
}
}
+function CheckIncompatibleVersion([bool]$Force)
+{
+ $message = "An incompatible version of Azure Resource Manager PowerShell cmdlets is installed. Please uninstall Microsoft Azure PowerShell using the 'Control Panel' before installing these cmdlets. To install these cmdlets regardless of compatibility issues, execute 'Install-AzureRM -Force'."
+ $path = ${env:ProgramFiles(x86)}
+ if ($path -eq $null)
+ {
+ $path = ${env:ProgramFiles}
+ }
+
+ if ( Test-Path "$path\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureResourceManager.psd1")
+ {
+ if ($Force)
+ {
+ Write-Warning $message
+ }
+ else
+ {
+ throw $message
+ }
+ }
+}
+
function Install-ModuleWithVersionCheck([string]$Name,[string]$MajorVersion,[string]$Repository,[string]$Scope)
{
$_MinVer = "$MajorVersion.0.0.0"
@@ -81,6 +103,7 @@ function Install-ModuleWithVersionCheck([string]$Name,[string]$MajorVersion,[str
#>
function Update-AzureRM
{
+
param(
[Parameter(Position=0, Mandatory = $false)]
[string]
@@ -91,9 +114,12 @@ function Update-AzureRM
[Parameter(Position=2, Mandatory = $false)]
[ValidateSet("CurrentUser","AllUsers")]
[string]
- $Scope = "AllUsers")
+ $Scope = "AllUsers",
+ [switch]
+ $Force = $false)
Test-AdminRights $Scope
+ CheckIncompatibleVersion($Force.IsPresent)
Write-Output "Installing AzureRM modules."
@@ -105,6 +131,7 @@ function Update-AzureRM
Set-PSRepository -Name $Repository -InstallationPolicy Trusted
Install-ModuleWithVersionCheck "AzureRM.Profile" $MajorVersion $Repository $Scope
+ Install-ModuleWithVersionCheck "Azure.Storage" $MajorVersion $Repository $Scope
# Start new job
$AzureRMModules | ForEach {
@@ -132,7 +159,6 @@ function Import-AzureRM
[Parameter(Position=0, Mandatory = $false)]
[string]
$MajorVersion = $AzureMajorVersion)
-
Write-Output "Importing AzureRM modules."
$_MinVer = "$MajorVersion.0.0.0"
diff --git a/tools/PublishModules.ps1 b/tools/PublishModules.ps1
index c50e96e50cc0..01517bc13f82 100644
--- a/tools/PublishModules.ps1
+++ b/tools/PublishModules.ps1
@@ -58,7 +58,7 @@ $publishToLocal = test-path $repositoryLocation
if (($scope -eq 'All') -or $publishToLocal ) {
# If we publish 'All' or to local folder, publish AzureRM.Profile first, becasue it is the common dependency
Write-Host "Publishing profile module"
- Publish-Module -Path "$resourceManagerRootFolder\AzureRM.Profile" -NuGetApiKey $apiKey -Repository $repoName
+ Publish-Module -Path "$resourceManagerRootFolder\AzureRM.Profile" -NuGetApiKey $apiKey -Repository $repoName -Tags ("Azure") -LicenseUri "http://aka.ms/azps-license"
Write-Host "Published profile module"
}
@@ -66,21 +66,21 @@ if (($scope -eq 'All') -or ($scope -eq 'ServiceManagement')) {
$modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure"
# Publish Azure module
Write-Host "Publishing ServiceManagement(aka Azure) module from $modulePath"
- Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
+ Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName -Tags ("Azure") -LicenseUri "http://aka.ms/azps-license"
}
if (($scope -eq 'All') -or ($scope -eq 'AzureStorage')) {
$modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure\Azure.Storage"
# Publish AzureStorage module
Write-Host "Publishing AzureStorage module from $modulePath"
- Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
+ Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName -Tags ("Azure") -LicenseUri "http://aka.ms/azps-license"
}
if (($scope -eq 'All') -or ($scope -eq 'AzureRM')) {
# Publish AzureRM module
$modulePath = "$PSScriptRoot\AzureRM"
Write-Host "Publishing AzureRM module from $modulePath"
- Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
+ Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName -Tags ("Azure") -LicenseUri "http://aka.ms/azps-license"
Write-Host "Published Azure module"
}
@@ -92,7 +92,7 @@ if ($scope -eq 'All') {
if (($module.Name -ne "AzureRM.Profile") -and ($module.Name -ne "Azure.Storage")) {
$modulePath = $module.FullName
Write-Host "Publishing $module module from $modulePath"
- Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
+ Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName -Tags ("Azure") -LicenseUri "http://aka.ms/azps-license"
Write-Host "Published $module module"
}
}
@@ -100,7 +100,7 @@ if ($scope -eq 'All') {
$modulePath = Join-Path $resourceManagerRootFolder "AzureRM.$scope"
if (Test-Path $modulePath) {
Write-Host "Publishing $scope module from $modulePath"
- Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName
+ Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName -Tags ("Azure") -LicenseUri "http://aka.ms/azps-license"
Write-Host "Published $scope module"
} else {
Write-Error "Can not find module with name $scope to publish"