> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/~/revisions/27oApOKWT7NW06uHiiU1/aikido-autofix/connect-private-packages/poetry-private-packages.md).

# Poetry - Private packages

When letting Aikido update your dependencies in repositories with private packages, Aikido would need to also have access to the private packages so that we can properly update your lockfiles. For Poetry, you can provide a **Google Artifact Registry** configuration service key or provide environment variables in Aikido for this.

## Adding credentials with environment variables <a href="#adding-credentials-with-environment-variables" id="adding-credentials-with-environment-variables"></a>

When the credentials to connect to the private registry are static, you can provide [custom environment variables](/~/revisions/27oApOKWT7NW06uHiiU1/aikido-autofix/connect-private-packages/custom-config-private-packages.md) for this in the private registry connection modal. The environment variables should be created in the following format:

* `POETRY_HTTP_BASIC_[SOURCE_NAME]_USERNAME`
* `POETRY_HTTP_BASIC_[SOURCE_NAME]_PASSWORD`

Where the `[SOURCE_NAME]` is the name of the data source which you specified in your `pyproject.toml` file in uppercase. For example, set `POETRY_HTTP_BASIC_ARTIFACT_USERNAME` and `POETRY_HTTP_BASIC_ARTIFACT_PASSWORD` for the following project file:

```
[[tool.poetry.source]]
name = "artifact"
url = "https://repo-1234567890.d.codeartifact.eu-west-1.amazonaws.com/pypi/poetry/simple/"
```

If you are using AWS CodeArtifact in combination with Poetry, see this [page](/~/revisions/27oApOKWT7NW06uHiiU1/aikido-autofix/connect-private-packages/aws-codeartifact-private-packages.md).

When creating a PR via Autofix, Aikido will include these environment variables when running poetry commands.

## Adding credentials for GCP Artifact Registry <a href="#adding-credentials-for-gcp-artifact-registry" id="adding-credentials-for-gcp-artifact-registry"></a>

For some registries, the credentials can not be generated statically, such as for GCP Artifact registry. In this case you can follow the steps below.

### 1. Create a Service Account <a href="#id-1-create-a-service-account" id="id-1-create-a-service-account"></a>

First, create a service account in your Google Cloud project:

1. Go to the Google Cloud Console.
2. Navigate to **IAM & Admin** > **Service Accounts**.
3. Click **Create Service Account**.
4. Fill in a **Service account name** such as `Aikido Artifact Registry Reader` and click **Create And Continue**.
5. Grant the service account with the **Artifact Registry Reader** role.

   <img src="/files/6UGelb2Yw800R4GWwCeY" alt="Assigning the &#x22;Artifact Registry Reader&#x22; role to a service account in a Google Cloud project." width="563">
6. Click **Continue** and **Done**.

### 2. Create a Key for the Service Account <a href="#id-2-create-a-key-for-the-service-account" id="id-2-create-a-key-for-the-service-account"></a>

1. On the **Service Accounts** page, find the service account you just created.
2. Click on the three dots on the right and select **Manage Keys**.
3. Click **Add Key** > **Create New Key**.
4. Choose **JSON** and click **Create**.
5. Save the JSON key file to a secure location.

### 3. Configuration in Aikido <a href="#id-3-configuration-in-aikido" id="id-3-configuration-in-aikido"></a>

Once the prerequisites are fulfilled, you can configure aikido to authenticate with your private registry when updating the dependencies by following the steps below:

1. Go to your account's settings page for the autofixer in Aikido, [here](https://app.aikido.dev/settings/integrations/autofix).
2. Click on **Manage private registry connection**, the configuration modal will now be shown
3. Select **Poetry** from the tab bar

   <img src="/files/UZpVKZQADd8tyJeoGpEr" alt="Configure private registry access for multiple package managers, including Poetry, using an account key." width="563">
4. Paste your saved **JSON Key** content in the **Private registry service account key** field
5. Click **Save** to save the configuration.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/~/revisions/27oApOKWT7NW06uHiiU1/aikido-autofix/connect-private-packages/poetry-private-packages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
