Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static PsAzureAdvisorResourceRecommendationBase RecommendationFilterByRec
/// Filter recommendations by given resourceId.
/// </summary>
/// <param name="recListTobeFiltered">List to be filtered</param>
/// <param name="resourceId">ResoruceId of the recommendation.</param>
/// <param name="resourceId">ResourceId of the recommendation.</param>
/// <returns>Recommendation of PsAzureAdvisorResourceRecommendationBase type</returns>
public static List<PsAzureAdvisorResourceRecommendationBase> RecommendationFilterByResourceId(IEnumerable<PsAzureAdvisorResourceRecommendationBase> recListTobeFiltered, string resourceId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public abstract class ResourceManipulationCmdletBase : ResourceManagerCmdletBase
/// <summary>
/// The subscription level parameter set.
/// </summary>
internal const string SubscriptionLevelResoruceParameterSet = "BySubscriptionLevel";
internal const string SubscriptionLevelResourceParameterSet = "BySubscriptionLevel";

/// <summary>
/// The tenant level parameter set.
/// </summary>
internal const string TenantLevelResoruceParameterSet = "ByTenantLevel";
internal const string TenantLevelResourceParameterSet = "ByTenantLevel";

/// <summary>
/// The tenant level parameter set.
Expand All @@ -52,32 +52,32 @@ public abstract class ResourceManipulationCmdletBase : ResourceManagerCmdletBase
/// Gets or sets the extension resource name parameter.
/// </summary>
[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; }

/// <summary>
/// Gets or sets the resource type parameter.
/// </summary>
[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; }

/// <summary>
/// Gets or sets the extension resource name parameter.
/// </summary>
[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; }

/// <summary>
/// Gets or sets the extension resource type parameter.
/// </summary>
[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; }

Expand All @@ -91,15 +91,15 @@ public abstract class ResourceManipulationCmdletBase : ResourceManagerCmdletBase
/// <summary>
/// Gets or sets the resource group name parameter.
/// </summary>
[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; }

/// <summary>
/// Gets or sets the tenant level parameter.
/// </summary>
[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; }

/// <summary>
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down