Skip to content

Commit 580615e

Browse files
committed
Add CLI commands from PR #112119
1 parent 8e3e81b commit 580615e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

articles/spring-cloud/spring-cloud-tutorial-custom-domain.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,19 @@ To import certificate to Azure Spring Cloud:
4040

4141
![Import certificate](./media/custom-dns-tutorial/import-certificate.png)
4242

43+
Or using CLI to import certificate:
44+
```
45+
az spring-cloud certificate add --name <cert name> --vault-uri <key vault uri> --vault-certificate-name <key vault cert name>
46+
```
4347
When you have successfully imported your certificate, you'll see it on the list of **Private Key Certificates**.
4448

4549
![Private key certificate](./media/custom-dns-tutorial/key-certificates.png)
4650

51+
Or using CLI to show a list of certificates:
52+
```
53+
az spring-cloud certificate list
54+
```
55+
4756
>[!IMPORTANT]
4857
> To secure a custom domain with this certificate, you still need to bind the certificate to a specific domain. Follow the steps in this document under the heading **Add SSL Binding**.
4958
@@ -75,10 +84,20 @@ Go to application page.
7584

7685
![Add custom domain](./media/custom-dns-tutorial/add-custom-domain.png)
7786

87+
Or using CLI to add a custom domain:
88+
```
89+
az spring-cloud app custom-domain bind --domain-name <domain name> --app <app name>
90+
```
91+
7892
One app can have multiple domains, but one domain can only map to one app. When you've successfully mapped your custom domain to the app, you'll see it on the custom domain table.
7993

8094
![Custom domain table](./media/custom-dns-tutorial/custom-domain-table.png)
8195

96+
Or using CLI to show a list of custom domains:
97+
```
98+
az spring-cloud app custom-domain list --app <app name>
99+
```
100+
82101
>[!NOTE]
83102
> A **Not Secure** label for your custom domain means that it's not yet bound to an SSL certificate. Any HTTPS request from a browser to your custom domain will receive an error or warning.
84103
@@ -89,6 +108,11 @@ In the custom domain table, select **Add ssl binding** as shown in the previous
89108

90109
![Add SSL binding](./media/custom-dns-tutorial/add-ssl-binding.png)
91110

111+
Or using CLI to **Add ssl binding**:
112+
```
113+
az spring-cloud app custom-domain update --domain-name <domain name> --certificate <cert name> --app <app name>
114+
```
115+
92116
After you successfully add SSL binding, the domain state will be secure: **Healthy**.
93117

94118
![Add SSL binding](./media/custom-dns-tutorial/secured-domain-state.png)
@@ -100,6 +124,11 @@ In your app page, in the left navigation, select **Custom Domain**. Then, set **
100124

101125
![Add SSL binding](./media/custom-dns-tutorial/enforce-http.png)
102126

127+
Or using CLI to enforce HTTPS:
128+
```
129+
az spring-cloud app update -name <app-name> --https-only <true|false> -g <resource group> --service <service-name>
130+
```
131+
103132
When the operation is complete, navigate to any of the HTTPS URLs that point to your app. Note that HTTP URLs don't work.
104133

105134
## See also

0 commit comments

Comments
 (0)