0

Does anyone know if Azure functions written in PowerShell are supported in Azure government? I have a PowerShell script running nicely (cron scheduled) in Azure commercial. I published to Azure Government (Phoenix specifically) and nothing is happening--no errors on publish, no log, no visible activity.

John Huschka
  • 35
  • 1
  • 5
  • Yes, you can script things in Azure Government environments, you just need to make sure that you access the environment correctly since some things have different access points and what not. I would suggest running `Get-AzureRmEnvironment` to get the list of differences. – TheMadTechnician Feb 08 '18 at 23:52
  • Thanks. I am deploying (via ARM template) and have other C# functions running successfully. Sounds like I may need to dig deeper (including Get-AzureRmEnvironment) into why this specific scheduled PowerShell function isn't running. – John Huschka Feb 09 '18 at 03:44

2 Answers2

1

Azure Functions is available in Azure Government, which includes Powershell. This quickstart is an example of deploying a function in Azure Government with CLI as well as Visual Studio. This is a link showing overall how to deploy Functions with Powershell, Could you elaborate on where exactly you are having issues?

Yujin Hong
  • 11
  • 1
  • See other comments, but I've been successfully running and deploying C# functions to Azure Government. It's just that this cron-triggered PowerShell function--which I'm deploying in the same manner as I successfully deploy to Azure Commercial--isn't doing anything--no activity (that I can tell), no log. Based on yours and other comments, I will dig deeper to see if I've missed something, and post appropriately. (Hope I haven't wasted peoples' time.) :*) – John Huschka Feb 09 '18 at 03:47
0

Update, March 12, 2018: Looks like this was caused by the app service's "Always on" behavior. In my Commercial, "dynamic", consumption plan it appears that the functionality is activated automatically, whereas in Government, with the "Standard", App Service plan, "Always on" must be configured explicitly. So, in the Government template, I have to provide the following additional configuration for the app service plan:

    "siteConfig": {
      "AlwaysOn": true
    },

Also, in my app service config for Commercial, I had

"alwaysOn": false,

but in Government, I have to have

"alwaysOn": true,

Completely weird: To the best I can determine, the PowerShell functions just spontaneously started working this morning. I went to the Kudu site for the functions (XXX.scm.azurewebsites.us), "Tools"/"Webjobs dashboard"/"Functions" menu. Within that, I navigated to the function URLs themselves. Then, I noticed that the functions were starting to show activity. It's like me navigating within Kudu woke up Cron (which is a bit hard to believe).

Two ideas about this:

  1. Something about my cron expression, which is "0 37 */1 * * *", which I understand to be "once per hour at 37 minutes after the hour". https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer
  2. Something about my ARM template, combined with Azure Government, combined with cron that causes it to not get started.
John Huschka
  • 35
  • 1
  • 5