@@ -36,6 +36,7 @@ import { LogService } from './log.service';
36
36
import { PortalService } from 'app/shared/services/portal.service' ;
37
37
import { ExtensionInstallStatus } from '../models/extension-install-status' ;
38
38
import { Templates } from './../../function/embedded/temp-templates' ;
39
+ import { SiteService } from './site.service' ;
39
40
40
41
type Result < T > = Observable < HttpResult < T > > ;
41
42
@Injectable ( )
@@ -50,6 +51,7 @@ export class FunctionAppService {
50
51
private _injector : Injector ,
51
52
private _portalService : PortalService ,
52
53
private _globalStateService : GlobalStateService ,
54
+ private _siteService : SiteService ,
53
55
logService : LogService ,
54
56
injector : Injector ) {
55
57
@@ -73,7 +75,7 @@ export class FunctionAppService {
73
75
} else if ( ArmUtil . isLinuxApp ( context . site ) ) {
74
76
return this . _cacheService . get ( Constants . serviceHost + `api/runtimetoken${ context . site . id } ` , false , this . portalHeaders ( info . token ) )
75
77
} else {
76
- return this . _cacheService . get ( context . urlTemplates . scmTokenUrl , true , this . headers ( info . token ) ) ;
78
+ return this . _cacheService . get ( context . urlTemplates . scmTokenUrl , false , this . headers ( info . token ) ) ;
77
79
}
78
80
} )
79
81
. map ( r => r . json ( ) ) ;
@@ -261,7 +263,7 @@ export class FunctionAppService {
261
263
262
264
return this . _cacheService . get (
263
265
`${ Constants . cdnHost } api/templates?runtime=${ ( extensionVersion || 'latest' ) } &cacheBreak=${ window . appsvc . cacheBreakQuery } ` ,
264
- true ,
266
+ false ,
265
267
headers ) ;
266
268
} )
267
269
. map ( r => {
@@ -286,12 +288,6 @@ export class FunctionAppService {
286
288
. map ( r => r . json ( ) ) ) ;
287
289
}
288
290
289
- getFunctionAppAzureAppSettings ( context : FunctionAppContext ) {
290
- return this . azure . executeWithConditions ( [ ] , { resourceId : context . site . id } , t =>
291
- this . _cacheService . postArm ( `${ context . site . id } /config/appsettings/list` , true )
292
- . map ( r => r . json ( ) as ArmObj < { [ key : string ] : string } > ) ) ;
293
- }
294
-
295
291
createFunctionV2 ( context : FunctionAppContext , functionName : string , files : any , config : any ) {
296
292
const filesCopy = Object . assign ( { } , files ) ;
297
293
const sampleData = filesCopy [ 'sample.dat' ] ;
@@ -780,15 +776,15 @@ export class FunctionAppService {
780
776
return this . azure . executeWithConditions ( [ ] , { resourceId : context . site . id } ,
781
777
Observable . zip (
782
778
this . isSourceControlEnabled ( context ) ,
783
- this . azure . executeWithConditions ( [ ] , { resourceId : context . site . id } , this . _cacheService . postArm ( ` ${ context . site . id } /config/appsettings/list` , true ) ) ,
779
+ this . _siteService . getAppSettings ( context . site . id ) ,
784
780
this . isSlot ( context )
785
781
? Observable . of ( { isSuccessful : true , result : true , error : null } )
786
782
: this . getSlotsList ( context ) . map ( r => r . isSuccessful ? Object . assign ( r , { result : r . result . length > 0 } ) : r ) ,
787
783
this . getFunctions ( context ) ,
788
784
( a , b , s , f ) => ( { sourceControlEnabled : a , appSettingsResponse : b , hasSlots : s , functions : f } ) )
789
785
. map ( result => {
790
786
const appSettings : ArmObj < { [ key : string ] : string } > = result . appSettingsResponse . isSuccessful
791
- ? result . appSettingsResponse . result . json ( )
787
+ ? result . appSettingsResponse . result
792
788
: null ;
793
789
794
790
const sourceControlled = result . sourceControlEnabled . isSuccessful &&
0 commit comments