Skip to content

Commit bbe7180

Browse files
authored
Merge pull request #249933 from guitarsheng/guitarsheng/acc-fragment-support
feat: accelerator fragment support document
2 parents 7865024 + a978f33 commit bbe7180

File tree

2 files changed

+86
-8
lines changed

2 files changed

+86
-8
lines changed

articles/spring-apps/how-to-use-accelerator.md

Lines changed: 86 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ ms.custom: devx-track-java, devx-track-extended-java, devx-track-azurecli, event
1616
1717
**This article applies to:** ❌ Basic/Standard ✔️ Enterprise
1818

19-
This article shows you how to use [Application Accelerator for VMware Tanzu](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.3/tap/GUID-application-accelerator-about-application-accelerator.html) with the Azure Spring Apps Enterprise plan to bootstrap developing your applications in a discoverable and repeatable way.
19+
This article shows you how to use [Application Accelerator for VMware Tanzu](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.5/tap/application-accelerator-about-application-accelerator.html) (App Accelerator) with the Azure Spring Apps Enterprise plan to bootstrap developing your applications in a discoverable and repeatable way.
2020

21-
Application Accelerator for VMware Tanzu helps you bootstrap developing your applications and deploying them in a discoverable and repeatable way. You can use Application Accelerator to create new projects based on published accelerator projects. For more information, see [Application Accelerator for VMware Tanzu](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.3/tap/GUID-application-accelerator-about-application-accelerator.html) in the VMware documentation.
21+
App Accelerator helps you bootstrap developing your applications and deploying them in a discoverable and repeatable way. You can use App Accelerator to create new projects based on published accelerator projects. For more information, see [Application Accelerator for VMware Tanzu](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.5/tap/application-accelerator-about-application-accelerator.html) in the VMware documentation.
2222

2323
## Prerequisites
2424

@@ -197,11 +197,11 @@ az spring application-accelerator predefined-accelerator enable \
197197

198198
In addition to using the predefined accelerators, you can create your own accelerators. You can use any Git repository in Azure Devops, GitHub, GitLab, or BitBucket.
199199

200-
Use to following steps to create and maintain your own accelerators:
200+
Use the following steps to create and maintain your own accelerators:
201201

202202
First, create a file named *accelerator.yaml* in the root directory of your Git repository.
203203

204-
You can use the *accelerator.yaml* file to declare input options that users fill in using a form in the UI. These option values control processing by the template engine before it returns the zipped output files. If you don't include an *accelerator.yaml* file, the repository still works as an accelerator, but the files are passed unmodified to users. For more information, see [Creating an accelerator.yaml file](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.3/tap/GUID-application-accelerator-creating-accelerators-accelerator-yaml.html).
204+
You can use the *accelerator.yaml* file to declare input options that users fill in using a form in the UI. These option values control processing by the template engine before it returns the zipped output files. If you don't include an *accelerator.yaml* file, the repository still works as an accelerator, but the files are passed unmodified to users. For more information, see [Creating an accelerator.yaml file](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.5/tap/application-accelerator-creating-accelerators-accelerator-yaml.html).
205205

206206
Next, publish the new accelerator.
207207

@@ -215,7 +215,7 @@ To create your own accelerator, open the **Accelerators** section and then selec
215215

216216
#### [Azure CLI](#tab/Azure-CLI)
217217

218-
Use the following command to create your own accelerator in Azure CLI.
218+
Use the following command to create your own accelerator in Azure CLI:
219219

