title: No route registered for '/api/functions/admin/token'
body: <p>I have 2 functions and have written a powershell script to get the JWT for the Azure Function app. In one of the functions, it's working and in the other, it's not. Below is a part of my script which I am using for generating the JWT:</p>
  <pre><code>$ResourceGroupName = &lt;resource_group_name&gt;
  $functionAppName = &lt;function_app_name&gt;
  
  $resourceType = &quot;Microsoft.Web/sites/config&quot;
  $resourceName = &quot;$functionAppName/publishingcredentials&quot;
  $publishingCredentials = Invoke-AzResourceAction -ResourceGroupName $resourceGroupName -ResourceType $resourceType -ResourceName $resourceName -Action list -ApiVersion 2015-08-01 -Force
  
  $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes((&quot;{0}:{1}&quot; -f $publishingCredentials.Properties.PublishingUserName, $publishingCredentials.Properties.PublishingPassword)))
  
  $jwt = Invoke-RestMethod -Uri &quot;https://$functionAppName.scm.azurewebsites.net/api/functions/admin/token&quot; -Headers @{Authorization = (&quot;Basic {0}&quot; -f $base64AuthInfo) } -Method GET
  </code></pre>
  <p>The only difference that I could see between the 2 function apps is: the script works for a <code>Java</code> function of Version <code>2</code> and the function where the script doesn't work is a <code>Python</code> function of Version <code>3</code>.</p>
  <p>I also tried to generate a token from <a href="https://docs.microsoft.com/en-us/rest/api/appservice/webapps/getfunctionsadmintoken" rel="nofollow noreferrer">Azure official documentation</a> and it failed with the same error <code>No route registered for '/api/functions/admin/token'</code>. I then created a new function app in Python (Version 3) in a different subscription and tried the same and it worked for the new function app, but not for the previous one.</p>
  <p>Here are a few lines before the error message:</p>
  <pre><code>Invoke-RestMethod: /home/vsts/work/1/s/setKeyFunctionCode.ps1:72
  Line |
    72 |      $jwt = Invoke-RestMethod -Uri &quot;https://$functionAppName.scm.azure …
       |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       | No route registered for '/api/functions/admin/token'
  </code></pre>
  <p>Is there some configuration that I'm missing out?
  Please help me figure out the issue. Thanks in advance.</p>