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

New Resource: azurerm_function_app_slot #1307

Closed
pbazydlo opened this issue May 28, 2018 · 18 comments · Fixed by #6435
Closed

New Resource: azurerm_function_app_slot #1307

pbazydlo opened this issue May 28, 2018 · 18 comments · Fixed by #6435

Comments

@pbazydlo
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Azure Functions support deployment slots in preview, which among other things support 0-downtime deployments. It would be useful to be able to create those with terraform in similar way that slots for app services are defined.

https://blogs.msdn.microsoft.com/appserviceteam/2017/06/13/deployment-slots-preview-for-azure-functions/

New or Affected Resource(s)

  • azurerm_function_app - add ability to enable slots
  • azurerm_function_app_slot - for defining slots for Azure functions
@tombuildsstuff tombuildsstuff added the service/functions Function Apps label May 29, 2018
@tombuildsstuff tombuildsstuff changed the title Add support for function app slots New Resource: azurerm_function_app_slot May 29, 2018
@midacts
Copy link
Contributor

midacts commented Dec 18, 2018

azurerm_app_service_slot don't work, eh?
: [

@provanguard
Copy link

Is this feature being already implemented? I would like to use it now :)

@daveobike
Copy link

I tried azurerm_app_service_slot but referencing the function app service for app_service_name (per a blog I found). I received an error on plan: 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." This same error string appears in an issue for az CLI.

@MarkDordoy
Copy link
Contributor

Hello

Do we know if this will be turning up in a new version of the provider anytime soon.

@Workshop2
Copy link

Azure CLI added support for this feature in June:
https://github.com/MicrosoftDocs/azure-docs-cli/blob/master/docs-ref-conceptual/release-notes-azure-cli.md#appservice-1

@afuggetta
Copy link

Any news on this?
I've been waiting on a fix for months...first AZ CLI and now terraform. I get the same error as @daveobike . AZ CLI works as expected after their fix.

@midacts
Copy link
Contributor

midacts commented Aug 15, 2019

I am also running into the same issue when trying to create a slot on a function app with terraform:
Function App app settings are not expected to be empty. Please try again with WEBSITE_CONTENTAZUREFILECONNECTIONSTRING as a storage account connection string

This works without error, but isn't terraform code:
New-AzureRmWebAppSlot -Name $AppName -ResourceGroupName $ResourceGroup -Slot $SlotName

@Workshop2
Copy link

We ended up moved to zip deploys via CI instead of slots. They seem to be working well 👍

https://docs.microsoft.com/en-us/azure/azure-functions/deployment-zip-push

@midacts
Copy link
Contributor

midacts commented Aug 15, 2019

I got this info from https://resources.azure.com

The direct URL looks like this:
https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRG/providers/Microsoft.Web/sites/funcapp-sandbox-san/slots/funcapp-sandbox-stg?api-version=2018-02-01

But here is the API response from manually creating a function app through the portal.

