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

Feature Request: azurerm_function_app add site_credential exports #1328

Closed
kevinneufeld opened this issue Jun 1, 2018 · 2 comments
Closed

Comments

@kevinneufeld
Copy link

kevinneufeld commented Jun 1, 2018

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

Please bring site_credential exports to azurerm_function_app, like azurerm_app_service.

New or Affected Resource(s)

  • azurerm_function_app

References

Potential Terraform Configuration

resource "azurerm_function_app" "test" {
  name                      = "test-azure-functions"
  location                  = "${azurerm_resource_group.test.location}"
  resource_group_name       = "${azurerm_resource_group.test.name}"
  app_service_plan_id       = "${azurerm_app_service_plan.test.id}"
  storage_connection_string = "${azurerm_storage_account.test.primary_connection_string}"
}

output "function_app_test_publishing_username" {
  value     = "${azurerm_function_app.test.site_credential.0.username}"
  sensitive = true
}

output "function_app_test_publishing_password" {
  value     = "${azurerm_function_app.test.site_credential.0.password}"
  sensitive = true
}

Workaround

Currently, we use following azurerm_template_deployment expose them:

resource "azurerm_template_deployment" "fn_arm_published_profiles" {
  name                = "fn-publish-profiles"
  resource_group_name = "some-rg"
  deployment_mode     = "Incremental"

  template_body = <<DEPLOY
{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "functionAppName": {
            "type": "string"
        }
    },
    "resources":[],
    "outputs": {
        "function_app_site_password": {
            "type": "string",
            "value": "[list(concat('Microsoft.Web/sites/', parameters('functionAppName') ,'/config/publishingcredentials'), '2016-08-01').properties.publishingPassword]"
        },
        "function_app_site_username": {
            "type": "string",
            "value": "[list(concat('Microsoft.Web/sites/', parameters('functionAppName') ,'/config/publishingcredentials'), '2016-08-01').properties.publishingUserName]"
        }
    }

}
DEPLOY

  parameters {
    "functionAppName"  = "${azurerm_function_app.fn_app.name}"
  }

  depends_on = [
    "azurerm_function_app.fn_app.name"
  ]
}

output "function_app_publishing_username" {
  value     = "${azurerm_template_deployment.fn_arm_published_profiles.outputs["function_app_site_username"]}"
  sensitive = false
}
output "function_app_publishing_password" {
  value     = "${azurerm_template_deployment.fn_arm_published_profiles.outputs["function_app_site_password"]}"
  sensitive = true
}

Thanks

@kevinneufeld kevinneufeld changed the title Feature Request: *azurerm_function_app* add site_credential exports Feature Request: azurerm_function_app add site_credential exports Jun 1, 2018
@arichiardi
Copy link
Contributor

Thanks for the workaround, it would definitely be nice to have this feature.

@ghost
Copy link

ghost commented Mar 30, 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 Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants