|
62 | 62 | exit 1 |
63 | 63 | fi |
64 | 64 |
|
65 | | -arm_template_file="nginx-for-azure-certificate-template.json" |
66 | | - |
67 | | -#get the ARM template file |
68 | | -wget -O "$arm_template_file" https://raw.githubusercontent.com/nginxinc/nginx-for-azure-deploy-action/a69d33feaa1a8a012ec44c138ca78c6ec4db9f29/src/nginx-for-azure-certificate-template.json |
69 | | -echo "Downloaded the ARM template for synchronizing NGINX certificate." |
70 | | - |
71 | | -cat "$arm_template_file" |
72 | | -echo "" |
73 | | - |
74 | 65 | az account set -s "$subscription_id" --verbose |
75 | 66 |
|
76 | 67 | count=$(echo "$certificates" | jq '. | length') |
|
104 | 95 | do_nginx_arm_deployment=0 |
105 | 96 | fi |
106 | 97 |
|
107 | | - uuid="$(cat /proc/sys/kernel/random/uuid)" |
108 | | - template_file="template-$uuid.json" |
109 | | - template_deployment_name="${nginx_deployment_name:0:20}-$uuid" |
110 | | - |
111 | | - cp "$arm_template_file" "$template_file" |
112 | | - |
113 | 98 | echo "Synchronizing NGINX certificate" |
114 | 99 | echo "Subscription ID: $subscription_id" |
115 | 100 | echo "Resource group name: $resource_group_name" |
116 | 101 | echo "NGINXaaS for Azure deployment name: $nginx_deployment_name" |
117 | 102 | echo "NGINXaaS for Azure Location: $nginx_resource_location" |
118 | | - echo "ARM template deployment name: $template_deployment_name" |
119 | 103 | echo "" |
120 | 104 | echo "NGINXaaS for Azure cert name: $nginx_cert_name" |
121 | 105 | echo "NGINXaaS for Azure cert file location: $nginx_cert_file" |
122 | 106 | echo "NGINXaaS for Azure key file location: $nginx_key_file" |
123 | 107 | echo "" |
124 | 108 |
|
| 109 | + echo "Installing the az nginx extension if not already installed." |
| 110 | + az extension add --name nginx --allow-preview true |
| 111 | + |
125 | 112 | if [ $do_nginx_arm_deployment -eq 1 ] |
126 | 113 | then |
127 | 114 | az_cmd=( |
128 | 115 | "az" |
| 116 | + "nginx" |
129 | 117 | "deployment" |
130 | | - "group" |
| 118 | + "certificate" |
131 | 119 | "create" |
132 | | - "--name" "$template_deployment_name" |
133 | 120 | "--resource-group" "$resource_group_name" |
134 | | - "--template-file" "$template_file" |
135 | | - "--parameters" |
136 | | - "name=$nginx_cert_name" |
137 | | - "location=$nginx_resource_location" |
138 | | - "nginxDeploymentName=$nginx_deployment_name" |
139 | | - "certificateVirtualPath=$nginx_cert_file" |
140 | | - "keyVirtualPath=$nginx_key_file" |
141 | | - "keyVaultSecretID=$keyvault_secret" |
| 121 | + "--certificate-name" "$nginx_cert_name" |
| 122 | + "--deployment-name" "$nginx_deployment_name" |
| 123 | + "--certificate-path" "$nginx_cert_file" |
| 124 | + "--key-path" "$nginx_key_file" |
| 125 | + "--key-vault-secret-id" "$keyvault_secret" |
142 | 126 | "--verbose" |
143 | 127 | ) |
144 | 128 | if [[ "$debug" == true ]]; then |
|
0 commit comments