Skip to content

Commit 2c21010

Browse files
committed
NLB-2475: update NGINXaaS for Azure
1 parent 4223adc commit 2c21010

File tree

6 files changed

+46
-46
lines changed

6 files changed

+46
-46
lines changed

.github/workflows/testNginxForAzureDeploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File: .github/workflows/testNginxForAzureDeploy.yml
22

3-
name: Test Github action to update NGINX for Azure configurations
3+
name: Test Github action to update NGINX as a Service (NGINXaaS) for Azure configurations
44
on:
55
schedule:
66
- cron: "0 20 * * *"
@@ -35,7 +35,7 @@ jobs:
3535
run: |
3636
sed -i 's/000000/'"$GITHUB_RUN_NUMBER"'/g' test/configs/single/nginx.conf
3737
cat test/configs/single/nginx.conf
38-
- name: "Sync NGINX configuration to NGINX for Azure - single file"
38+
- name: "Sync NGINX configuration to NGINXaaS for Azure - single file"
3939
uses: nginxinc/[email protected]
4040
with:
4141
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
@@ -55,7 +55,7 @@ jobs:
5555
cat test/configs/multi/nginx.conf
5656
sed -i 's/000000/'"$GITHUB_RUN_ID"'/g' test/configs/multi/conf.d/proxy.conf
5757
cat test/configs/multi/conf.d/proxy.conf
58-
- name: "Sync NGINX configuration and certificate to NGINX for Azure - multi file"
58+
- name: "Sync NGINX configuration and certificate to NGINXaaS for Azure - multi file"
5959
uses: nginxinc/[email protected]
6060
with:
6161
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# NGINX for Azure Deployment Action
1+
# NGINXaaS for Azure Deployment Action
22

