@@ -211,24 +211,31 @@ public async Task ExtensionWebHook_Succeeds()
211211
212212 [ Theory ]
213213 [ Trait ( TestTraits . Group , TestTraits . AdminIsolationTests ) ]
214- [ InlineData ( "admin/host/status" , true , true , false , false , true , HttpStatusCode . Forbidden ) ]
215- [ InlineData ( "admin/host/status" , true , true , true , false , false , HttpStatusCode . Unauthorized ) ]
216- [ InlineData ( "admin/host/status" , true , true , true , true , true , HttpStatusCode . OK ) ]
217- [ InlineData ( "admin/host/status" , true , false , false , false , true , HttpStatusCode . OK ) ]
218- [ InlineData ( "admin/host/status" , true , false , false , true , true , HttpStatusCode . OK ) ]
219- [ InlineData ( "admin/host/status" , true , true , true , false , true , HttpStatusCode . OK ) ]
220- [ InlineData ( "admin/host/status" , false , true , false , true , true , HttpStatusCode . Forbidden ) ]
221- [ InlineData ( "admin/host/extensionBundle/v1/templates" , true , true , false , true , false , HttpStatusCode . Unauthorized ) ]
222- [ InlineData ( "admin/host/extensionBundle/v1/templates" , true , true , true , false , true , HttpStatusCode . NotFound ) ]
223- [ InlineData ( "admin/host/extensionBundle/v1/templates" , true , false , false , false , true , HttpStatusCode . NotFound ) ]
224- [ InlineData ( "admin/host/extensionBundle/v1/templates" , true , true , false , true , true , HttpStatusCode . NotFound ) ]
225- [ InlineData ( "admin/vfs/host.json" , true , true , true , false , true , HttpStatusCode . OK ) ]
226- [ InlineData ( "admin/vfs/host.json" , true , true , false , false , true , HttpStatusCode . Unauthorized ) ]
227- [ InlineData ( "admin/vfs/host.json" , true , true , true , false , false , HttpStatusCode . Unauthorized ) ]
228- public async Task AdminIsolation_ReturnsExpectedStatus ( string uri , bool isAppService , bool enableIsolation , bool isPlatformInternal , bool bypassFE , bool addAuthKey , HttpStatusCode expectedStatus )
214+ [ InlineData ( "admin/host/status" , ScriptConstants . DynamicSku , "1" , true , false , false , true , HttpStatusCode . Forbidden ) ]
215+ [ InlineData ( "admin/host/status" , ScriptConstants . DynamicSku , "1" , true , true , false , false , HttpStatusCode . Unauthorized ) ]
216+ [ InlineData ( "admin/host/status" , ScriptConstants . DynamicSku , "1" , true , true , true , true , HttpStatusCode . OK ) ]
217+ [ InlineData ( "admin/host/status" , ScriptConstants . DynamicSku , "1" , false , false , false , true , HttpStatusCode . OK ) ]
218+ [ InlineData ( "admin/host/status" , ScriptConstants . DynamicSku , "1" , false , false , true , true , HttpStatusCode . OK ) ]
219+ [ InlineData ( "admin/host/status" , ScriptConstants . DynamicSku , "1" , true , true , false , true , HttpStatusCode . OK ) ]
220+ [ InlineData ( "admin/host/status" , ScriptConstants . DynamicSku , null , true , false , true , true , HttpStatusCode . Forbidden ) ]
221+ [ InlineData ( "admin/host/extensionBundle/v1/templates" , ScriptConstants . DynamicSku , "1" , true , false , true , false , HttpStatusCode . Unauthorized ) ]
222+ [ InlineData ( "admin/host/extensionBundle/v1/templates" , ScriptConstants . DynamicSku , "1" , true , true , false , true , HttpStatusCode . NotFound ) ]
223+ [ InlineData ( "admin/host/extensionBundle/v1/templates" , ScriptConstants . DynamicSku , "1" , false , false , false , true , HttpStatusCode . NotFound ) ]
224+ [ InlineData ( "admin/host/extensionBundle/v1/templates" , ScriptConstants . DynamicSku , "1" , true , false , true , true , HttpStatusCode . NotFound ) ]
225+ [ InlineData ( "admin/vfs/host.json" , ScriptConstants . DynamicSku , "1" , true , true , false , true , HttpStatusCode . OK ) ]
226+ [ InlineData ( "admin/vfs/host.json" , ScriptConstants . DynamicSku , "1" , true , false , false , true , HttpStatusCode . Unauthorized ) ]
227+ [ InlineData ( "admin/vfs/host.json" , ScriptConstants . DynamicSku , "1" , true , true , false , false , HttpStatusCode . Unauthorized ) ]
228+ [ InlineData ( "admin/host/status" , ScriptConstants . FlexConsumptionSku , null , true , true , false , true , HttpStatusCode . OK ) ]
229+ [ InlineData ( "admin/host/status" , ScriptConstants . FlexConsumptionSku , null , true , false , true , true , HttpStatusCode . OK ) ]
230+ [ InlineData ( "admin/host/status" , ScriptConstants . FlexConsumptionSku , null , true , false , false , true , HttpStatusCode . Forbidden ) ]
231+ [ InlineData ( "admin/host/status" , ScriptConstants . FlexConsumptionSku , null , true , false , true , false , HttpStatusCode . Unauthorized ) ]
232+ public async Task AdminIsolation_ReturnsExpectedStatus ( string uri , string sku , string websiteInstanceId , bool enableIsolation , bool isPlatformInternal , bool bypassFE , bool addAuthKey , HttpStatusCode expectedStatus )
229233 {
230234 var environment = this . _fixture . Host . WebHostServices . GetService < IEnvironment > ( ) ;
231- string websiteInstanceId = environment . GetEnvironmentVariable ( EnvironmentSettingNames . AzureWebsiteInstanceId ) ;
235+ string originalWebsiteInstanceId = environment . GetEnvironmentVariable ( EnvironmentSettingNames . AzureWebsiteInstanceId ) ;
236+
237+ environment . SetEnvironmentVariable ( EnvironmentSettingNames . AzureWebsiteSku , sku ) ;
238+ environment . SetEnvironmentVariable ( EnvironmentSettingNames . AzureWebsiteInstanceId , websiteInstanceId ) ;
232239
233240 try
234241 {
@@ -238,16 +245,6 @@ public async Task AdminIsolation_ReturnsExpectedStatus(string uri, bool isAppSer
238245 Assert . True ( environment . IsAdminIsolationEnabled ( ) ) ;
239246 }
240247
241- if ( ! isAppService )
242- {
243- environment . SetEnvironmentVariable ( EnvironmentSettingNames . AzureWebsiteInstanceId , null ) ;
244- Assert . False ( environment . IsAppService ( ) ) ;
245- }
246- else
247- {
248- Assert . True ( environment . IsAppService ( ) ) ;
249- }
250-
251248 HttpRequestMessage request = new HttpRequestMessage ( HttpMethod . Get , uri ) ;
252249
253250 if ( addAuthKey )
@@ -274,7 +271,7 @@ public async Task AdminIsolation_ReturnsExpectedStatus(string uri, bool isAppSer
274271 finally
275272 {
276273 environment . SetEnvironmentVariable ( EnvironmentSettingNames . FunctionsAdminIsolationEnabled , null ) ;
277- environment . SetEnvironmentVariable ( EnvironmentSettingNames . AzureWebsiteInstanceId , websiteInstanceId ) ;
274+ environment . SetEnvironmentVariable ( EnvironmentSettingNames . AzureWebsiteInstanceId , originalWebsiteInstanceId ) ;
278275 }
279276 }
280277
0 commit comments