File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change
1
+
1
2
<!--
2
3
Please leave this section at the top of the change log.
3
4
4
- Changes for the current release should go under the section titled "Current Release", and should adhere to the following format:
5
+ Changes for the upcoming release should go under the section titled "Upcoming Release", and should adhere to the following format:
5
6
6
- ## Current Release
7
+ ## Upcoming Release
7
8
* Overview of change #1
8
9
- Additional information about change #1
9
10
* Overview of change #2
17
18
* Overview of change #1
18
19
- Additional information about change #1
19
20
-->
20
-
21
21
## Upcoming Release
22
+ * Updated utils to be extensible for future changes
22
23
23
24
## Version 0.1.0
24
- * Added new cmdlets for Advisor Recommendation
25
+ * Added new cmdlets for Advisor Recommendation
25
26
- Get-AzAdvisorRecommendation
26
27
- Enable-AzAdvisorRecommendation
27
28
- Disable-AzAdvisorRecommendation
28
- * Added new cmdlets for Advisor Configuration
29
+ * Added new cmdlets for Advisor Configuration
29
30
- Get-AzAdvisorConfiguration
30
31
- Set-AzAdvisorConfiguration
Original file line number Diff line number Diff line change @@ -35,16 +35,6 @@ public static class RecommendationHelper
35
35
/// </summary>
36
36
private const int RESOURCEGROUP_VALUE_POSITION = 4 ;
37
37
38
- /// <summary>
39
- /// Position of recommendation-Id string in resource ID
40
- /// </summary>
41
- private const int RECOMMENDATION_STRING_POSITION = 11 ;
42
-
43
- /// <summary>
44
- /// Position of recommendation-Id value in resource ID
45
- /// </summary>
46
- private const int RECOMMENDATION_VALUE_POSITION = 12 ;
47
-
48
38
/// <summary>
49
39
/// Filter recommendations by given category and resourceGroup name.
50
40
/// </summary>
@@ -205,9 +195,9 @@ public static string GetRecommendationIdFromResourceID(string resourceID)
205
195
string recommendationId = string . Empty ;
206
196
string [ ] resourceIdSplit = resourceID . Split ( '/' ) ;
207
197
208
- if ( resourceIdSplit [ RECOMMENDATION_STRING_POSITION ] . Equals ( "recommendations" ) )
198
+ if ( resourceIdSplit [ resourceIdSplit . Length - 2 ] . Equals ( "recommendations" ) )
209
199
{
210
- recommendationId = resourceIdSplit [ RECOMMENDATION_VALUE_POSITION ] ;
200
+ recommendationId = resourceIdSplit [ resourceIdSplit . Length - 1 ] ;
211
201
}
212
202
213
203
return recommendationId ;
You can’t perform that action at this time.
0 commit comments