Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ public AzureContainerRegistryResource? ContainerRegistry
ReferenceExpression IAzureContainerRegistry.ManagedIdentityId => ReferenceExpression.Create($"{ContainerRegistryManagedIdentityId}");
#pragma warning restore CS0618 // Type or member is obsolete

ReferenceExpression IComputeEnvironmentResource.GetHostAddressExpression(EndpointReference endpointReference)
/// <inheritdoc/>
public ReferenceExpression GetHostAddressExpression(EndpointReference endpointReference)
Comment thread
eerhardt marked this conversation as resolved.
{
var resource = endpointReference.Resource;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ public AzureContainerRegistryResource? ContainerRegistry
ReferenceExpression IAzureContainerRegistry.ManagedIdentityId => ReferenceExpression.Create($"{ContainerRegistryManagedIdentityId}");
#pragma warning restore CS0618 // Type or member is obsolete

ReferenceExpression IComputeEnvironmentResource.GetHostAddressExpression(EndpointReference endpointReference)
/// <inheritdoc/>
public ReferenceExpression GetHostAddressExpression(EndpointReference endpointReference)
{
var resource = endpointReference.Resource;
return ReferenceExpression.Create($"{resource.Name.ToLowerInvariant()}-{WebSiteSuffix}.azurewebsites.net");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,8 @@ public DockerComposeEnvironmentResource(string name) : base(name)
}));
}

/// <summary>
/// Computes the host URL <see cref="ReferenceExpression"/> for the given <see cref="EndpointReference"/>.
/// </summary>
/// <param name="endpointReference">The endpoint reference to compute the host address for.</param>
/// <returns>A <see cref="ReferenceExpression"/> representing the host address.</returns>
ReferenceExpression IComputeEnvironmentResource.GetHostAddressExpression(EndpointReference endpointReference)
/// <inheritdoc/>
public ReferenceExpression GetHostAddressExpression(EndpointReference endpointReference)
{
var resource = endpointReference.Resource;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,8 @@ public KubernetesEnvironmentResource(string name) : base(name)
}));
}

/// <summary>
/// Computes the host URL <see cref="ReferenceExpression"/> for the given <see cref="EndpointReference"/>.
/// </summary>
/// <param name="endpointReference">The endpoint reference to compute the host address for.</param>
/// <returns>A <see cref="ReferenceExpression"/> representing the host address.</returns>
ReferenceExpression IComputeEnvironmentResource.GetHostAddressExpression(EndpointReference endpointReference)
/// <inheritdoc/>
public ReferenceExpression GetHostAddressExpression(EndpointReference endpointReference)
{
var resource = endpointReference.Resource;

Expand Down
2 changes: 1 addition & 1 deletion tests/Aspire.Hosting.Azure.Tests/AzureAppServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ public async Task GetHostAddressExpression()
.AddProject<Project>("project1", launchProfileName: null)
.WithHttpEndpoint();

var endpointReferenceEx = ((IComputeEnvironmentResource)env.Resource).GetHostAddressExpression(project.GetEndpoint("http"));
var endpointReferenceEx = env.Resource.GetHostAddressExpression(project.GetEndpoint("http"));
Assert.NotNull(endpointReferenceEx);

Assert.Equal("project1-{0}.azurewebsites.net", endpointReferenceEx.Format);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@ public async Task GetHostAddressExpression()
.AddProject<Project>("project1", launchProfileName: null)
.WithHttpEndpoint();

var endpointReferenceEx = ((IComputeEnvironmentResource)env.Resource).GetHostAddressExpression(project.GetEndpoint("http"));
var endpointReferenceEx = env.Resource.GetHostAddressExpression(project.GetEndpoint("http"));
Assert.NotNull(endpointReferenceEx);

Assert.Equal("project1.internal.{0}", endpointReferenceEx.Format);
Expand Down
2 changes: 1 addition & 1 deletion tests/Aspire.Hosting.Docker.Tests/DockerComposeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public async Task GetHostAddressExpression()
.AddProject<Projects.ServiceA>("Project1", launchProfileName: null)
.WithHttpEndpoint();

var endpointReferenceEx = ((IComputeEnvironmentResource)env.Resource).GetHostAddressExpression(project.GetEndpoint("http"));
var endpointReferenceEx = env.Resource.GetHostAddressExpression(project.GetEndpoint("http"));
Assert.NotNull(endpointReferenceEx);

Assert.Equal("project1", endpointReferenceEx.Format);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public async Task GetHostAddressExpression()
.AddProject<Projects.ServiceA>("project1", launchProfileName: null)
.WithHttpEndpoint();

var endpointReferenceEx = ((IComputeEnvironmentResource)env.Resource).GetHostAddressExpression(project.GetEndpoint("http"));
var endpointReferenceEx = env.Resource.GetHostAddressExpression(project.GetEndpoint("http"));
Assert.NotNull(endpointReferenceEx);

Assert.Equal("project1-service", endpointReferenceEx.Format);
Expand Down
Loading