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 Data Sources and Resources for App Service / Function Apps #13816

Closed
opslivia opened this issue Oct 21, 2021 · 8 comments
Closed

New Data Sources and Resources for App Service / Function Apps #13816

opslivia opened this issue Oct 21, 2021 · 8 comments

Comments

@opslivia
Copy link

opslivia commented Oct 21, 2021

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

As part of the 3.0 release, we are rewriting all of the resources that fall under the App and function services (web apps).

New or Affected Resource(s)

This rewrite includes:

Potential Terraform Configuration

Please see latest for each service in the provider documentation under App Service (Web Apps): https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs

References

3.0-overview
Beta Resource Opt-In

@Condabas
Copy link

Condabas commented Jan 7, 2022

azurerm_app_service_source_control

Documentation appears to be missing some block documentation. Trying to use arguments "manual_integration" and "uses_github_action" results in:

An argument named "manual_integration" is not expected here.
An argument named "uses_github_action" is not expected here.

@jackofallops
Copy link
Member

Thanks @Condabas - good catch, thanks! I've submitted a PR to correct the docs - #14870

If you happen to find other problems, or have feedback, there's a Beta Feedback issue template, it'd be a big help if you can submit via that to help us track things. Thanks!

@brandonros
Copy link
Contributor

brandonros commented Feb 15, 2022

https://docs.microsoft.com/en-us/azure/templates/microsoft.web/sites/functions?tabs=bicep

https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webappfunction/

Are web_app_functions missing resource wise?

I see this here: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_web_app

But no way to link up this kind of resource:

        {
            "type": "Microsoft.Web/sites/functions",
            "apiVersion": "2021-02-01",
            "name": "[concat(parameters('sites_gd_tx_feedreader_dev_name'), '/redacted')]",
            "location": "West US 2",
            "dependsOn": [
                "[resourceId('Microsoft.Web/sites', parameters('sites_gd_tx_feedreader_dev_name'))]"
            ],
            "properties": {
                "script_root_path_href": "https://redacted.azurewebsites.net/admin/vfs/site/wwwroot/redacted/",
                "script_href": "https://redacted.azurewebsites.net/admin/vfs/site/wwwroot/bin/redacted.dll",
                "config_href": "https://redacted.azurewebsites.net/admin/vfs/site/wwwroot/redacted/function.json",
                "test_data_href": "https://redacted.azurewebsites.net/admin/vfs/data/Functions/sampledata/redacted.dat",
                "href": "https://redacted.azurewebsites.net/admin/functions/redacted",
                "config": {},
                "language": "DotNetAssembly",
                "isDisabled": false
            }
        },

You're able to edit triggers with things like Azure Service Bus (message)

function.json

{
  "generatedBy": "Microsoft.NET.Sdk.Functions.Generator-4.0.1",
  "configurationSource": "attributes",
  "bindings": [
    {
      "type": "serviceBusTrigger",
      "connection": "ServiceBusConnection",
      "autoComplete": false,
      "topicName": "q.topic.eventfeed",
      "subscriptionName": "q.subscription.eventfeed",
      "isSessionsEnabled": false,
      "name": "message"
    }
  ],
  "disabled": false,
  "scriptFile": "../bin/redacted-rawstorage.dll",
  "entryPoint": "redacted.StoreRawDataFunction.Run"
}

more data:

{
    "id": "/subscriptions/REDACTED/resourceGroups/REDACTED/providers/Microsoft.Web/sites/REDACTED/functions/redacted",
    "name": "function-app/redacted",
    "type": "Microsoft.Web/sites/functions",
    "location": "West US 2",
    "properties": {
        "name": "redacted",
        "function_app_id": null,
        "script_root_path_href": "https://redacted.azurewebsites.net/admin/vfs/site/wwwroot/redacted/",
        "script_href": "https://redacted.azurewebsites.net/admin/vfs/site/wwwroot/bin/redacted.dll",
        "config_href": "https://redacted.azurewebsites.net/admin/vfs/site/wwwroot/redacted/function.json",
        "test_data_href": "https://redacted.azurewebsites.net/admin/vfs/data/Functions/sampledata/redacted.dat",
        "secrets_file_href": null,
        "href": "https://redacted.azurewebsites.net/admin/functions/redacted",
        "config": {
            "generatedBy": "Microsoft.NET.Sdk.Functions.Generator-4.0.1",
            "configurationSource": "attributes",
            "bindings": [
                {
                    "type": "serviceBusTrigger",
                    "connection": "ServiceBusConnection",
                    "autoComplete": false,
                    "topicName": "q.topic.eventfeed",
                    "subscriptionName": "q.subscription.eventfeed",
                    "isSessionsEnabled": false,
                    "name": "message"
                }
            ],
            "disabled": false,
            "scriptFile": "../bin/redacted.dll",
            "entryPoint": "redacted.StoreRawDataFunction.Run"
        },
        "files": null,
        "test_data": "",
        "invoke_url_template": null,
        "language": "DotNetAssembly",
        "isDisabled": false
    }
}

Underlying Azure Go SDK file seems to be here: https://github.com/hashicorp/terraform-provider-azurerm/blob/main/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web/apps.go CreateInstanceFunctionSlot

@jackofallops
Copy link
Member

Hi @brandonros - There's a new resource azurerm_function_app_function introduced in #15605, which will allow users to create Functions in a Function App - Is this what you're looking for? I'm not aware of the ability to attach Functions to Web Apps, only Function App at this time?

Note: I also have Functions for Static Web Apps on my to-do list, but there are some testing issues for us around Static Web Apps currently, so this will not make it into the 3.0 release, and I don't have an ETA for it at the moment.

@brandonros
Copy link
Contributor

I think my problem was that I was trying to deploy a Dockerized regular .NET app "FROM" image wise instead of the "azure-functions" specific Microsoft Docker Hub base image which has all kinds of goodies "Azure function runtime" wise behind it.

@jackofallops
Copy link
Member

Hi folks! 👋

Back in September (specifically in v2.76.0) we introduced the first of the beta resources for the re-implementation of the App Service resources. In the months that followed, these evolved and were expanded on to provide what we feel is much improved experience with this service in Terraform.

We’d like to thank those of you that have helped in the development of these resources, through conversation on the community Slack, and via issues and feature requests here on the project. We really appreciate it!

Since this issue is tracking the beta, and as of 3.0 the new resources are being promoted to General Availability and the resources they supersede are being deprecated, I’m going to close it out. Anyone subscribed to this issue will get a further update when the 3.0 release is published.

Thanks again!

@github-actions
Copy link

This functionality has been released in v3.0.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2022
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

6 participants