Skip to content

Commit 5d7c796

Browse files
committed
Merge pull request #975 from t-alguer/dev
Fixing issue with AzureEndpoints.
2 parents 8c041a4 + 2c27318 commit 5d7c796

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/ResourceManager/TrafficManager/Commands.TrafficManager2/Models/TrafficManagerEndpoint.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ namespace Microsoft.Azure.Commands.TrafficManager.Models
2020

2121
public class TrafficManagerEndpoint
2222
{
23+
public string Id { get; set; }
24+
2325
public string Name { get; set; }
2426

2527
public string ProfileName { get; set; }
@@ -46,16 +48,17 @@ public Endpoint ToSDKEndpoint()
4648
{
4749
return new Endpoint
4850
{
51+
Id = this.Id,
4952
Name = this.Name,
5053
Type = TrafficManagerEndpoint.ToSDKEndpointType(this.Type),
51-
Id = this.TargetResourceId,
5254
Properties = new EndpointProperties
5355
{
5456
Target = this.Target,
5557
EndpointStatus = this.EndpointStatus,
5658
Weight = this.Weight,
5759
Priority = this.Priority,
58-
EndpointLocation = this.Location
60+
EndpointLocation = this.Location,
61+
TargetResourceId = this.TargetResourceId
5962
}
6063
};
6164
}

src/ResourceManager/TrafficManager/Commands.TrafficManager2/Utilities/TrafficManagerClient.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public TrafficManagerEndpoint CreateTrafficManagerEndpoint(string resourceGroupN
105105
}
106106
});
107107

108-
return TrafficManagerClient.GetPowershellTrafficManagerEndpoint(resourceGroupName, profileName, endpointType, endpointName, response.Endpoint.Properties);
108+
return TrafficManagerClient.GetPowershellTrafficManagerEndpoint(response.Endpoint.Id, resourceGroupName, profileName, endpointType, endpointName, response.Endpoint.Properties);
109109
}
110110

111111
public TrafficManagerProfile GetTrafficManagerProfile(string resourceGroupName, string profileName)
@@ -120,6 +120,7 @@ public TrafficManagerEndpoint GetTrafficManagerEndpoint(string resourceGroupName
120120
EndpointGetResponse response = this.TrafficManagerManagementClient.Endpoints.Get(resourceGroupName, profileName, endpointType, endpointName);
121121

122122
return TrafficManagerClient.GetPowershellTrafficManagerEndpoint(
123+
response.Endpoint.Id,
123124
resourceGroupName,
124125
profileName,
125126
endpointType,
@@ -171,6 +172,7 @@ public TrafficManagerEndpoint SetTrafficManagerEndpoint(TrafficManagerEndpoint e
171172
parameters);
172173

173174
return TrafficManagerClient.GetPowershellTrafficManagerEndpoint(
175+
endpoint.Id,
174176
endpoint.ResourceGroupName,
175177
endpoint.ProfileName,
176178
endpoint.Type,
@@ -285,10 +287,11 @@ private static string ExtractResourceGroupFromId(string id)
285287
return id.Split('/')[4];
286288
}
287289

288-
private static TrafficManagerEndpoint GetPowershellTrafficManagerEndpoint(string resourceGroupName, string profileName, string endpointType, string endpointName, EndpointProperties mamlEndpointProperties)
290+
private static TrafficManagerEndpoint GetPowershellTrafficManagerEndpoint(string id, string resourceGroupName, string profileName, string endpointType, string endpointName, EndpointProperties mamlEndpointProperties)
289291
{
290292
return new TrafficManagerEndpoint
291293
{
294+
Id = id,
292295
ResourceGroupName = resourceGroupName,
293296
ProfileName = profileName,
294297
Name = endpointName,

0 commit comments

Comments
 (0)