@@ -132,7 +132,7 @@ echo "Successfully created the tarball from the NGINX configuration directory."
132
132
echo " Listing the NGINX configuration file paths in the tarball."
133
133
tar -tf " $config_tarball "
134
134
135
- encoded_config_tarball=$( base64 " $config_tarball " )
135
+ encoded_config_tarball=$( base64 " $config_tarball " -w 0 )
136
136
137
137
if [[ " $debug " == true ]]; then
138
138
echo " The base64 encoded NGINX configuration tarball"
@@ -142,36 +142,28 @@ echo ""
142
142
143
143
# Synchronize the NGINX configuration tarball to the NGINXaaS for Azure deployment.
144
144
145
- uuid=" $( cat /proc/sys/kernel/random/uuid) "
146
- template_file=" template-$uuid .json"
147
- template_deployment_name=" ${nginx_deployment_name: 0: 20} -$uuid "
148
-
149
- wget -O " $template_file " https://raw.githubusercontent.com/nginxinc/nginx-for-azure-deploy-action/487d1394d6115d4f42ece6200cbd20859595557d/src/nginx-for-azure-configuration-template.json
150
- echo " Downloaded the ARM template for synchronizing NGINX configuration."
151
- cat " $template_file "
152
- echo " "
153
-
154
145
echo " Synchronizing NGINX configuration"
155
146
echo " Subscription ID: $subscription_id "
156
147
echo " Resource group name: $resource_group_name "
157
148
echo " NGINXaaS for Azure deployment name: $nginx_deployment_name "
158
- echo " ARM template deployment name: $template_deployment_name "
159
149
echo " "
160
150
161
151
az account set -s " $subscription_id " --verbose
162
152
153
+ echo " Installing the az nginx extension if not already installed."
154
+ az extension add --name nginx --allow-preview true
155
+
163
156
az_cmd=(
164
157
" az"
158
+ " nginx"
165
159
" deployment"
166
- " group"
167
- " create"
168
- " --name" " $template_deployment_name "
160
+ " configuration"
161
+ " update"
162
+ " --name" " default"
163
+ " --deployment-name" " $nginx_deployment_name "
169
164
" --resource-group" " $resource_group_name "
170
- " --template-file" " $template_file "
171
- " --parameters"
172
- " nginxDeploymentName=$nginx_deployment_name "
173
- " rootFile=$transformed_root_config_file_path "
174
- " tarball=$encoded_config_tarball "
165
+ " --root-file" " $transformed_root_config_file_path "
166
+ " --package" " data=$encoded_config_tarball "
175
167
" --verbose"
176
168
)
177
169
0 commit comments