3-
This action supports managing the configuration of an [NGINX for Azure](https://docs.nginx.com/nginx-for-azure/quickstart/overview/) deployment in a GitHub repository. It enables continuous deployment through GitHub workflows to automatically update the NGINX for Azure deployment when changes are made to the NGINX configuration files stored in the respository. Additionally, one can update NGINX certificates that are already present in Azure key vault.
3+
This action supports managing the configuration of an [NGINXaaS for Azure](https://docs.nginx.com/nginxaas/azure/quickstart/overview/) deployment in a GitHub repository. It enables continuous deployment through GitHub workflows to automatically update the NGINXaaS for Azure deployment when changes are made to the NGINX configuration files stored in the repository. Additionally, one can update NGINX certificates that are already present in Azure key vault.
44

55
## Connecting to Azure
66

7-
This action leverages the [Azure Login](https://github.com/marketplace/actions/azure-login) action for authenticating with Azure and performing update to an NGINX for Azure deployment. Two different ways of authentication are supported:
7+
This action leverages the [Azure Login](https://github.com/marketplace/actions/azure-login) action for authenticating with Azure and performing update to an NGINXaaS for Azure deployment. Two different ways of authentication are supported:
88
- [Service principal with secrets](https://docs.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Cwindows#use-the-azure-login-action-with-a-service-principal-secret)
99
- [OpenID Connect](https://docs.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Cwindows#use-the-azure-login-action-with-openid-connect) (OIDC) with an Azure service principal using a Federated Identity Credential
1010

@@ -13,7 +13,7 @@ This action leverages the [Azure Login](https://github.com/marketplace/actions/a
1313
```yaml
1414
# File: .github/workflows/nginxForAzureDeploy.yml
1515

16-
name: Sync the NGINX configuration from the GitHub repository to an NGINX for Azure deployment
16+
name: Sync the NGINX configuration from the GitHub repository to an NGINXaaS for Azure deployment
1717
on:
1818
push:
1919
branches:
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
creds: ${{ secrets.AZURE_CREDENTIALS }}
3535

36-
- name: 'Sync the NGINX configuration from the GitHub repository to the NGINX for Azure deployment'
36+
- name: 'Sync the NGINX configuration from the GitHub repository to the NGINXaaS for Azure deployment'
3737
uses: nginxinc/[email protected]
3838
with:
3939
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
@@ -49,7 +49,7 @@ jobs:
4949
```yaml
5050
# File: .github/workflows/nginxForAzureDeploy.yml
5151

52-
name: Sync the NGINX configuration from the GitHub repository to an NGINX for Azure deployment
52+
name: Sync the NGINX configuration from the GitHub repository to an NGINXaaS for Azure deployment
5353
on:
5454
push:
5555
branches:
@@ -75,7 +75,7 @@ jobs:
7575
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
7676
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
7777

78-
- name: 'Sync the NGINX configuration from the GitHub repository to the NGINX for Azure deployment'
78+
- name: 'Sync the NGINX configuration from the GitHub repository to the NGINXaaS for Azure deployment'
7979
uses: nginxinc/[email protected]
8080
with:
8181
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
@@ -88,19 +88,19 @@ jobs:
8888
8989
## Handling NGINX configuration file paths
9090
91-
To facilitate the migration of the existing NGINX configuration, NGINX for Azure supports multiple-files configuration with each file uniquely identified by a file path, just like how NGINX configuration files are created and used in a self-hosting machine. An NGINX configuration file can include another file using the [include directive](https://docs.nginx.com/nginx/admin-guide/basic-functionality/managing-configuration-files/). The file path used in an `include` directive can either be an absolute path or a relative path to the [prefix path](https://www.nginx.com/resources/wiki/start/topics/tutorials/installoptions/).
91+
To facilitate the migration of the existing NGINX configuration, NGINXaaS for Azure supports multiple-files configuration with each file uniquely identified by a file path, just like how NGINX configuration files are created and used in a self-hosting machine. An NGINX configuration file can include another file using the [include directive](https://docs.nginx.com/nginx/admin-guide/basic-functionality/managing-configuration-files/). The file path used in an `include` directive can either be an absolute path or a relative path to the [prefix path](https://www.nginx.com/resources/wiki/start/topics/tutorials/installoptions/).
9292

93-
The following example shows two NGINX configuration files inside the `/etc/nginx` directory on disk are copied and stored in a GitHub respository under its `config` directory.
93+
The following example shows two NGINX configuration files inside the `/etc/nginx` directory on disk are copied and stored in a GitHub repository under its `config` directory.
9494

95-
| File path on disk | File path in the respository |
96-
|--------------------------------------|-----------------------------------|
95+
| File path on disk | File path in the repository |
96+
| ------------------------------------ | --------------------------------- |
9797
| /etc/nginx/nginx.conf | /config/nginx.conf |
9898
| /etc/nginx/sites-enabled/mysite.conf | /config/sites-enabled/mysite.conf |
9999

100100
To use this action to sync the configuration files from this example, the directory path relative to the GitHub repository root `config/` is set to the action's input `nginx-config-directory-path` for the action to find and package the configuration files. The root file `nginx.conf` is set to the input `nginx-root-config-file`.
101101

102102
```yaml
103-
- name: 'Sync the NGINX configuration from the GitHub repository to the NGINX for Azure deployment'
103+
- name: 'Sync the NGINX configuration from the GitHub repository to the NGINXaaS for Azure deployment'
104104
uses: nginxinc/[email protected]
105105
with:
106106
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
@@ -110,12 +110,12 @@ To use this action to sync the configuration files from this example, the direct
110110
nginx-root-config-file: nginx.conf
111111
```
112112

113-
By default, the action uses a file's relative path to `nginx-config-directory-path` in the respository as the file path in the NGINX for Azure deployment.
113+
By default, the action uses a file's relative path to `nginx-config-directory-path` in the repository as the file path in the NGINXaaS for Azure deployment.
114114

115-
| File path on disk | File path in the respository | File path in the NGINX for Azure deployment |
116-
|--------------------------------------|-----------------------------------|---------------------------------------------|
117-
| /etc/nginx/nginx.conf | /config/nginx.conf | nginx.conf |
118-
| /etc/nginx/sites-enabled/mysite.conf | /config/sites-enabled/mysite.conf | sites-enabled/mysite.conf |
115+
| File path on disk | File path in the repository | File path in the NGINXaaS for Azure deployment |
116+
| ------------------------------------ | --------------------------------- | ---------------------------------------------- |
117+
| /etc/nginx/nginx.conf | /config/nginx.conf | nginx.conf |
118+
| /etc/nginx/sites-enabled/mysite.conf | /config/sites-enabled/mysite.conf | sites-enabled/mysite.conf |
119119

120120
The default file path handling works for the case of using relative paths in `include` directives, for example, if the root `nginx.conf` references `mysite.conf` using:
121121

@@ -129,10 +129,10 @@ For the case of using absolute paths in `include` directives, for example, if th
129129
include /etc/nginx/sites-enabled/mysite.conf;
130130
```
131131

132-
The action supports an optional input `transformed-nginx-config-directory-path` to transform the absolute path of the configuration directory in the NGINX for Azure deployment. The absolute configuration directory path on disk `/etc/nginx/` can be set to `transformed-nginx-config-directory-path` as follows to ensure the configuration files using absolute paths in `include` directives work as expected in the NGINX for Azure deployment.
132+
The action supports an optional input `transformed-nginx-config-directory-path` to transform the absolute path of the configuration directory in the NGINXaaS for Azure deployment. The absolute configuration directory path on disk `/etc/nginx/` can be set to `transformed-nginx-config-directory-path` as follows to ensure the configuration files using absolute paths in `include` directives work as expected in the NGINXaaS for Azure deployment.
133133

134134
```yaml
135-
- name: 'Sync the NGINX configuration from the Git repository to the NGINX for Azure deployment'
135+
- name: 'Sync the NGINX configuration from the Git repository to the NGINXaaS for Azure deployment'
136136
uses: nginxinc/[email protected]
137137
with:
138138
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
@@ -142,12 +142,12 @@ The action supports an optional input `transformed-nginx-config-directory-path`
142142
nginx-root-config-file: nginx.conf
143143
transformed-nginx-config-directory-path: /etc/nginx/
144144
```
145-
The transformed paths of the two configuration files in the NGINX for Azure deployment are summarized in the following table
145+
The transformed paths of the two configuration files in the NGINXaaS for Azure deployment are summarized in the following table
146146

147-
| File path on disk | File path in the respository | File path in the NGINX for Azure deployment |
148-
|--------------------------------------|-----------------------------------|---------------------------------------------|
149-
| /etc/nginx/nginx.conf | /config/nginx.conf | /etc/nginx/nginx.conf |
150-
| /etc/nginx/sites-enabled/mysite.conf | /config/sites-enabled/mysite.conf | /etc/nginx/sites-enabled/mysite.conf |
147+
| File path on disk | File path in the repository | File path in the NGINXaaS for Azure deployment |
148+
| ------------------------------------ | --------------------------------- | ---------------------------------------------- |
149+
| /etc/nginx/nginx.conf | /config/nginx.conf | /etc/nginx/nginx.conf |
150+
| /etc/nginx/sites-enabled/mysite.conf | /config/sites-enabled/mysite.conf | /etc/nginx/sites-enabled/mysite.conf |
151151

152152
## Handling NGINX certificates
153153

@@ -164,7 +164,7 @@ Since certificates are secrets, it is assumed they are stored in Azure key vault
164164
See the example below
165165

166166
```yaml
167-
- name: "Sync NGINX certificates to NGINX for Azure"
167+
- name: "Sync NGINX certificates to NGINXaaS for Azure"
168168
uses: nginxinc/[email protected]
169169
with:
170170
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
@@ -177,7 +177,7 @@ See the example below
177177
## Handling NGINX configuration and certificates
178178

179179
```yaml
180-
- name: "Sync NGINX configuration- multi file and certificate to NGINX for Azure"
180+
- name: "Sync NGINX configuration- multi file and certificate to NGINXaaS for Azure"
181181
uses: nginxinc/[email protected]
182182
with:
183183
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

action.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: "NGINX For Azure Deployment Sync"
2-
description: "The action synchronizes NGINX configuration from a Git repository and/or certificates already on Azure keyvault to an NGINX for Azure deployment"
1+
name: "NGINXaaS for Azure Deployment Sync"
2+
description: "The action synchronizes NGINX configuration from a Git repository and/or certificates already on Azure keyvault to an NGINXaaS for Azure deployment"
33
inputs:
44
subscription-id:
5-
description: "The Azure subscription ID of the NGINX for Azure deployment."
5+
description: "The Azure subscription ID of the NGINXaaS for Azure deployment."
66
required: true
77
resource-group-name:
8-
description: "The resource group of the NGINX for Azure deployment."
8+
description: "The resource group of the NGINXaaS for Azure deployment."
99
required: true
1010
nginx-deployment-name:
11-
description: "The name of the NGINX for Azure deployment."
11+
description: "The name of the NGINXaaS for Azure deployment."
1212
required: true
1313
nginx-deployment-location:
1414
description: "The location where the NGINX deployment is located. Example westcentralus"
@@ -23,9 +23,9 @@ inputs:
2323
default: "nginx.conf"
2424
transformed-nginx-config-directory-path:
2525
description: >
26-
'The transformed absolute path of the NGINX configuration directory in NGINX for Azure deployment, example: "/etc/nginx/".
26+
'The transformed absolute path of the NGINX configuration directory in NGINXaaS for Azure deployment, example: "/etc/nginx/".
2727
If the "include" directive in the NGINX configuration files uses absolute paths, the path transformation
28-
can be used to overwrite the file paths when the action synchronizes the files to the NGINX for Azure deployment.'
28+
can be used to overwrite the file paths when the action synchronizes the files to the NGINXaaS for Azure deployment.'
2929
required: false
3030
default: ""
3131
nginx-certificates:
@@ -34,11 +34,11 @@ inputs:
3434
runs:
3535
using: "composite"
3636
steps:
37-
- name: "Synchronize NGINX certificate(s) from the Git repository to an NGINX for Azure deployment"
37+
- name: "Synchronize NGINX certificate(s) from the Git repository to an NGINXaaS for Azure deployment"
3838
run: ${{github.action_path}}/src/deploy-certificate.sh --subscription_id=${{ inputs.subscription-id }} --resource_group_name=${{ inputs.resource-group-name }} --nginx_deployment_name=${{ inputs.nginx-deployment-name }} --nginx_resource_location=${{ inputs.nginx-deployment-location }} --certificates=${{ toJSON(inputs.nginx-certificates) }}
3939
if: ${{ inputs.nginx-deployment-location != '' && inputs.nginx-certificates != '' }}
4040
shell: bash
41-
- name: "Synchronize NGINX configuration from the Git repository to an NGINX for Azure deployment"
41+
- name: "Synchronize NGINX configuration from the Git repository to an NGINXaaS for Azure deployment"
4242
run: ${{github.action_path}}/src/deploy-config.sh --subscription_id=${{ inputs.subscription-id }} --resource_group_name=${{ inputs.resource-group-name }} --nginx_deployment_name=${{ inputs.nginx-deployment-name }} --config_dir_path=${{ inputs.nginx-config-directory-path }} --root_config_file=${{ inputs.nginx-root-config-file }} --transformed_config_dir_path=${{ inputs.transformed-nginx-config-directory-path }}
4343
if: ${{ inputs.nginx-config-directory-path != '' }}
4444
shell: bash

src/deploy-certificate.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ do
109109
echo "Synchronizing NGINX certificate"
110110
echo "Subscription ID: $subscription_id"
111111
echo "Resource group name: $resource_group_name"
112-
echo "NGINX for Azure deployment name: $nginx_deployment_name"
113-
echo "NGINX for Azure Location: $nginx_resource_location"
112+
echo "NGINXaaS for Azure deployment name: $nginx_deployment_name"
113+
echo "NGINXaaS for Azure Location: $nginx_resource_location"
114114
echo "ARM template deployment name: $template_deployment_name"
115115
echo ""
116-
echo "NGINX for Azure cert name: $nginx_cert_name"
117-
echo "NGINX for Azure cert file location: $nginx_cert_file"
118-
echo "NGINX for Azure key file location: $nginx_key_file"
116+
echo "NGINXaaS for Azure cert name: $nginx_cert_name"
117+
echo "NGINXaaS for Azure cert file location: $nginx_cert_file"
118+
echo "NGINXaaS for Azure key file location: $nginx_key_file"
119119
echo ""
120120

121121
if [ $do_nginx_arm_deployment -eq 1 ]

src/deploy-config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ echo "The base64 encoded NGINX configuration tarball"
133133
echo "$encoded_config_tarball"
134134
echo ""
135135

136-
# Synchronize the NGINX configuration tarball to the NGINX for Azure deployment.
136+
# Synchronize the NGINX configuration tarball to the NGINXaaS for Azure deployment.
137137

138138
uuid="$(cat /proc/sys/kernel/random/uuid)"
139139
template_file="template-$uuid.json"
@@ -147,7 +147,7 @@ echo ""
147147
echo "Synchronizing NGINX configuration"
148148
echo "Subscription ID: $subscription_id"
149149
echo "Resource group name: $resource_group_name"
150-
echo "NGINX for Azure deployment name: $nginx_deployment_name"
150+
echo "NGINXaaS for Azure deployment name: $nginx_deployment_name"
151151
echo "ARM template deployment name: $template_deployment_name"
152152
echo ""
153153

src/nginx-for-azure-configuration-template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"nginxDeploymentName": {
66
"type": "string",
77
"metadata": {
8-
"description": "The name of the NGINX for Azure deployment to synchronize the configuration."
8+
"description": "The name of the NGINXaaS for Azure deployment to synchronize the configuration."
99
}
1010
},
1111
"rootFile": {

0 commit comments

Comments
 (0)