You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: infra/scripts/process_sample_data.sh
+58-8Lines changed: 58 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ aif_resource_id="${8}"
14
14
original_storage_public_access=""
15
15
original_storage_default_action=""
16
16
original_search_public_access=""
17
+
original_search_bypass=""
17
18
original_foundry_public_access=""
18
19
aif_resource_group=""
19
20
aif_account_resource_id=""
@@ -76,6 +77,14 @@ enable_public_access() {
76
77
--resource-group "$resourceGroupName" \
77
78
--query "publicNetworkAccess" \
78
79
-o tsv)
80
+
81
+
# Get current bypass setting for trusted services
82
+
original_search_bypass=$(az search service show \
83
+
--name "$aiSearchName" \
84
+
--resource-group "$resourceGroupName" \
85
+
--query "networkRuleSet.bypass" \
86
+
-o tsv)
87
+
79
88
if [ "$original_search_public_access"!="Enabled" ];then
80
89
az search service update \
81
90
--name "$aiSearchName" \
@@ -92,14 +101,31 @@ enable_public_access() {
92
101
echo"✓ AI Search Service public access already enabled"
93
102
fi
94
103
104
+
# Enable trusted services bypass
105
+
if [ "$original_search_bypass"!="AzureServices" ];then
106
+
echo"Enabling trusted services bypass for AI Search Service"
107
+
MSYS_NO_PATHCONV=1 az resource update \
108
+
--ids "/subscriptions/$(az account show --query id -o tsv)/resourceGroups/$resourceGroupName/providers/Microsoft.Search/searchServices/$aiSearchName" \
echo"Current AI Foundry public access: $original_foundry_public_access"
139
+
echo"Enabling public access for AI Foundry resource: $aif_resource_name (Resource Group: $aif_resource_group)"
113
140
if MSYS_NO_PATHCONV=1 az resource update \
114
141
--ids "$aif_account_resource_id" \
115
142
--api-version 2024-10-01 \
@@ -197,6 +224,29 @@ restore_network_access() {
197
224
echo"AI Search Service access unchanged (already at desired state)"
198
225
fi
199
226
227
+
# Restore AI Search Service trusted services bypass
228
+
if [ -n"$original_search_bypass" ] && [ "$original_search_bypass"!="AzureServices" ];then
229
+
echo"Restoring AI Search Service trusted services bypass to: $original_search_bypass"
230
+
# Handle null/empty values
231
+
if [ "$original_search_bypass"="null" ] || [ -z"$original_search_bypass" ];then
232
+
restore_bypass_value="None"
233
+
else
234
+
restore_bypass_value="$original_search_bypass"
235
+
fi
236
+
MSYS_NO_PATHCONV=1 az resource update \
237
+
--ids "/subscriptions/$(az account show --query id -o tsv)/resourceGroups/$resourceGroupName/providers/Microsoft.Search/searchServices/$aiSearchName" \
0 commit comments