@@ -17,10 +17,6 @@ case $i in
17
17
nginx_deployment_name=" ${i#* =} "
18
18
shift
19
19
;;
20
- --nginx_resource_location=* )
21
- nginx_resource_location=" ${i#* =} "
22
- shift
23
- ;;
24
20
--certificates=* )
25
21
certificates=" ${i#* =} "
26
22
shift
51
47
echo " Please set 'nginx-deployment-name' ..."
52
48
exit 1
53
49
fi
54
- if [[ ! -v nginx_resource_location ]];
55
- then
56
- echo " Please set 'nginx-resource-location' ..."
57
- exit 1
58
- fi
59
50
if [[ ! -v certificates ]];
60
51
then
61
52
echo " Please set 'nginx-certificates' ..."
62
53
exit 1
63
54
fi
64
55
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
56
az account set -s " $subscription_id " --verbose
75
57
76
58
count=$( echo " $certificates " | jq ' . | length' )
104
86
do_nginx_arm_deployment=0
105
87
fi
106
88
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
89
echo " Synchronizing NGINX certificate"
114
90
echo " Subscription ID: $subscription_id "
115
91
echo " Resource group name: $resource_group_name "
116
92
echo " NGINXaaS for Azure deployment name: $nginx_deployment_name "
117
- echo " NGINXaaS for Azure Location: $nginx_resource_location "
118
- echo " ARM template deployment name: $template_deployment_name "
119
93
echo " "
120
94
echo " NGINXaaS for Azure cert name: $nginx_cert_name "
121
95
echo " NGINXaaS for Azure cert file location: $nginx_cert_file "
122
96
echo " NGINXaaS for Azure key file location: $nginx_key_file "
123
97
echo " "
124
98
99
+ echo " Installing the az nginx extension if not already installed."
100
+ az extension add --name nginx --allow-preview true
101
+
125
102
if [ $do_nginx_arm_deployment -eq 1 ]
126
103
then
127
104
az_cmd=(
128
105
" az"
106
+ " nginx"
129
107
" deployment"
130
- " group "
108
+ " certificate "
131
109
" create"
132
- " --name" " $template_deployment_name "
133
110
" --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 "
111
+ " --certificate-name" " $nginx_cert_name "
112
+ " --deployment-name" " $nginx_deployment_name "
113
+ " --certificate-path" " $nginx_cert_file "
114
+ " --key-path" " $nginx_key_file "
115
+ " --key-vault-secret-id" " $keyvault_secret "
142
116
" --verbose"
143
117
)
144
118
if [[ " $debug " == true ]]; then
0 commit comments