Invalid SKU Code “Free” — A Solution

A mostly green picture of a monitor with a big exclamation mark.

Sometimes it will happen that people will publish static WebApps to an Azure Static WebApp Resource. Also the people think about to do this

  1. On a free SKU plan, because they don’t expect much traffic or its just for a dev test which needs not many features.
  2. By deploying it with bicep, just because its very simple and state of the art for software development.
  3. By using an Azure Key Vault for security reasons when an API needs secret values.

That’s a simple setup which should work very well.

When you setup a bicep script for your static web app it looks like:

...

resource staticWebApp 'Microsoft.Web/staticSites@2022-03-01' = {
name: name
location: location
sku: {
name: "Free"
tier: "Free"
}
identity: {
type: "SystemAssigned"
}
properties: {
stagingEnvironmentPolicy: "Enabled"
allowConfigFileUpdates: true
provider: "Custom"
enterpriseGradeCdnStatus: "Disabled"
}
tags: tags
}

...

or quite similar.

In my case, it did not work. I’ve got an exception while deploying:

...

{
"ErrorEntity": {
"ExtendedCode": "55925",
"MessageTemplate": "SkuCode '{0}' is invalid.",
"Parameters": [
"Free"
],
"Code": "BadRequest",
"Message": "SkuCode 'Free' is invalid."
}
}

...

Thats really annoying. I’m absolutely sure the SKU Code ‘Free’ exists. I can set up this value in the Azure Portal and by generating the ARM template, I get exactly this code. So what is the problem?

After investigating a while, I found out that a ‘Free’ Azure Static WebApp Resource can’t set up an ‘SystemAssigned’ identity. If you want to set up a Managed Identity to use it for a Key Vault you need to select a SKU ‘Standard’ (BTW, it’s the same for “Bring your own Function”-feature).

My problem is the error message. If the SKU wrong because of Identity, “Bring your own Function” or something else, so make it clear.

Now you know why you’ve got that error and my post was helpful for you.