# Adding Azure Container Registry (ACR) with Pulumi

**Azure Container Registry (ACR)** is a fully managed Docker container registry in Azure that allows you to store and manage container images for use in **Azure Kubernetes Service (AKS)**, **Azure App Service**, and other containerized workloads. ACR supports private container registries, image scanning, vulnerability detection, and integration with Azure Active Directory (AAD) for secure access control.

ACR makes it easy to manage your containerized applications by offering scalable, secure, and private repositories for storing Docker images and OCI artifacts.

Using Pulumi, you can define, deploy, and manage an ACR instance as part of your infrastructure code.

In `resources` folder, you create a new file named `containerregistry.ts` and add the below code to create an Azure Resource Group and an Azure Container Registry using **TypeScript**.

```typescript
// resources/containerregistry.ts

import * as azure from "@pulumi/azure-native/";
import * as pulumi from "@pulumi/pulumi";
import { config } from "../config";

export const createContainerRegistry = (resourceGroupName: pulumi.Input<string>) => {
    // Create the Azure Container Registry (ACR)
    const containerRegistry = new azure.containerregistry.Registry("aksregistry", {
        resourceGroupName: resourceGroupName, // Reference the resource group
        sku: {
            name: "Standard", // ACR pricing tier: Basic, Standard, or Premium
        },
        adminUserEnabled: true, // Optional: Enable the admin user (useful for simple scenarios)
        location: config.location // Set location same as the resource group
    });
    
    // Return ACR resource
    return containerRegistry;
}
```

#### **Key Parameters Explained:**

* **`resourceGroupName`**: This is the name of the Azure resource group where the registry will be created.
* **`sku.name`**: ACR offers different pricing tiers, such as `Basic`, `Standard`, and `Premium`. You can choose one depending on your requirements.
  * **Basic**: Suitable for dev/test environments.
  * **Standard**: Best for most production workloads.
  * **Premium**: Offers features like geo-replication, content trust, and private link access.
* **`adminUserEnabled`**: When set to `true`, this enables a local admin account that can be used to authenticate with the ACR. This is useful for testing and simple deployments but should be disabled for production systems.

You will make some changes from `index.ts` that include the method to create the Azure Container Registry:

```typescript
...
import { createContainerRegistry } from "./resources/containerregistry";
...
// Create azure container registry (acr)
export const containerRegistry = createContainerRegistry(resourceGroup.name);
...
```

You can preview the changes Pulumi will make using the following command:

```bash
pulumi preview
```


---

# 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://hahoangv.gitbook.io/azure-kubernetes-service/hands-on-provisioning-and-configuring-an-aks-cluster-on-azure-with-pulumi/configure-kubernetes-resources/adding-azure-container-registry-acr-with-pulumi.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.
