ResourceIdentifierExtensions.GetParentResourceName Method

Definition

Get the parent resource name starting from level 0, immediate parent

public static string GetParentResourceName (this Microsoft.Azure.Management.Internal.Resources.Utilities.Models.ResourceIdentifier resourceIdentifier, string resourceType, int level = 0);
static member GetParentResourceName : Microsoft.Azure.Management.Internal.Resources.Utilities.Models.ResourceIdentifier * string * int -> string
<Extension()>
Public Function GetParentResourceName (resourceIdentifier As ResourceIdentifier, resourceType As String, Optional level As Integer = 0) As String

Parameters

resourceIdentifier
ResourceIdentifier

The resource identifier.

resourceType
String

Type of the resource.

level
Int32

The level.

Returns

System.String.

Exceptions

Invalid argument {nameof(resourceIdentifier.ParentResource)} - ParentResource or Invalid argument {nameof(level)} - level or Invalid argument {nameof(resourceType)} - resourceType

Applies to