Fly, Penguin!

I blog so I don't forget.

Azure App Service & Python, Part II

2 minute read #azure #serverless #rant

God I hate Microsoft.

TL;DR - use “Basic” and “B1” as your app service SKUs. Anything “below” won’t work and you won’t know why.

So, why I am again angry? Cause I want to deploy an app service, using terraform. Sounds soooooooooo simple, right? Except I fail at the creation of the app service (even without code, yet).

Example:

resource "azurerm_app_service_plan" "plan" {
  name                = "pkd-appservices0"
  location            = azurerm_resource_group.rg.location
  resource_group_name = azurerm_resource_group.rg.name
  kind                = "Linux"
  reserved            = true

  sku {
    tier = "Dynamic"     # WRONG, use at least "Basic"
    size = "Y1"          # WRONG, use at least "B1"
  }
}
resource "azurerm_app_service" "appservice" {
  name                = random_string.server.result
  location            = azurerm_resource_group.rg.location
  resource_group_name = azurerm_resource_group.rg.name
  app_service_plan_id = azurerm_app_service_plan.plan.id

  site_config {
    scm_type         = "LocalGit"
    linux_fx_version = "PYTHON|3.8"
  }
}

Now. What happens? Let’s see:

Error creating App Service "wzkytawt" (Resource Group "pkd-it-appservices0"):
   web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=0 --
   Original Error: autorest/azure: Service returned an error. Status=<nil> <nil>

What? Okay, our app service fails without any indication. By setting “TF_LOG=TRACE” and reading through 100s of lines of code we get this:

Consumption pricing tier cannot be used for regular web apps

What the fuck is a “consumption pricing tier”? Well, turns out MS doesn’t know as well, at least it’s described exactly nowhere. Also, can you get a list of tiers? No! Of course not! Why would you?  Stackoverflow to the rescue, again, btw, and no idea where that guy pulled that priceless list from.

So, set things to “F1 | Free” and everything works.

… or not. Now we get this:

There was a conflict.                                              (really?!)

64 Bit worker processes cannot be used for the site as the plan
does not allow it.                                                 (WTF?)

For more information on pricing and features, please see:
https://aka.ms/appservicepricingdetails                            (oh! a link! NICE)

Formatting and comments by me … . Now, wondering why the fuck a multi-billion-dollar corp can do less than my Raspi (run 64bit code) I head over to said page. And find nothing. There is not a single mention about 64bit, 32bit, or anything helpful. Just … prices.

Assuming the fuckers just want more money I upgrade SKU to “B1 | Basic”, and everything works. (Update: I just saw that this is actually mentioned in the terraform docs 🙂

This time for real, and I think I might be onto the path of finally understanding everything Microsoft does.