# ContainerImagePushOptions Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ContainerImagePushOptions](/reference/api/csharp/aspire.hosting/containerimagepushoptions.md)
- Kind: `Methods`
- Members: `1`

Represents options for pushing container images to a registry.

## GetFullRemoteImageNameAsync(IContainerRegistry, CancellationToken)

- Name: `GetFullRemoteImageNameAsync(IContainerRegistry, CancellationToken)`
- Returns: `Task<string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerImagePushOptions.cs#L77-L118)

Gets the full remote image name including registry endpoint and tag.

```csharp
public sealed class ContainerImagePushOptions
{
    public Task<string> GetFullRemoteImageNameAsync(
        IContainerRegistry registry,
        CancellationToken cancellationToken = default(CancellationToken))
    {
        // ...
    }
}
```

## Parameters

- `registry` ([IContainerRegistry](/reference/api/csharp/aspire.hosting/icontainerregistry.md))
  The container registry to use for constructing the full image name.
- `cancellationToken` (`CancellationToken`) `optional`
  The cancellation token.

## Returns

`Task<string>` -- The fully qualified image name in the format "{registryEndpoint}/{repository}/{imageName}:{tag}" or "{registryEndpoint}/{imageName}:{tag}" if no repository is specified. For example: "myregistry.azurecr.io/myapp:v1.0.0" or "docker.io/captainsafia/myapp:latest".

## Exceptions

- `InvalidOperationException` -- Thrown when [ContainerImagePushOptions.RemoteImageName](/reference/api/csharp/aspire.hosting/containerimagepushoptions/properties.md#remoteimagename) is `null` or empty.
- `ArgumentNullException` -- Thrown when `registry` is `null`.

## Remarks

This method retrieves the registry endpoint asynchronously and combines it with the remote image name and tag. If [ContainerImagePushOptions.RemoteImageTag](/reference/api/csharp/aspire.hosting/containerimagepushoptions/properties.md#remoteimagetag) is `null` or empty, "latest" is used as the default tag.

The [ContainerImagePushOptions.RemoteImageName](/reference/api/csharp/aspire.hosting/containerimagepushoptions/properties.md#remoteimagename) value is parsed to determine if it contains an override for the registry host or repository. If the [ContainerImagePushOptions.RemoteImageName](/reference/api/csharp/aspire.hosting/containerimagepushoptions/properties.md#remoteimagename) contains a host component (detected by the presence of a dot in the first segment), that host will be used instead of the registry endpoint. Otherwise, the registry endpoint is used and the [IContainerRegistry.Repository](/reference/api/csharp/aspire.hosting/icontainerregistry/properties.md#repository) (if set) is prepended to the image name.
