Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when adding a slot to a functionapp #204

Closed
vandycknick opened this issue Mar 30, 2019 · 5 comments
Closed

Error when adding a slot to a functionapp #204

vandycknick opened this issue Mar 30, 2019 · 5 comments
Assignees

Comments

@vandycknick
Copy link

I keep running into the following issue when adding a slot to an azure functionapp:

Updating (dev):

     Type                      Name                          Status                  Info
     pulumi:pulumi:Stack       pulumi-function-app-test-dev  **failed**              1 error
 +   └─ azure:appservice:Slot  function-app-slot             **creating failed**     1 error

Diagnostics:
  azure:appservice:Slot (function-app-slot):
    error: Plan apply failed: web.AppsClient#CreateOrUpdateSlot: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="Function App app settings are not expected to be empty. Please try again with WEBSITE_CONTENTAZUREFILECONNECTIONSTRING as a storage account connection string." Details=[{"Message":"Function App app settings are not expected to be empty. Please try again with WEBSITE_CONTENTAZUREFILECONNECTIONSTRING as a storage account connection string."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"04122","Message":"Function App app settings are not expected to be empty. Please try again with WEBSITE_CONTENTAZUREFILECONNECTIONSTRING as a storage account connection string.","MessageTemplate":"Function App app settings are not expected to be empty. Please try again with {0} as a storage account connection string.","Parameters":["WEBSITE_CONTENTAZUREFILECONNECTIONSTRING"]}}]

  pulumi:pulumi:Stack (pulumi-function-app-test-dev):
    error: update failed

I tried a couple of different settings but can't seem to get it to work. It works just fine when adding a slot to an appservice.

The following is a 'small' reproduction of the issue:

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

// Create an Azure Resource Group
const resourceGroup = new azure.core.ResourceGroup("test-resource-group", {
    location: "West Europe",
});

// Create an Azure resource (Storage Account)
const account = new azure.storage.Account("functionsa", {
    resourceGroupName: resourceGroup.name,
    location: resourceGroup.location,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});

const appServicePlan = new azure.appservice.Plan(
    'function-app-plan',
    {
        resourceGroupName: resourceGroup.name,
        location: resourceGroup.location,
        kind: "FunctionApp",
        sku: {
            tier: "Dynamic",
            size: "Y1",
        },
    },
    { parent: resourceGroup },
)

const functionApp = new azure.appservice.FunctionApp('function-app', {
    resourceGroupName: resourceGroup.name,
    location: resourceGroup.location,
    appServicePlanId: appServicePlan.id,
    storageConnectionString: account.primaryConnectionString,
    appSettings: {
        "test": "test"
    },
    version: "~2"
});

const slot = new azure.appservice.Slot('function-app-slot', {
    name: "staging",
    resourceGroupName: resourceGroup.name,
    location: resourceGroup.location,
    appServiceName: functionApp.name,
    appServicePlanId: appServicePlan.id,
    appSettings: {
        "test": "test",
        "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": account.primaryConnectionString
    }
});
@mikhailshilkov
Copy link
Member

If I read this and that correctly:

  • You can't use App Service slots for Functions
  • Neither Azure CLI nor Terraform support Function App slots yet

Functions CLI doesn't support slots either and the case was once closed as "we're not adding new functionality to slots".

I'm failing to find any docs on Functions v2 explaining the slots support status. This issue is open and hasn't been updated since 2017.

Doesn't look very optimistic for slots @nickvdyck

@ColbyTresness
Copy link

CC @dariagrigoriu for the actual issue.

To be honest what @mikhailshilkov references is more of a lack of documentation thing than a lack of support thing (which I'm looking at fixing). Slots are actually something we're working on improving. For the dedicated plan, they're GA, and for consumption, preview (hence some bugs which you seem to be running into).

@JustinGrote
Copy link

Looks like Azure/azure-cli#9126 is in progress to fix this for function slots.

@mikhailshilkov
Copy link
Member

I believe we should track hashicorp/terraform-provider-azurerm#1307 for a fix / a new resource

@lukehoban
Copy link
Member

I’m going to close this out since it’s effectively a dupe of hashicorp/terraform-provider-azurerm#1307.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants