> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/action-center/microsoft-azure/create-azure-tag.md).

# Create Azure Tag

**Create Azure Tag** adds tags to the Azure resources behind your devices. It signs in to Microsoft Entra ID with a client ID and secret, then, for each device, sends a tag **Merge** request for that device's Azure resource ID. Existing tags on the resource are kept; the tags you define are added or updated.

### Before you begin

* An Azure app registration (tenant ID, client ID, client secret) that is allowed to write tags on the target resources.
* Devices must come from the Azure adapter: the job needs the `Specifics.azure.id` column (the Azure resource ID). Devices without it are skipped.
* Asset type: device only (the default for jobs that do not override it).
* The connection fields can be pre-filled in [Action Center Settings](broken://pages/5fdf78af66251b0212cbebf2c60bf0c02e811bcc), on the Microsoft Azure tab.

### Settings

| Setting             | Type        | Required | Default                                 | Description                                                                                                                                                |
| ------------------- | ----------- | -------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization Scope | Text        | Yes      | `https://management.azure.com/.default` | The OAuth scope requested for the token.                                                                                                                   |
| Tenant ID           | Text        | Yes      | None                                    | Your Microsoft Entra tenant ID.                                                                                                                            |
| Client ID           | Text        | Yes      | None                                    | The app registration's client ID.                                                                                                                          |
| Client Secret       | Text        | Yes      | None                                    | The app registration's client secret. Not marked as sensitive in the form, so it is not masked.                                                            |
| API Version         | Text        | Yes      | `2021-04-01`                            | The `api-version` used for the tags request.                                                                                                               |
| Tags                | Text (JSON) | Yes      | `{}`                                    | A JSON object of tag names and values, for example `{"TestTag": "SafeValue"}`. Anything that is not valid JSON or not an object is rejected when you save. |

### How it works

1. The job requests an access token for the tenant with the client credentials grant. If the request fails or no token comes back, the job fails.
2. For each device that has an Azure resource ID, it sends a `PATCH` to `https://management.azure.com/<resource id>/providers/Microsoft.Resources/tags/default` with `operation: Merge` and your tags.
3. A device with an empty ID is skipped with a warning. A request that returns HTTP 400 or higher is logged as an error with the response text, and the job continues with the next device. Successes are logged per resource.
4. It sends one request per device. The job does not change the assets it passes on.

### Example

| Setting       | Value                                      |
| ------------- | ------------------------------------------ |
| Tenant ID     | `YOUR_TENANT_ID`                           |
| Client ID     | `YOUR_CLIENT_ID`                           |
| Client Secret | `YOUR_CLIENT_SECRET`                       |
| Tags          | `{"owner": "it-team", "reviewed": "true"}` |

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>About Action Center</strong></td><td>Workflows, triggers, conditions and job nodes.</td><td><a href="broken://pages/be865685c8d039031ffb4f97e0f4a1cd09569228">Broken link</a></td></tr><tr><td><strong>Action Center Settings</strong></td><td>Save connection defaults for jobs.</td><td><a href="broken://pages/5fdf78af66251b0212cbebf2c60bf0c02e811bcc">Broken link</a></td></tr></tbody></table>

{% hint style="info" %}
Available starting from version 6.0.0.
{% endhint %}
