You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article shows you how to enable your own persistent storage in Azure Spring Apps.
22
22
23
-
When you use the built-in persistent storage in Azure Spring Apps, artifacts generated by your application are uploaded into Azure Storage Accounts. Microsoft controls the encryption-at-rest and lifetime management policies for those artifacts.
23
+
When you use the built-in persistent storage in Azure Spring Apps, artifacts generated by your application are uploaded into Azure Storage Accounts. Microsoft controls the encryption-at-rest and lifetime management policies for those artifacts.
24
24
25
-
With Bring Your Own Storage, these artifacts are uploaded into a storage account that you control. That means you control the encryption-at-rest policy, the lifetime management policy and network access. You will, however, be responsible for the costs associated with that storage account.
25
+
When you use your own persistent storage, artifacts generated by your application are uploaded into a storage account that you control. You control the encryption-at-rest policy, the lifetime management policy, and network access. You're responsible for the costs associated with that storage account.
26
26
27
27
## Prerequisites
28
28
29
-
* An existing Azure Storage Account and a pre-created Azure File Share. If you need to create a storage account and file share in Azure, see [Create an Azure file share](../storage/files/storage-how-to-create-file-share.md).
30
-
* The [Azure Spring Apps extension](/cli/azure/azure-cli-extensions-overview) for the Azure CLI
29
+
- An existing Azure Storage Account and a pre-created Azure File Share. If you need to create a storage account and file share in Azure, see [Create an SMB Azure file share](../storage/files/storage-how-to-create-file-share.md).
30
+
-[Azure CLI](/cli/azure/install-azure-cli), version 2.0.67 or higher.
31
31
32
32
> [!IMPORTANT]
33
-
> If you deployed your Azure Spring Apps in your own virtual network and you want the storage account to be accessed only from the virtual network, consult the following guidance:
34
-
> -[Use private endpoints for Azure Storage](../storage/common/storage-private-endpoints.md)
35
-
> -[Configure Azure Storage firewalls and virtual networks](../storage/common/storage-network-security.md), especially the [Grant access from a virtual network using service endpoint](../storage/common/storage-network-security.md#grant-access-from-a-virtual-network) section
33
+
> If you deployed your Azure Spring Apps in your own virtual network and you want the storage account to be accessed only from the virtual network, see [Use private endpoints for Azure Storage](../storage/common/storage-private-endpoints.md) and the [Grant access from a virtual network](../storage/common/storage-network-security.md#grant-access-from-a-virtual-network) section of [Configure Azure Storage firewalls and virtual networks](../storage/common/storage-network-security.md).
36
34
37
35
## Mount your own extra persistent storage to applications
38
36
39
37
> [!NOTE]
40
-
> Updating persistent storage will result in the restart of applications.
38
+
> Updating persistent storage will restart your applications.
41
39
42
40
### [Portal](#tab/Azure-portal)
43
41
44
42
Use the following steps to bind an Azure Storage account as a storage resource in your Azure Spring Apps and create an app with your own persistent storage.
45
43
46
-
1. Go to the service **Overview** page, then select **Storage** in the left-hand navigation pane.
44
+
1. Go to the service **Overview** page, and then select **Storage** in the left-hand navigation pane.
47
45
48
-
1. On the **Storage** page, select **Add storage**, add the values in the following table, and then select **Apply**.
46
+
1. On the **Storage** page, select **Add storage**.
47
+
48
+
:::image type="content" source="media/how-to-custom-persistent-storage/add-storage.png" alt-text="Screenshot of Azure portal showing the Storage page." lightbox="media/how-to-custom-persistent-storage/add-storage.png":::
49
+
50
+
1. Enter the following information on the **Add storage** page, and then select **Apply**.
| Storage name | The name of the storage resource, which is a service-level resource in Azure Spring Apps. |
53
55
| Account name | The name of the storage account. |
54
56
| Account key | The storage account key. |
55
57
56
-
:::image type="content" source="media/how-to-custom-persistent-storage/add-storage-resource.png" alt-text="Screenshot of Azure portal showing the Storage page and the 'Add storage' pane." lightbox="media/how-to-custom-persistent-storage/add-storage-resource.png":::
58
+
:::image type="content" source="media/how-to-custom-persistent-storage/add-storage-resource.png" alt-text="Screenshot of Azure portal showing the Add storage page." lightbox="media/how-to-custom-persistent-storage/add-storage-resource.png":::
57
59
58
-
1. Go to the **Apps** page, then select an application to mount the persistent storage.
60
+
1. Go to the **Apps** page, and then select an application to mount the persistent storage.
59
61
60
62
:::image type="content" source="media/how-to-custom-persistent-storage/select-app-mount-persistent-storage.png" alt-text="Screenshot of Azure portal Apps page." lightbox="media/how-to-custom-persistent-storage/select-app-mount-persistent-storage.png":::
61
63
62
-
1. Select **Configuration**, then select **Persistent Storage**.
64
+
1. Select **Configuration**, and then select **Persistent Storage**.
63
65
64
-
1. Select **Add persistent storage**, add the values in the following table, and then select **Apply**.
66
+
1. Select **Add persistent storage**. Add the values in the following table, and then select **Apply**.
:::image type="content" source="media/how-to-custom-persistent-storage/add-persistent-storage.png" alt-text="Screenshot of Azure portal showing the Add persistent storage page." lightbox="media/how-to-custom-persistent-storage/add-persistent-storage.png":::
76
78
77
-
1. Select **Save** to apply all the configuration changes.
79
+
1. Select **Save** to apply the configuration changes.
78
80
79
-
:::image type="content" source="media/how-to-custom-persistent-storage/save-persistent-storage-changes.png" alt-text="Screenshot of Azure portal Persistent Storage section of the Configuration page." lightbox="media/how-to-custom-persistent-storage/save-persistent-storage-changes.png":::
81
+
:::image type="content" source="media/how-to-custom-persistent-storage/save-persistent-storage-changes.png" alt-text="Screenshot of Azure portal showing the Persistent Storage tab of the Configuration page." lightbox="media/how-to-custom-persistent-storage/save-persistent-storage-changes.png":::
80
82
81
83
### [CLI](#tab/Azure-CLI)
82
84
83
-
You can enable your own storage with the Azure CLI by using the following steps.
85
+
Use the following steps to enable your own storage with the Azure CLI.
84
86
85
-
1. Use the following command to bind your Azure Storage account as a storage resource in your Azure Spring Apps instance:
87
+
1. Use the following command to bind your Azure Storage account as a storage resource in your Azure Spring Apps instance.
86
88
87
89
```azurecli
88
90
az spring storage add \
@@ -104,7 +106,7 @@ You can enable your own storage with the Azure CLI by using the following steps.
104
106
--persistent-storage <path-to-JSON-file>
105
107
```
106
108
107
-
Here's a sample of the JSON file that is passed to the `--persistent-storage` parameter in the create command:
109
+
The following example shows a JSON file that is passed to the `--persistent-storage` parameter.
108
110
109
111
```json
110
112
{
@@ -135,7 +137,7 @@ You can enable your own storage with the Azure CLI by using the following steps.
135
137
}
136
138
```
137
139
138
-
1. Optionally, add extra persistent storage to an existing app using the following command:
140
+
1. Optionally, use the following command to add extra persistent storage to an existing app.
139
141
140
142
```azurecli
141
143
az spring app append-persistent-storage \
@@ -148,7 +150,7 @@ You can enable your own storage with the Azure CLI by using the following steps.
148
150
--storage-name <storage-resource-name>
149
151
```
150
152
151
-
1. Optionally, list all existing persistent storage of a specific storage resource using the following command:
153
+
1. Optionally, use the following command to list the existing persistent storage of a specific storage resource.
152
154
153
155
```azurecli
154
156
az spring storage list-persistent-storage \
@@ -159,59 +161,59 @@ You can enable your own storage with the Azure CLI by using the following steps.
159
161
160
162
---
161
163
162
-
## Use best practices
164
+
## Best practices
163
165
164
-
Use the following best practices when adding your own persistent storage to Azure Spring Apps.
166
+
Use the following best practices when you add your own persistent storage to Azure Spring Apps.
165
167
166
-
* To avoid potential latency issues, place the Azure Spring Apps instance and the Azure Storage Account in the same Azure region.
168
+
- To avoid potential latency issues, place the Azure Spring Apps instance and the Azure Storage Account in the same Azure region.
167
169
168
-
* In the Azure Storage Account, avoid regenerating the account key that's being used. The storage account contains two different keys. Use a step-by-step approach to ensure that the persistent storage remains available to the applications during key regeneration.
170
+
- In the Azure Storage Account, avoid regenerating the account key that you're using. The storage account contains two different keys. Use a step-by-step approach to ensure that the persistent storage remains available to applications during key regeneration.
169
171
170
-
For example, assuming that you used key1 to bind a storage account to Azure Spring Apps, you would use the following steps:
172
+
For example, use the following steps to ensure that the persistent storage remains available if you used *key1* to bind a storage account to Azure Spring Apps.
171
173
172
-
1. Regenerate key2.
173
-
1. Update the account key of the storage resource to use the regenerated key2.
174
-
1. Restart the applications that mount the persistent storage from this storage resource. (You can use `az spring storage list-persistent-storage` to list all related applications.)
175
-
1. Regenerate key1.
174
+
1. Regenerate *key2*.
175
+
1. Update the account key of the storage resource to use the regenerated *key2*.
176
+
1. Restart the applications that mount the persistent storage from this storage resource. Use the `az spring storage list-persistent-storage`command to list all related applications.
177
+
1. Regenerate *key1*.
176
178
177
-
* If you delete an Azure Storage Account or Azure File Share, remove the corresponding storage resource or persistent storage in the applications to avoid possible errors.
179
+
- If you delete an Azure Storage account or Azure file share, avoid possible errors by removing the corresponding storage resource or persistent storage in the applications.
178
180
179
-
## FAQs
181
+
## FAQ
180
182
181
-
The following are frequently asked questions (FAQ) about using your own persistent storage with Azure Spring Apps.
183
+
This section addresses frequently asked questions about using your own persistent storage with Azure Spring Apps.
182
184
183
-
* If I have built-in persistent storage enabled, and then I enabled my own storage as extra persistent storage, will my data be migrated into my Storage Account?
185
+
- If I have built-in persistent storage enabled, and then I enabled my own storage as extra persistent storage, will my data be migrated into my Azure Storage account?
184
186
185
187
*No. But we're going to provide a document to help you do the migration yourself soon.*
186
188
187
-
* What are the reserved mount paths?
189
+
- What are the reserved mount paths?
188
190
189
-
*These mount paths are reserved by the Azure Spring Apps service:*
191
+
*The following mount paths are reserved by the Azure Spring Apps service:*
190
192
191
-
**/tmp*
192
-
**/persistent*
193
-
**/secrets*
194
-
**/app-insights/agents*
195
-
**/etc/azure-spring-cloud/certs*
196
-
**/app-insights/agents/settings*
197
-
**/app-lifecycle/settings*
193
+
-*/tmp*
194
+
-*/persistent*
195
+
-*/secrets*
196
+
-*/app-insights/agents*
197
+
-*/etc/azure-spring-cloud/certs*
198
+
-*/app-insights/agents/settings*
199
+
-*/app-lifecycle/settings*
198
200
199
-
* What are the available mount options?
201
+
- What are the available mount options?
200
202
201
-
*We currently support the following mount options:*
203
+
*We currently support the following mount options:*
202
204
203
-
*`uid`
204
-
*`gid`
205
-
*`file_mode`
206
-
*`dir_mode`
205
+
-`uid`
206
+
-`gid`
207
+
-`file_mode`
208
+
-`dir_mode`
207
209
208
210
*The `mountOptions` property is optional. The default values for above mount options are: ["uid=0", "gid=0", "file_mode=0777", "dir_mode=0777"]*
209
211
210
-
* I'm using the service endpoint to configure the storage account to allow access only from my own virtual network. Why did I receive *Permission Denied*while trying to mount custom persistent storage to my applications?
212
+
- I'm using the service endpoint to configure the storage account to allow access only from my own virtual network. Why did I receive a *Permission Denied*error when I tried to mount custom persistent storage to my applications?
211
213
212
-
*A service endpoint provides network access on a subnet level only. Be sure you've added both subnets used by the Azure Spring Apps instance to the scope of the service endpoint.*
214
+
*A service endpoint provides network access on a subnet level only. Make sure you've added both subnets used by the Azure Spring Apps instance to the scope of the service endpoint.*
213
215
214
216
## Next steps
215
217
216
-
*[How to use Logback to write logs to custom persistent storage](how-to-write-log-to-custom-persistent-storage.md).
217
-
*[Scale an application in Azure Spring Apps](how-to-scale-manual.md).
218
+
-[How to use Logback to write logs to custom persistent storage](how-to-write-log-to-custom-persistent-storage.md).
219
+
-[Scale an application in Azure Spring Apps](how-to-scale-manual.md).
0 commit comments