Skip to content

Commit a08298e

Browse files
authored
Merge pull request #92907 from v-vasuke/asc-config
config server updates
2 parents ba54bc9 + 82da551 commit a08298e

File tree

5 files changed

+49
-12
lines changed

5 files changed

+49
-12
lines changed
20.7 KB
Loading
42.5 KB
Loading
90.8 KB
Loading
24.3 KB
Loading

articles/spring-cloud/spring-cloud-tutorial-config-server.md

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.topic: tutorial
77
ms.reviewer: jeconnoc
88
ms.author: v-vasuke
99
author: v-vasuke
10-
ms.date: 08/08/2019
10+
ms.date: 10/18/2019
1111
---
1212

1313
# Tutorial: Set up a Spring Cloud Config Server for your service
@@ -47,7 +47,7 @@ When using a public repository, your configurable properties will be more limite
4747
All configurable properties used to set up the public `Git` repository are listed below.
4848

4949
> [!NOTE]
50-
> Using a hyphen ("-") to separate words is the only naming convention that is currently supported. For example, use `default-label` not `defaultLabel`.
50+
> Using a hyphen ("-") to separate words is the only naming convention that is currently supported. For example, you can use `default-label`, but not `defaultLabel`.
5151
5252
| Property | Required | Feature |
5353
| :-------------- | -------- | ------------------------------------------------------------ |
@@ -62,7 +62,7 @@ All configurable properties used to set up the public `Git` repository are liste
6262
All configurable properties used to set up private `Git` repository with `Ssh` are listed below.
6363

6464
> [!NOTE]
65-
> Using a hyphen ("-") to separate words is the only naming convention that is currently supported. For example, use `default-label` not `defaultLabel`.
65+
> Using a hyphen ("-") to separate words is the only naming convention that is currently supported. For example, you can use `default-label`, but not `defaultLabel`.
6666
6767
| Property | Required | Feature |
6868
| :------------------------- | -------- | ------------------------------------------------------------ |
@@ -116,10 +116,6 @@ All configurable properties used to set up Git repositories with pattern are lis
116116
| `repos."host-key-algorithm"` | `no` | The host key algorithm, should be `ssh-dss`, `ssh-rsa`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, or `ecdsa-sha2-nistp521`. Only __required__ if `host-key` exists. |
117117
| `repos."strict-host-key-checking"` | `no` | Indicates whether the config server will fail to start when leveraging the private `host-key`. Should be `true` (default value) or `false`. |
118118

119-
### Import `application.yml` file from Spring Cloud Config
120-
121-
You can import some default config server settings directly from the [Spring Cloud Config](https://spring.io/projects/spring-cloud-config) website. You can do this directly from the Azure portal, so you don't need to take any steps now to prepare your config server files or repository.
122-
123119
## Attaching your Config Server repository to Azure Spring Cloud
124120

125121
Now that you have your configuration files saved in a repository, you need to connect Azure Spring Cloud to it.
@@ -130,20 +126,61 @@ Now that you have your configuration files saved in a repository, you need to co
130126

131127
1. Go to the **Config Server** tab under the **Settings** heading in the menu on the left side.
132128

133-
### Public repository
129+
![window screenshot](media/spring-cloud-tutorial-config-server/portal-config-server.png)
130+
131+
### Input repository information directly to the Azure portal
132+
133+
#### Default repository
134+
135+
* Public repository: In the **Default repository** section, paste the repository URI in the **Uri** section and ensure the **Authentication** setting is **Public**. Then click **Apply** to finish.
136+
137+
* Private repository: Azure Spring Cloud supports basic password/token based authentication and SSH.
138+
139+
* Basic Authentication: In the **Default repository** section, paste the repository's URI in the **Uri** section, then click the **Authentication**. Select **Basic** as your **Authentication type** and enter your username and password/token to grant access to Azure Spring Cloud. Click **OK** and **Apply** to finish setting up your Config Server.
140+
141+
![window screenshot](media/spring-cloud-tutorial-config-server/basic-auth.png)
142+
143+
> [!CAUTION]
144+
> Some Git repository servers like GitHub use a `personal-token` or a `access-token` like a password for **Basic Authentication**. You can use that kind of token as password in Azure Spring Cloud, as it will never expire. But for other Git repository servers such as BitBucket and Azure DevOps, the `access-token` will expire in one or two hours. This means that option not viable when using those repository servers with Azure Spring Cloud.]
145+
146+
* SSH: In the **Default repository** section, paste the repository's URI in the **Uri** section, then click the **Authentication**. Select **SSH** as your **Authentication type** and enter your **Private key**. You can optionally specify your **Host key** and **Host key algorithm**. Be sure to include your public key in your config server repository. Click **OK** and **Apply** to finish setting up your Config Server.
134147

135-
If your repository is public, simply click the **Public** button and paste the URL.
148+
![window screenshot](media/spring-cloud-tutorial-config-server/ssh-auth.png)
136149

137-
### Private repository
150+
#### Pattern repository
138151

139-
Azure Spring Cloud supports SSH authentication. Follow the instructions on the Azure portal for adding the public key to your repository. Then, be sure to include your private key in the configuration file.
152+
If you want to use an optional **Pattern repository** to configure your service, specify the **URI** and **Authentication** the same way as the **Default repository**. Be sure to include a **Name** for your pattern, then click **Apply** to attach it to your instance.
153+
154+
### Enter repository information into a YAML file
155+
156+
If you have written a YAML file with your repository settings, you can import your YAML file directly from your local machine to Azure Spring Cloud. A simple YAML file for a private repository with basic authentication would look like this:
157+
158+
```yml
159+
spring:
160+
cloud:
161+
config:
162+
server:
163+
git:
164+
uri: https://github.com/azure-spring-cloud-samples/config-server-repository.git
165+
username: <username>
166+
password: <password/token>
167+
168+
```
169+
170+
Click the **Import settings** button, then select the `.yml` file from your project directory. Click **Import**, then an `async` operation from your **Notifications** will pop up. After 1-2 minutes, it should report success.
171+
172+
![window screenshot](media/spring-cloud-tutorial-config-server/local-yml-success.png)
173+
174+
175+
You should see the information from your YAML file displayed in the Azure portal. Click **Apply** to finish.
140176

141-
Click **Apply** to finish setting up your Config Server.
142177

143178
## Delete your app configuration
144179

145180
Once you've saved a configuration file, the **Delete app configuration** button will appear in the **Configuration** tab. This will erase your existing settings completely. You should do this if you wish to connect your config server to another source, such as moving from GitHub to Azure DevOps.
146181

182+
183+
147184
## Next steps
148185

149186
In this tutorial, you learned how to enable and configure the Config Server. To learn more about managing your application, continue to the tutorial for manually scaling your app.

0 commit comments

Comments
 (0)