private static GetNextSegmentAfter ( string resourceId, string segmentName, bool selectLastSegment = false ) : string | ||
resourceId | string | The resource Id. |
segmentName | string | The segment name. |
selectLastSegment | bool | When set to true, gets the last segment (default) otherwise gets the first one. |
리턴 | string |
/// <summary> /// Gets the extension provider namespace from the resource id. /// </summary> /// <param name="resourceId">The resource id.</param> public static string GetExtensionProviderNamespace(string resourceId) { return(ResourceIdUtility.IsExtensionResourceId(resourceId) ? ResourceIdUtility.GetNextSegmentAfter(resourceId: resourceId, segmentName: Constants.Providers, selectLastSegment: true) : null); }
/// <summary> /// Gets the name of the resource group from the resource id. /// </summary> /// <param name="resourceId">The resource id.</param> public static string GetResourceGroupName(string resourceId) { return(ResourceIdUtility.GetNextSegmentAfter(resourceId: resourceId, segmentName: Constants.ResourceGroups)); }
/// <summary> /// Gets the management group id from the resource id. /// </summary> /// <param name="resourceId">The resource id.</param> public static string GetManagementGroupId(string resourceId) { return(resourceId.StartsWithInsensitively(Constants.ManagementGroupIdPrefix) ? ResourceIdUtility.GetNextSegmentAfter(resourceId: resourceId, segmentName: Constants.ManagementGroups) : null); }
/// <summary> /// Gets the subscription id from the resource id. /// </summary> /// <param name="resourceId">The resource id.</param> public static string GetSubscriptionId(string resourceId) { return(ResourceIdUtility.GetNextSegmentAfter(resourceId: resourceId, segmentName: Constants.Subscriptions)); }
/// <summary> /// Gets the provider namespace from the resource id. /// </summary> /// <param name="resourceId">The resource id.</param> public static string GetProviderNamespace(string resourceId) { return(ResourceIdUtility.GetNextSegmentAfter(resourceId: resourceId, segmentName: Constants.Providers)); }