diff --git a/ChangeLog.md b/ChangeLog.md index 2f14fd5781c6..96c483c2831c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,6 +4,10 @@ * Az.IotHub added cmdlets to support to manage devices. * Az.SqlVirtualMachine added cmdlets for Availability Group Listener. +#### Az.Resource +* Fixed bug preventing correct tenant-level resource id generation. +* Fixed typo. + #### Az.Accounts * Added SubscriptionId, TenantId, and execution time into data of client side telemetry diff --git a/src/Advisor/Advisor/Cmdlets/Utilities/RecommendationHelper.cs b/src/Advisor/Advisor/Cmdlets/Utilities/RecommendationHelper.cs index f7244f9f08b3..d502e9aa854f 100644 --- a/src/Advisor/Advisor/Cmdlets/Utilities/RecommendationHelper.cs +++ b/src/Advisor/Advisor/Cmdlets/Utilities/RecommendationHelper.cs @@ -115,7 +115,7 @@ public static PsAzureAdvisorResourceRecommendationBase RecommendationFilterByRec /// Filter recommendations by given resourceId. /// /// List to be filtered - /// ResoruceId of the recommendation. + /// ResourceId of the recommendation. /// Recommendation of PsAzureAdvisorResourceRecommendationBase type public static List RecommendationFilterByResourceId(IEnumerable recListTobeFiltered, string resourceId) { diff --git a/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceManipulationCmdletBase.cs b/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceManipulationCmdletBase.cs index 33ab6528d6e3..a50e400aca61 100644 --- a/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceManipulationCmdletBase.cs +++ b/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceManipulationCmdletBase.cs @@ -28,12 +28,12 @@ public abstract class ResourceManipulationCmdletBase : ResourceManagerCmdletBase /// /// The subscription level parameter set. /// - internal const string SubscriptionLevelResoruceParameterSet = "BySubscriptionLevel"; + internal const string SubscriptionLevelResourceParameterSet = "BySubscriptionLevel"; /// /// The tenant level parameter set. /// - internal const string TenantLevelResoruceParameterSet = "ByTenantLevel"; + internal const string TenantLevelResourceParameterSet = "ByTenantLevel"; /// /// The tenant level parameter set. @@ -52,32 +52,32 @@ public abstract class ResourceManipulationCmdletBase : ResourceManagerCmdletBase /// Gets or sets the extension resource name parameter. /// [Alias("Name")] - [Parameter(ParameterSetName = ResourceManipulationCmdletBase.SubscriptionLevelResoruceParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] - [Parameter(ParameterSetName = ResourceManipulationCmdletBase.TenantLevelResoruceParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] + [Parameter(ParameterSetName = ResourceManipulationCmdletBase.SubscriptionLevelResourceParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] + [Parameter(ParameterSetName = ResourceManipulationCmdletBase.TenantLevelResourceParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] [ValidateNotNullOrEmpty] public string ResourceName { get; set; } /// /// Gets or sets the resource type parameter. /// - [Parameter(ParameterSetName = ResourceManipulationCmdletBase.SubscriptionLevelResoruceParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] - [Parameter(ParameterSetName = ResourceManipulationCmdletBase.TenantLevelResoruceParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] + [Parameter(ParameterSetName = ResourceManipulationCmdletBase.SubscriptionLevelResourceParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] + [Parameter(ParameterSetName = ResourceManipulationCmdletBase.TenantLevelResourceParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] [ValidateNotNullOrEmpty] public string ResourceType { get; set; } /// /// Gets or sets the extension resource name parameter. /// - [Parameter(ParameterSetName = ResourceManipulationCmdletBase.SubscriptionLevelResoruceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The extension resource name. e.g. to specify a database MyServer/MyDatabase.")] - [Parameter(ParameterSetName = ResourceManipulationCmdletBase.TenantLevelResoruceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The extension resource name. e.g. to specify a database MyServer/MyDatabase.")] + [Parameter(ParameterSetName = ResourceManipulationCmdletBase.SubscriptionLevelResourceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The extension resource name. e.g. to specify a database MyServer/MyDatabase.")] + [Parameter(ParameterSetName = ResourceManipulationCmdletBase.TenantLevelResourceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The extension resource name. e.g. to specify a database MyServer/MyDatabase.")] [ValidateNotNullOrEmpty] public string ExtensionResourceName { get; set; } /// /// Gets or sets the extension resource type parameter. /// - [Parameter(ParameterSetName = ResourceManipulationCmdletBase.SubscriptionLevelResoruceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")] - [Parameter(ParameterSetName = ResourceManipulationCmdletBase.TenantLevelResoruceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")] + [Parameter(ParameterSetName = ResourceManipulationCmdletBase.SubscriptionLevelResourceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")] + [Parameter(ParameterSetName = ResourceManipulationCmdletBase.TenantLevelResourceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")] [ValidateNotNullOrEmpty] public string ExtensionResourceType { get; set; } @@ -91,7 +91,7 @@ public abstract class ResourceManipulationCmdletBase : ResourceManagerCmdletBase /// /// Gets or sets the resource group name parameter. /// - [Parameter(ParameterSetName = ResourceManipulationCmdletBase.SubscriptionLevelResoruceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")] + [Parameter(ParameterSetName = ResourceManipulationCmdletBase.SubscriptionLevelResourceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")] [ResourceGroupCompleter] [ValidateNotNullOrEmpty] public string ResourceGroupName { get; set; } @@ -99,7 +99,7 @@ public abstract class ResourceManipulationCmdletBase : ResourceManagerCmdletBase /// /// Gets or sets the tenant level parameter. /// - [Parameter(ParameterSetName = ResourceManipulationCmdletBase.TenantLevelResoruceParameterSet, Mandatory = true, HelpMessage = "Indicates that this is a tenant level operation.")] + [Parameter(ParameterSetName = ResourceManipulationCmdletBase.TenantLevelResourceParameterSet, Mandatory = true, HelpMessage = "Indicates that this is a tenant level operation.")] public SwitchParameter TenantLevel { get; set; } /// @@ -146,8 +146,8 @@ protected string GetResourceId() private string GetResourceIdWithoutParentResource() { return ResourceIdUtility.GetResourceId( - subscriptionId: this.SubscriptionId, - resourceGroupName: this.ResourceGroupName, + subscriptionId: TenantLevel.IsPresent ? null : (Guid?)this.SubscriptionId, + resourceGroupName: TenantLevel.IsPresent ? null : this.ResourceGroupName, resourceType: this.ResourceType, resourceName: this.ResourceName, extensionResourceType: this.ExtensionResourceType, diff --git a/src/Storage/Storage.Management.Test/ScenarioTests/StorageAccountTests.ps1 b/src/Storage/Storage.Management.Test/ScenarioTests/StorageAccountTests.ps1 index 17654b559491..4f4e74af1ae4 100644 --- a/src/Storage/Storage.Management.Test/ScenarioTests/StorageAccountTests.ps1 +++ b/src/Storage/Storage.Management.Test/ScenarioTests/StorageAccountTests.ps1 @@ -536,7 +536,7 @@ function Test-RevokeAzStorageAccountUserDelegationKeys New-AzResourceGroup -Name $rgname -Location $loc New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype - # revoke with storage account name and resoruce group name + # revoke with storage account name and resource group name Revoke-AzStorageAccountUserDelegationKeys -ResourceGroupName $rgname -Name $stoname # revoke with pipeline