# Create new account for Argo CD with API key and RBAC permissions

Following are the sequence of activities for creating a new account for Argo CD with API key and RBAC permissions.

1. [**Add account to Argo CD via configmap**](#add-account-to-argo-cd-via-configmap)
2. [**Add RBAC admin permission to user via configmap**](#add-rbac-admin-permission-to-user-via-configmap)
3. [**Create password for new Argo CD account**](#create-password-for-new-argo-cd-account)

### Add account to Argo CD via configmap

1. Get the configmap **argocd-cm** of Argo CD by executing the below command.

   ```
   kubectl get configmap argocd-cm -n argocd -o yaml > argocd-cm.yml
   ```
2. Edit the configmap file `argocd-cm.yml` and add the below line under "**data**" with **new account** which has **API Key** and **login**.

   ```
   data:
    accounts.argo-account: apiKey, login
   ```

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong>: Please note that in the above command “<strong>argo-account</strong>” is the new account name. You are free to choose any name for your account.</p></div>
3. Apply the configmap by executing the below command . This will add a new account and allow that account to process an API key as well as login via the Command Line Interface and Graphical User Interface.

   ```
   kubectl apply -f argocd-cm.yml -n argocd
   ```

### Add RBAC admin permission to user via configmap

1. Get the configmap **argocd-rbac-cm** of Argo CD by executing the below command.

   ```
   kubectl get configmap argocd-rbac-cm -n argocd -o yaml > argocd-rbac-cm.yml
   ```
2. Edit the configmap file **argocd-rbac-cm.yml** and add the below section under "**data"** which has admin role permissions.

   ```
   data:
     policy.csv: |
       g, argo-account, role:admin
   ```

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong>: Please note that,by default Argo CD has <strong>admin</strong> and <strong>read-only</strong> roles.</p></div>
3. Apply the configmap by executing the below command. This will add admin permission to account.

   ```
   kubectl apply -f argocd-rbac-cm.yml -n argocd
   ```

### Create password for new Argo CD account

1. Login into Argo CD as an **admin account** via Argo CLI by executing the below command.

   ```
   argocd login SERVER
   ```

2. Create password to the new account by executing the below command. Password should contain at least one UPPERCASE.

   <pre data-overflow="wrap"><code>argocd account update-password --account argo-account --current-password current-admin-password --new-password Argo-password
   </code></pre>

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong>: Replace the “<strong>argo-account</strong>” in the above command with your new Argo account and the “<strong>current-admin-password</strong>” with the current logged in admin password.</p></div>

3. Generate token to the account. For the detailed information, refer [**here**](https://docs.opsmx.com/opsmx-intelligent-software-delivery-isd-platform-argo/additional-resources/create-api-token-in-argo-cd).


---

# Agent Instructions: 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:

```
GET https://docs.opsmx.com/opsmx-1/opsmx-intelligent-software-delivery-isd-platform-argo/additional-resources/create-new-account-for-argo-cd-with-api-key-and-rbac-permissions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
