# WithPasswordAuthentication

- Module: [Aspire.Hosting.Azure.PostgreSQL](/reference/api/go/aspire.hosting.azure.postgresql.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`AzurePostgresFlexibleServerResource`](/reference/api/go/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Configures password authentication for Azure PostgreSQL Flexible Server

## Definition

```go
func (AzurePostgresFlexibleServerResource) WithPasswordAuthentication(options ...*WithPasswordAuthenticationOptions) AzurePostgresFlexibleServerResource
```

## Parameters

- `options` (`...*WithPasswordAuthenticationOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithPasswordAuthenticationOptions` argument.

- `KeyVaultBuilder` ([`*AzureKeyVaultResource`](/reference/api/go/aspire.hosting.azure.postgresql/azurekeyvaultresource.md))
- `UserName` (`*ParameterResource`)
- `Password` (`*ParameterResource`)

## Returns

[`AzurePostgresFlexibleServerResource`](/reference/api/go/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource.md)

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`AzurePostgresFlexibleServerResource`](/reference/api/go/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource.md)
