Skip to content

Commit b8d2418

Browse files
committed
Changes related to outbound Access for WLS on AKS Offer
1 parent 1a9cce7 commit b8d2418

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

weblogic-azure-aks/src/main/arm/scripts/createVMAndBuildImage.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,20 @@ function cleanup_vm() {
5353
| where resourceGroup =~ '${CURRENT_RESOURCEGROUP_NAME}' \
5454
| project nsgId = id" --query "data[0].nsgId" -o tsv)
5555

56+
#query public ip id
57+
publicIpId=$(az graph query -q "Resources \
58+
| where type =~ 'Microsoft.Network/publicIPAddresses' \
59+
| where name =~ '${vmName}PublicIP' \
60+
| where resourceGroup =~ '${CURRENT_RESOURCEGROUP_NAME}' \
61+
| project publicIpId = id" --query "data[0].publicIpId" -o tsv)
62+
5663
# Delete VM NIC IP VNET NSG resoruces
5764
echo "deleting vm ${vmId}"
5865
az vm delete --ids $vmId --yes
5966
echo "deleting nic ${nicId}"
6067
az network nic delete --ids ${nicId}
68+
echo "deleting public ip ${publicIpId}"
69+
az network public-ip delete --ids $publicIpId
6170
echo "deleting disk ${osDiskId}"
6271
az disk delete --yes --ids ${osDiskId}
6372
echo "deleting vnet ${vnetId}"
@@ -119,6 +128,8 @@ function build_docker_image() {
119128
export TAG_VM=$(echo "${TAG_VM}" \
120129
| jq -r 'to_entries | map("\"" + .key + "\"=" + (if .value|type == "string" then "\"\(.value)\"" else "\(.value)" end)) | join(" ")')
121130

131+
publicIPName="${vmName}PublicIP"
132+
122133
# MICROSOFT_INTERNAL
123134
# Specify tag 'SkipASMAzSecPack' to skip policy 'linuxazuresecuritypackautodeployiaas_1.6'
124135
# Specify tag 'SkipNRMS*' to skip Microsoft internal NRMS policy, which causes vm-redeployed issue
@@ -132,7 +143,7 @@ function build_docker_image() {
132143
--enable-agent true \
133144
--vnet-name ${vmName}VNET \
134145
--enable-auto-update false \
135-
--public-ip-address "" \
146+
--public-ip-address ${publicIPName} \
136147
--size ${vmSize} \
137148
--tags ${TAG_VM} SkipASMAzSecPack=true SkipNRMSCorp=true SkipNRMSDatabricks=true SkipNRMSDB=true SkipNRMSHigh=true SkipNRMSMedium=true SkipNRMSRDPSSH=true SkipNRMSSAW=true SkipNRMSMgmt=true --verbose
138149

0 commit comments

Comments
 (0)