> For the complete documentation index, see [llms.txt](https://docs.smsagent.blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.smsagent.blog/azure-solutions/automated-azure-table-storage-backups/deploy-the-solution/add-role-assignments-to-the-storage-account-s.md).

# Add role assignments to the storage account/s

Before the solution can backup your storage tables, it needs to be granted access to the storage account containing the Azure tables that you want to backup. Specifically, the system managed identity of the function app needs to be granted the **Storage Table Data Reader** and **Storage Blob Data Contributor** roles to the storage account.

The script below can do this for you. You'll need to run this against every storage account where you are backing up tables.

{% embed url="<https://github.com/SMSAgentSoftware/AzureTableBackup/blob/main/Add-AzStorageAccountRoleAssigments.ps1>" %}

Download the script and set the parameters at the top of the script:

* **Tenant** (tenant Id)
* **Subscription** (subscription name)
* **StorageAccountName** (the name of the storage account containing the tables you want to backup)

<figure><img src="/files/5kii23XrR9lzmvnsXGeY" alt=""><figcaption></figcaption></figure>

Execute the script, and upon successful execution the new role assigments will be reported:

<figure><img src="/files/Q3xfVOYoYE3TL0ZKjgOV" alt=""><figcaption></figcaption></figure>

In the storage account in the Azure portal, in the **Access Control (IAM)** blade, in the **Role assignments** tab, you will see the new role assignments added.

<figure><img src="/files/eab5TPGP4xsrolNQuezT" alt=""><figcaption></figcaption></figure>


---

# 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://docs.smsagent.blog/azure-solutions/automated-azure-table-storage-backups/deploy-the-solution/add-role-assignments-to-the-storage-account-s.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.