{
    "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyRG/providers/Microsoft.Web/sites/funcapp-sandbox/slots/funcapp-sandbox-stg",
    "name": "funcapp-sandbox/funcapp-sandbox-stg",
    "type": "Microsoft.Web/sites/slots",
    "kind": "functionapp",
    "location": "East US",
    "properties": {
      "name": "funcapp-sandbox(funcapp-sandbox-stg)",
      "state": "Running",
      "hostNames": [
        "funcapp-sandbox-funcapp-sandbox-stg.azs.example.com"
      ],
      "webSpace": "MyASE-MyASEappseEastUSwebspace",
      "selfLink": "https://waws-prod-blu-a4acfff1.api.p.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/MyASE-MyASEappseEastUSwebspace/sites/funcapp-sandbox",
      "repositorySiteName": "funcapp-sandbox",
      "owner": null,
      "usageState": "Normal",
      "enabled": true,
      "adminEnabled": true,
      "enabledHostNames": [
        "funcapp-sandbox-funcapp-sandbox-stg.azs.example.com",
        "funcapp-sandbox-funcapp-sandbox-stg.scm.azs.example.com"
      ],
      "siteProperties": {
        "metadata": null,
        "properties": [
          {
            "name": "LinuxFxVersion",
            "value": ""
          },
          {
            "name": "WindowsFxVersion",
            "value": null
          }
        ],
        "appSettings": null
      },
      "availabilityState": "Normal",
      "sslCertificates": null,
      "csrs": [],
      "cers": null,
      "siteMode": null,
      "hostNameSslStates": [
        {
          "name": "funcapp-sandbox-funcapp-sandbox-stg.azs.example.com",
          "sslState": "Disabled",
          "ipBasedSslResult": null,
          "virtualIP": null,
          "thumbprint": null,
          "toUpdate": null,
          "toUpdateIpBasedSsl": null,
          "ipBasedSslState": "NotConfigured",
          "hostType": "Standard"
        },
        {
          "name": "funcapp-sandbox-funcapp-sandbox-stg.scm.azs.example.com",
          "sslState": "Disabled",
          "ipBasedSslResult": null,
          "virtualIP": null,
          "thumbprint": null,
          "toUpdate": null,
          "toUpdateIpBasedSsl": null,
          "ipBasedSslState": "NotConfigured",
          "hostType": "Repository"
        }
      ],
      "computeMode": null,
      "serverFarm": null,
      "serverFarmId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyASE/providers/Microsoft.Web/serverfarms/MyASP",
      "reserved": false,
      "isXenon": false,
      "hyperV": false,
      "lastModifiedTimeUtc": "2019-08-15T13:31:33.8433333",
      "storageRecoveryDefaultState": "Running",
      "contentAvailabilityState": "Normal",
      "runtimeAvailabilityState": "Normal",
      "siteConfig": null,
      "deploymentId": "funcapp-sandbox__9822",
      "trafficManagerHostNames": null,
      "sku": "Isolated",
      "scmSiteAlsoStopped": false,
      "targetSwapSlot": null,
      "hostingEnvironment": "MyASE",
      "hostingEnvironmentProfile": {
        "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyASE/providers/Microsoft.Web/hostingEnvironments/MyASE",
        "name": "MyASE",
        "type": "Microsoft.Web/hostingEnvironments"
      },
      "clientAffinityEnabled": true,
      "clientCertEnabled": false,
      "clientCertExclusionPaths": null,
      "hostNamesDisabled": false,
      "domainVerificationIdentifiers": null,
      "kind": "functionapp",
      "inboundIpAddress": "xxx.xxx.xxx.xxx",
      "possibleInboundIpAddresses": "xxx.xxx.xxx.xxx",
      "outboundIpAddresses": "xxx.xxx.xxx.xxx",
      "possibleOutboundIpAddresses": "xxx.xxx.xxx.xxx",
      "containerSize": 1536,
      "dailyMemoryTimeQuota": 0,
      "suspendedTill": null,
      "siteDisabledReason": 0,
      "functionExecutionUnitsCache": null,
      "maxNumberOfWorkers": null,
      "homeStamp": "waws-prod-red-xxxxxxxx",
      "cloningInfo": null,
      "hostingEnvironmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyASE/providers/Microsoft.Web/hostingEnvironments/MyASE",
      "tags": null,
      "resourceGroup": "MyRG",
      "defaultHostName": "funcapp-sandbox-funcapp-sandbox-stg.azs.example.com",
      "slotSwapStatus": null,
      "httpsOnly": false,
      "redundancyMode": "None",
      "inProgressOperationId": null,
      "geoDistributions": null,
      "privateEndpointConnections": []
    }
}

@midacts
Copy link
Contributor

midacts commented Aug 15, 2019

@Workshop2 Thanks for the link and idea.

Where I work, things move slowly and there are several development teams that would have to change process.

@shivanigoyaluk
Copy link

I want to create function app slot using terraform but there is no resource available as azurerm_function_app_slot. Is there any chances of being available anytime soon?

We tried to create staging slot with azue cli but there is lot of hassel with slot settings.
Does anyone have any better way to handle function app slots with terraform?

@withinboredom
Copy link

@tombuildsstuff on #4684 you mentioned sending certain app settings. The bug is that even if these are specified correctly in Terraform, you still get this error.

@ajklotz
Copy link

ajklotz commented Feb 27, 2020

Is there a list of resources that are not yet supported via terraform? Surprised to see that function app slots are not available via terraform resources. This issue has been open for almost 2 years.

@dannmichelson
Copy link

I am also looking to use terraform to create azure function app slots, and am curious if there is any update or planned timeframe to add this

@schlbra
Copy link

schlbra commented Feb 28, 2020

Is there a list of resources that are not yet supported via terraform? Surprised to see that function app slots are not available via terraform resources. This issue has been open for almost 2 years.

If you filter the issues on the label ‘new-resource’, you essentially get a list of resources not currently supported.

https://github.com/terraform-providers/terraform-provider-azurerm/labels/new-resource

@collinstevens
Copy link

It looks like Function App Deployment Slot support was added to the Azure CLI in Azure/azure-cli#9550. It seems like this is what was blocking this feature; is this an up for grabs issue?

@aristosvo
Copy link
Contributor

@collinstevens I want to give this one a try, is that okay with you?

@ghost
Copy link

ghost commented Jun 5, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.