|
| 1 | +--- |
| 2 | +title: How to migrate an Azure Spring Cloud Basic or Standard tier instance to Enterprise tier |
| 3 | +titleSuffix: Azure Spring Cloud Enterprise tier |
| 4 | +description: How to migrate an Azure Spring Cloud Basic or Standard tier instance to Enterprise tier |
| 5 | +author: karlerickson |
| 6 | +ms.author: xiading |
| 7 | +ms.service: spring-cloud |
| 8 | +ms.topic: how-to |
| 9 | +ms.date: 05/09/2022 |
| 10 | +ms.custom: devx-track-java, devx-track-azurecli |
| 11 | +--- |
| 12 | + |
| 13 | +# Migrate an Azure Spring Cloud Basic or Standard tier instance to Enterprise tier |
| 14 | + |
| 15 | +**This article applies to:** ✔️ Basic/Standard tier ✔️ Enterprise tier |
| 16 | + |
| 17 | +This article shows you how to migrate an existing application in Basic or Standard tier to Enterprise tier. When you migrate from Basic or Standard tier to Enterprise tier, VMware Tanzu components will replace the OSS Spring Cloud components to provide more feature support. |
| 18 | + |
| 19 | +## Prerequisites |
| 20 | + |
| 21 | +- An already provisioned Azure Spring Cloud Enterprise tier service instance with Spring Cloud Gateway for Tanzu enabled. For more information, see [Quickstart: Provision an Azure Spring Cloud service instance using Enterprise tier](./quickstart-provision-service-instance-enterprise.md). However, you won't need to change any code in your applications. |
| 22 | +- [Azure CLI version 2.0.67 or later](/cli/azure/install-azure-cli). |
| 23 | + |
| 24 | +## Using Application Configuration Service for configuration |
| 25 | + |
| 26 | +In Enterprise tier, Application Configuration Service provides external configuration support for your apps. Managed Spring Cloud Config Server is only available in Basic and Standard tiers and is not available in Enterprise tier. |
| 27 | + |
| 28 | +## Configure Application Configuration Service for Tanzu settings |
| 29 | + |
| 30 | +Follow these steps to use Application Configuration Service for Tanzu as a centralized configuration service. |
| 31 | + |
| 32 | +# [Azure portal](#tab/azure-portal) |
| 33 | + |
| 34 | +1. Select **Application Configuration Service**. |
| 35 | +1. Select **Overview** to view the running state and resources allocated to Application Configuration Service for Tanzu. |
| 36 | + |
| 37 | + :::image type="content" source="./media/enterprise/getting-started-enterprise/config-service-overview.png" alt-text="Application Configuration Service Overview screen" lightbox="./media/enterprise/getting-started-enterprise/config-service-overview.png"::: |
| 38 | + |
| 39 | +1. Select **Settings**, then add a new entry in the **Repositories** section with the Git backend information. |
| 40 | + |
| 41 | +1. Select **Validate** to validate access to the target URI. After validation completes successfully, select **Apply** to update the configuration settings. |
| 42 | + |
| 43 | + :::image type="content" source="./media/enterprise/getting-started-enterprise/config-service-settings.png" alt-text="Application Configuration Service Settings overview" lightbox="./media/enterprise/getting-started-enterprise/config-service-settings.png"::: |
| 44 | + |
| 45 | +# [Azure CLI](#tab/azure-cli) |
| 46 | + |
| 47 | +```azurecli |
| 48 | +az spring-cloud application-configuration-service git repo add \ |
| 49 | + --name <entry-name> \ |
| 50 | + --patterns <patterns> \ |
| 51 | + --uri <git-backend-uri> \ |
| 52 | + --label <git-branch-name> |
| 53 | +``` |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +### Bind application to Application Configuration Service for Tanzu and configure patterns |
| 58 | + |
| 59 | +When you use Application Configuration Service for Tanzu with a Git backend, you must bind the app to Application Configuration Service for Tanzu. After binding the app, you'll need to configure which pattern will be used by the app. Follow these steps to bind and configure the pattern for the app. |
| 60 | + |
| 61 | +# [Azure portal](#tab/azure-portal) |
| 62 | + |
| 63 | +1. Open the **App binding** tab. |
| 64 | + |
| 65 | +1. Select **Bind app** and choose one app in the dropdown, then select **Apply** to bind. |
| 66 | + |
| 67 | + :::image type="content" source="./media/enterprise/how-to-enterprise-application-configuration-service/config-service-app-bind-dropdown.png" alt-text="How to bind Application Configuration Service screenshot"::: |
| 68 | + |
| 69 | + > [!NOTE] |
| 70 | + > When you change the bind/unbind status, you must restart or redeploy the app for the binding to take effect. |
| 71 | +
|
| 72 | +1. Select **Apps**, then select the [pattern(s)](./how-to-enterprise-application-configuration-service.md#pattern) to be used by the apps. |
| 73 | + |
| 74 | + 1. In the left navigation menu, select **Apps** to view the list of apps. |
| 75 | + |
| 76 | + 1. Select the target app to configure patterns for from the `name` column. |
| 77 | + |
| 78 | + 1. In the left navigation pane, select **Configuration**, then select **General settings**. |
| 79 | + |
| 80 | + 1. In the **Config file patterns** dropdown, choose one or more patterns from the list. |
| 81 | + |
| 82 | + :::image type="content" source="./media/enterprise/how-to-enterprise-application-configuration-service/config-service-pattern.png" alt-text="Bind Application Configuration Service in deployment screenshot"::: |
| 83 | + |
| 84 | + 1. Select **Save**. |
| 85 | + |
| 86 | +# [Azure CLI](#tab/azure-cli) |
| 87 | + |
| 88 | +```azurecli |
| 89 | +az spring-cloud application-configuration-service bind --app <app-name> |
| 90 | +az spring-cloud app deploy \ |
| 91 | + --name <app-name> \ |
| 92 | + --artifact-path <path-to-your-JAR-file> \ |
| 93 | + --config-file-pattern <config-file-pattern> |
| 94 | +``` |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +For more information, see [Use Application Configuration Service for Tanzu](./how-to-enterprise-application-configuration-service.md). |
| 99 | + |
| 100 | +## Bind an application to Tanzu Service Registry |
| 101 | + |
| 102 | +[Service Registry](https://docs.pivotal.io/spring-cloud-services/2-1/common/service-registry/index.html) is one of the proprietary VMware Tanzu components. It provides your apps with an implementation of the Service Discovery pattern, one of the key concepts of a microservice-based architecture. |
| 103 | + |
| 104 | +Use the following steps to bind an application to Tanzu Service Registry. |
| 105 | + |
| 106 | +1. Open the **App binding** tab. |
| 107 | + |
| 108 | +1. Select **Bind app** and choose one app in the dropdown, then select **Apply** to bind. |
| 109 | + |
| 110 | + :::image type="content" source="./media/enterprise/how-to-enterprise-service-registry/service-reg-app-bind-dropdown.png" alt-text="Bind Service Registry dropdown screenshot"::: |
| 111 | + |
| 112 | + > [!NOTE] |
| 113 | + > When you change the bind/unbind status, you must restart or redeploy the app to make the change take effect. |
| 114 | +
|
| 115 | +For more information, see [Use Tanzu Service Registry](./how-to-enterprise-service-registry.md). |
| 116 | + |
| 117 | +## Create and configure an application using Spring Cloud Gateway for Tanzu |
| 118 | + |
| 119 | +[Spring Cloud Gateway for Tanzu](https://docs.vmware.com/en/VMware-Spring-Cloud-Gateway-for-Kubernetes/index.html) is one of the VMware Tanzu components. It's based on the open-source Spring Cloud Gateway project. Spring Cloud Gateway for Tanzu handles cross-cutting concerns for API development teams, such as Single Sign-On (SSO), access control, rate-limiting, resiliency, security, and more. |
| 120 | + |
| 121 | +Use the following steps to create and configure an application using Spring Cloud Gateway for Tanzu. |
| 122 | + |
| 123 | +### Create an app for Spring Cloud Gateway to route traffic to |
| 124 | + |
| 125 | +1. Create an app which Spring Cloud Gateway for Tanzu will route traffic to by following the instructions in [Quickstart: Build and deploy apps to Azure Spring Cloud using the Enterprise tier](quickstart-deploy-apps-enterprise.md). |
| 126 | + |
| 127 | +1. Assign a public endpoint to the gateway to access it. |
| 128 | + |
| 129 | + # [Azure [portal](#tab/azure-portal) |
| 130 | + |
| 131 | + 1. Select the **Spring Cloud Gateway** section, then select **Overview** to view the running state and resources given to Spring Cloud Gateway and its operator. |
| 132 | + |
| 133 | + 1. Select **Yes** next to *Assign endpoint* to assign a public endpoint. You'll get a URL in a few minutes. Save the URL to use later. |
| 134 | + |
| 135 | + :::image type="content" source="./media/enterprise/getting-started-enterprise/gateway-overview.png" alt-text="Gateway overview screenshot showing assigning endpoint" lightbox="./media/enterprise/getting-started-enterprise/gateway-overview.png"::: |
| 136 | + |
| 137 | + # [Azure CLI](#tab/azure-cli) |
| 138 | + |
| 139 | + ```azurecli |
| 140 | + az spring-cloud gateway update --assign-endpoint |
| 141 | + ``` |
| 142 | + --- |
| 143 | + |
| 144 | +### Configure Spring Cloud Gateway |
| 145 | + |
| 146 | +1. Configure Spring Cloud Gateway for Tanzu properties using the CLI: |
| 147 | + |
| 148 | + ```azurecli |
| 149 | + az spring-cloud gateway update \ |
| 150 | + --api-description "<api-description>" \ |
| 151 | + --api-title "<api-title>" \ |
| 152 | + --api-version "v0.1" \ |
| 153 | + --server-url "<endpoint-in-the-previous-step>" \ |
| 154 | + --allowed-origins "*" |
| 155 | + ``` |
| 156 | + |
| 157 | + You can view the properties in the portal. |
| 158 | + |
| 159 | + :::image type="content" source="./media/enterprise/how-to-use-enterprise-spring-cloud-gateway/gateway-configuration.png" alt-text="Gateway Configuration settings screenshot" lightbox="./media/enterprise/how-to-use-enterprise-spring-cloud-gateway/gateway-configuration.png"::: |
| 160 | + |
| 161 | +1. Configure routing rules to apps. |
| 162 | + |
| 163 | + Create rules to access apps deployed in the above steps through Spring Cloud Gateway for Tanzu. |
| 164 | + |
| 165 | + Save the following content to your application's JSON file, changing the placeholders to your application's information. |
| 166 | + |
| 167 | + ```json |
| 168 | + [ |
| 169 | + { |
| 170 | + "title": "<your-title>", |
| 171 | + "description": "Route to <your-app-name>", |
| 172 | + "predicates": [ |
| 173 | + "Path=/api/<your-app-name>/owners" |
| 174 | + ], |
| 175 | + "filters": [ |
| 176 | + "StripPrefix=2" |
| 177 | + ], |
| 178 | + "tags": [ |
| 179 | + "<your-tags>" |
| 180 | + ] |
| 181 | + } |
| 182 | + ] |
| 183 | + ``` |
| 184 | + |
| 185 | +1. Apply the rule to your application using the following command: |
| 186 | + |
| 187 | + ```azurecli |
| 188 | + az spring-cloud gateway route-config create \ |
| 189 | + --name <your-app-name-rule> \ |
| 190 | + --app-name <your-app-name> \ |
| 191 | + --routes-file <your-app-name>.json |
| 192 | + ``` |
| 193 | + |
| 194 | + You can view the routes in the portal. |
| 195 | + |
| 196 | + :::image type="content" source="media/enterprise/how-to-use-enterprise-spring-cloud-gateway/gateway-route.png" alt-text="Example screenshot of gateway routing configuration" lightbox="media/enterprise/how-to-use-enterprise-spring-cloud-gateway/gateway-route.png"::: |
| 197 | + |
| 198 | +## Access application APIs through the gateway endpoint |
| 199 | + |
| 200 | +1. Access the application APIs through the gateway endpoint using the following command: |
| 201 | + |
| 202 | + ```bash |
| 203 | + curl https://<endpoint-url>/api/<your-app-name> |
| 204 | + ``` |
| 205 | + |
| 206 | +1. Query the routing rules using the following commands: |
| 207 | + |
| 208 | + ```azurecli |
| 209 | + az configure --defaults group=<resource group name> spring-cloud=<service name> |
| 210 | + az spring-cloud gateway route-config show \ |
| 211 | + --name <your-app-rule> \ |
| 212 | + --query '{appResourceId:properties.appResourceId, routes:properties.routes}' |
| 213 | + az spring-cloud gateway route-config list \ |
| 214 | + --query '[].{name:name, appResourceId:properties.appResourceId, routes:properties.routes}' |
| 215 | + ``` |
| 216 | + |
| 217 | +For more information, see [Use Spring Cloud Gateway for Tanzu](./how-to-use-enterprise-spring-cloud-gateway.md). |
| 218 | + |
| 219 | +## Next steps |
| 220 | + |
| 221 | +- [Azure Spring Cloud](index.yml) |
0 commit comments