220220
```azurecli
221221
az spring application-accelerator customized-accelerator create \
@@ -254,13 +254,15 @@ The following table describes the customizable accelerator fields.
254254
| **Git branch** | `git-branch` | The Git branch to check out and monitor for changes. You should specify only the Git branch, Git commit, or Git tag. | Optional |
255255
| **Git commit** | `git-commit` | The Git commit SHA to check out. You should specify only the Git branch, Git commit, or Git tag. | Optional |
256256
| **Git tag** | `git-tag` | The Git commit tag to check out. You should specify only the Git branch, Git commit, or Git tag. | Optional |
257+
| **Git sub path** | `git-sub-path` | The folder path inside the Git repository to consider as the root of the accelerator or fragment. | Optional |
257258
| **Authentication type** | `N/A` | The authentication type of the accelerator source repository. The type can be `Public`, `Basic auth`, or `SSH`. | Required |
258259
| **User name** | `username` | The user name to access the accelerator source repository whose authentication type is `Basic auth`. | Required when the authentication type is `Basic auth`. |
259260
| **Password/Personal access token** | `password` | The password to access the accelerator source repository whose authentication type is `Basic auth`. | Required when the authentication type is `Basic auth`. |
260261
| **Private key** | `private-key` | The private key to access the accelerator source repository whose authentication type is `SSH`. Only OpenSSH private key is supported. | Required when authentication type is `SSH`. |
261262
| **Host key** | `host-key` | The host key to access the accelerator source repository whose authentication type is `SSH`. | Required when the authentication type is `SSH`. |
262263
| **Host key algorithm** | `host-key-algorithm` | The host key algorithm to access the accelerator source repository whose authentication type is `SSH`. Can be `ecdsa-sha2-nistp256` or `ssh-rsa`. | Required when authentication type is `SSH`. |
263264
| **CA certificate name** | `ca-cert-name` | The CA certificate name to access the accelerator source repository with self-signed certificate whose authentication type is `Public` or `Basic auth`. | Required when a self-signed cert is used for the Git repo URL. |
265+
| **Type** | `type` | The type of customized accelerator. The type can be `Accelerator` or `Fragment`. The default value is `Accelerator`. | Optional |
264266

265267
To view all published accelerators, see the App Accelerators section of the **Developer Tools** page. Select the App Accelerator URL to view the published accelerators in Dev Tools Portal:
266268

@@ -273,6 +275,82 @@ To view the newly published accelerator, refresh Dev Tools Portal.
273275
> [!NOTE]
274276
> It might take a few seconds for Dev Tools Portal to refresh the catalog and add an entry for your new accelerator. The refresh interval is configured as `git-interval` when you create the accelerator. After you change the accelerator, it will also take time to be reflected in Dev Tools Portal. The best practice is to change the `git-interval` to speed up for verification after you apply changes to the Git repo.
275277
278+
### Reference a fragment in your own accelerators
279+
280+
Writing and maintaining accelerators can become repetitive and verbose as new accelerators are added. Some people create new projects by copying existing ones and making modifications, but this process can be tedious and error prone. To make the creation and maintenance of accelerators easier, Application Accelerator supports a feature named Composition that allows the reuse of parts of an accelerator, called *fragments*.
281+
282+
Use following steps to reference a fragment in your accelerator:
283+
284+
1. Publish the new accelerator of type `Fragment` using the Azure portal or the Azure CLI.
285+
286+
#### [Azure portal](#tab/Portal)
287+
288+
To create a fragment accelerator, open the **Accelerators** section, select **Add Accelerator** under the **Customized Accelerators** section, and then select **Fragment**.
289+
290+
:::image type="content" source="media/how-to-use-accelerator/add-fragment.png" alt-text="Screenshot of the Azure portal that shows the Customized Accelerators of type `Fragment`." lightbox="media/how-to-use-accelerator/add-fragment.png":::
291+
292+
#### [Azure CLI](#tab/Azure-CLI)
293+
294+
Use the following command to create a customized accelerator of type `Fragment`:
295+
296+
```azurecli
297+
az spring application-accelerator customized-accelerator create \
298+
--resource-group <resource-group-name> \
299+
--service <service-instance-name> \
300+
--name <fragment-accelerator-name> \
301+
--display-name <display-name> \
302+
--type Fragment \
303+
[--git-sub-path <sub project path>] \
304+
--git-url <git-repo-URL>
305+
```
306+
307+
1. Change the *accelerator.yaml* file in your accelerator project. Use the `imports` instruction in the `accelerator` section and the `InvokeFragment` instruction in the `engine` section to reference the fragment in the accelerator, as shown in the following example:
308+
309+
```yaml
310+
accelerator:
311+
...
312+
# options for the UI
313+
options:
314+
...
315+
imports:
316+
- name: <fragment-accelerator-name>
317+
...
318+
319+
engine:
320+
chain:
321+
...
322+
- merge:
323+
- include: [ "**" ]
324+
- type: InvokeFragment
325+
reference: <fragment-accelerator-name>
326+
```
327+
328+
1. Synchronize the change with the Dev Tools Portal.
329+
330+
To reflect the changes on the Dev Tools Portal more quickly, you can provide a value for the **Git interval** field of your customized accelerator. The **Git interval** value indicates how frequently the system checks for updates in the Git repository.
331+
332+
1. Synchronize the change with your customized accelerator on the Azure portal by using the Azure portal or the Azure CLI.
333+
334+
#### [Azure portal](#tab/Portal)
335+
336+
The following list shows the two ways you can sync changes:
337+
338+
- Create or update your customized accelerator.
339+
- Open the **Accelerators** section, and then select **Sync certificate**.
340+
341+
#### [Azure CLI](#tab/Azure-CLI)
342+
343+
Use the following command to sync changes for an accelerator:
344+
345+
```azurecli
346+
az spring application-accelerator customized-accelerator sync-cert \
347+
--name <customized-accelerator-name> \
348+
--service <service-instance-name> \
349+
--resource-group <resource-group-name>
350+
```
351+
352+
For more information, see [Use fragments in Application Accelerator](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.5/tap/application-accelerator-creating-accelerators-composition.html) in the VMware documentation.
353+
276354
### Use accelerators to bootstrap a new project
277355

278356
Use the following steps to bootstrap a new project using accelerators:
@@ -301,7 +379,7 @@ Use the following steps to bootstrap a new project using accelerators:
301379

302380
### Configure accelerators with a self-signed certificate
303381

304-
When you set up a private Git repository and enable HTTPS with a self-signed certificate, you should configure the CA certificate name to the accelerator for client cert verification from the accelerator to the Git repository.
382+
When you set up a private Git repository and enable HTTPS with a self-signed certificate, you should configure the CA certificate name to the accelerator for client certificate verification from the accelerator to the Git repository.
305383

306384
Use the following steps to configure accelerators with a self-signed certificate:
307385

@@ -337,7 +415,7 @@ As certificates expire, you need to rotate certificates in Spring Cloud Apps by
337415
1. Import the certificates into Azure Spring Apps. For more information, see the [Import a certificate](how-to-use-tls-certificate.md#import-a-certificate) section of [Use TLS/SSL certificates in your application in Azure Spring Apps](how-to-use-tls-certificate.md).
338416
1. Synchronize the certificates using the Azure portal or the Azure CLI.
339417

340-
The accelerators will not automatically use the latest certificate. You should sync one or all certificates by using the Azure portal or the Azure CLI.
418+
The accelerators won't automatically use the latest certificate. You should sync one or all certificates by using the Azure portal or the Azure CLI.
341419

342420
#### [Azure portal](#tab/Portal)
343421

@@ -368,7 +446,7 @@ You can enable App Accelerator under an existing Azure Spring Apps Enterprise pl
368446

369447
### [Azure portal](#tab/Portal)
370448

371-
If a Dev tools public endpoint has already been exposed, you can enable App Accelerator, and then use <kbd>Ctrl</kbd>+<kbd>F5</kdb> to deactivate the browser cache to view it on the Dev Tools Portal.
449+
If a Dev tools public endpoint has already been exposed, you can enable App Accelerator, and then press <kbd>Ctrl</kbd>+<kbd>F5</kbd> to deactivate the browser cache to view it on the Dev Tools Portal.
372450

373451
Use the following steps to enable App Accelerator under an existing Azure Spring Apps Enterprise plan instance using the Azure portal:
374452

156 KB
Loading

0 commit comments

Comments
 (0)