File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/WebJobs.Script.WebHost/Controllers Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,25 @@ public IActionResult GetInstanceInfo()
68
68
return Ok ( _instanceManager . GetInstanceInfo ( ) ) ;
69
69
}
70
70
71
+ /// <summary>
72
+ /// This endpoint generates a temporary x-ms-site-restricted-token for core tool
73
+ /// to access KuduLite zipdeploy endpoint in Linux Consumption
74
+ /// </summary>
75
+ /// <returns>
76
+ /// 200 on token generated
77
+ /// 400 on non-Linux container environment
78
+ /// 404 on WEBSITE_AUTH_ENCRYPTION_KEY is not set
79
+ /// </returns>
71
80
[ HttpGet ]
72
81
[ Route ( "admin/getsitetoken" ) ]
73
82
[ Authorize ( Policy = PolicyNames . AdminAuthLevel ) ]
74
83
public IActionResult GetSiteToken ( )
75
84
{
76
- // This endpoint is used by getting a temporary x-ms-site-restricted-token to for KuduLite request in Linux Consumption
85
+ if ( ! _environment . IsLinuxContainerEnvironment ( ) )
86
+ {
87
+ return BadRequest ( "Endpoint is only available when running in Linux Container" ) ;
88
+ }
89
+
77
90
string websiteEncryptionKey = _environment . GetEnvironmentVariable ( EnvironmentSettingNames . WebSiteAuthEncryptionKey ) ;
78
91
if ( string . IsNullOrEmpty ( websiteEncryptionKey ) )
79
92
{
You can’t perform that action at this time.
0 commit comments