|
| 1 | +--- |
| 2 | +title: Azure Blob Storage |
| 3 | +--- |
| 4 | + |
| 5 | +# How to connect to Azure Blob Storage |
| 6 | + |
| 7 | +:::info |
| 8 | + |
| 9 | +This guide assumes Storage Account-level permissions. If you had Azure IAM (Identity) rights, you could use "Service Principals" or "Entra ID" logins, which remains outside the scope of this documentation. |
| 10 | + |
| 11 | +::: |
| 12 | + |
| 13 | +## Public access |
| 14 | + |
| 15 | +This set-up allows you to provide access to data publicly without requiring authentication with **read-only** access. For setting this up, you just need your Azure storage account name and the container name. Bear in mind that access is controlled entirely at container level. |
| 16 | + |
| 17 | +### Azure portal configuration |
| 18 | + |
| 19 | +1. **Account level:** Go to **Settings > Configuration** and set **Allow Blob anonymous access** to **Enabled**. |
| 20 | + |
| 21 | + <p class="image-container-xl"> |
| 22 | +  |
| 23 | + </p> |
| 24 | + |
| 25 | +2. **Container level:** Go to **Data storage > Containers**, select your container, and click **Change access level**. |
| 26 | + - Select **Container**, which allows anonymously listing files and downloading. |
| 27 | + |
| 28 | + <p class="image-container-xl"> |
| 29 | +  |
| 30 | + </p> |
| 31 | + |
| 32 | +### Set up in Renku |
| 33 | + |
| 34 | +1. Under **Data** section click on **+** button |
| 35 | +2. Go to the tab **+ Create a data connector** and select **azureblob**. |
| 36 | +3. Click on **Next** |
| 37 | + |
| 38 | +<p class="image-container-s"> |
| 39 | + |
| 40 | +</p> |
| 41 | + |
| 42 | +4. Set the following parameters in **Connection information**: |
| 43 | + 1. **Source path**: the `container_name` as specified in the storage account you are using (e.g. `my-container`). You can also mount a sub-folder by appending it to the bucket name with a slash, e.g. `my-container/sub-folder`. |
| 44 | + 2. **Account Name**: the storage account name, e.g. `elisabettestsa` |
| 45 | + |
| 46 | +5. Click on **Test connection** and if succeeds, click **Next** |
| 47 | + |
| 48 | +<p class="image-container-s"> |
| 49 | + |
| 50 | +</p> |
| 51 | + |
| 52 | +6. On the last page, fill in the final details for your data connector, namely: |
| 53 | + 1. **Name**: pick any name for the data connector (e.g. `data`) |
| 54 | + 2. **Owner:** select the namespace of the data connector (e.g. the user's, project's or a group's). |
| 55 | + 3. **Visibility:** decide whether the data connector should be Public or Private. |
| 56 | + 4. **Read-only**: keep it as read-only access. |
| 57 | + |
| 58 | +7. Click on **+ Add connector**. |
| 59 | + |
| 60 | +<p class="image-container-s"> |
| 61 | + |
| 62 | +</p> |
| 63 | + |
| 64 | +:::warning |
| 65 | + |
| 66 | +If you set up an Azure blob for public access from a public project, anyone who |
| 67 | +can see your project may be able to pull data from the storage account. This |
| 68 | +could incurr egress costs on your Azure subsciption. |
| 69 | + |
| 70 | +## Restricted access |
| 71 | + |
| 72 | +Use this option to share data securely with your collaborators and stakeholders, controlling their access rights (e.g. read-only, write and delete files). |
| 73 | + |
| 74 | +### Azure portal configuration |
| 75 | + |
| 76 | +1. Go to **Data storage > Containers > [Your container] > Settings > Shared access tokens**. Select the desired permissions (e.g. **Read** and **List** for read-only access, select on top **Add**, **Create** and **Write** for read and write access, avoid **Delete** if you want an append/upload-only environment). |
| 77 | + |
| 78 | + <p class="image-container-xl"> |
| 79 | +  |
| 80 | + </p> |
| 81 | + |
| 82 | +2. Click on the button **Generate SAS token and URL**. |
| 83 | +3. Copy the generated **SAS URL** field. |
| 84 | + |
| 85 | + <p class="image-container-xl"> |
| 86 | +  |
| 87 | + </p> |
| 88 | + |
| 89 | +### Set up in Renku |
| 90 | + |
| 91 | +Proceed to steps 1 to 3 from the [Public access set-up](#set-up-in-renku). |
| 92 | + |
| 93 | +4. In **Connection information**, click on **Show full options list** and set the following parameters: |
| 94 | + 1. **Source path**: the storage account name, e.g. `elisabettestsa`. You can also mount a sub-folder by appending it to the bucket name with a slash, e.g. `my-container/sub-folder`. |
| 95 | + 2. **sas_url**: the `blob_sas_url` as generated in your storage account. |
| 96 | + |
| 97 | +Continue with steps 5 to 7 as presented in the [public access set-up](#set-up-in-renku). |
| 98 | + |
| 99 | +:::warning |
| 100 | + |
| 101 | +You will need to share the sas_url value with your collaborators since they will be requested to enter the credentials. This will be stored as a user secret. Note also that SAS links expire and there is no automated process for renewing them, so you will need to generate a new one manually. |
| 102 | + |
| 103 | +::: |
| 104 | + |
| 105 | +:::info |
| 106 | + |
| 107 | +The most advanced way to manage external access in Azure is through controlled access with revocation, which allows you to revoke access immediately without changing account keys. You need to create the policy under **Containers > [Your Container] > Settings > Access policy** and click **+ Add policy**. Define a name and the permissions. When you are creating the shared access token, select the policy you just created under **Stored access policy**. If you delete the policy in Azure, access to the container will be instantly revoked. |
| 108 | + |
| 109 | +::: |
| 110 | + |
| 111 | +## Full access to your storage account |
| 112 | + |
| 113 | +This set-up allows you to have access to your full Azure storage account, with the access rights that you decide to set-up. |
| 114 | + |
| 115 | +### Azure portal configuration |
| 116 | + |
| 117 | +1. Go to **Security + networking > Shared access signature**. Select **Blob** service, **Service/Container/Object** types, and check **ONLY Read** and **List**. |
| 118 | + |
| 119 | + <p class="image-container-xl"> |
| 120 | +  |
| 121 | + </p> |
| 122 | + |
| 123 | +### Set up in Renku |
| 124 | + |
| 125 | +Proceed to steps 1 to 3 from the [Public access set-up](#set-up-in-renku). |
| 126 | + |
| 127 | +4. Set the following parameters in **Connection information**: |
| 128 | + 1. **Source path**: the `container_name` as specified in the storage account you are using (e.g. `my-container`). You can also mount a sub-folder by appending it to the bucket name with a slash, e.g. `my-container/sub-folder`. |
| 129 | + 2. **Account Name**: the storage account name, e.g. `elisabettestsa` |
| 130 | + |
| 131 | +5. Click on **Test connection** and if succeeds, click **Next** |
| 132 | + |
| 133 | +<p class="image-container-s"> |
| 134 | + |
| 135 | +</p> |
| 136 | + |
| 137 | +6. On the last page, fill in the final details for your data connector, namely: |
| 138 | + 1. **Name**: pick any name for the data connector (e.g. `data`) |
| 139 | + 2. **Owner:** select the namespace of the data connector (e.g. the user's, project's or a group's). |
| 140 | + 3. **Visibility:** decide whether the data connector should be Public or Private. |
| 141 | + 4. **Read-only**: do not uncheck this box, or the data connector will not work properly. |
| 142 | + |
| 143 | +7. Click on **+ Add connector**. |
0 commit comments