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

Support for linking function app to static web app #14319

Closed
kiranpradeep opened this issue Nov 24, 2021 · 15 comments · Fixed by #25331
Closed

Support for linking function app to static web app #14319

kiranpradeep opened this issue Nov 24, 2021 · 15 comments · Fixed by #25331

Comments

@kiranpradeep
Copy link
Contributor

kiranpradeep commented Nov 24, 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

Description

We could also link a Function App to a Static Web app. This is detailed at Microsoft document

Note: This is allowed only for static web apps in standard plan.

New or Affected Resource(s)

  • azurerm_static_site

Potential Terraform Configuration

resource "azurerm_static_site" "example" {
  name                = "example"
  resource_group_name = "example"
  location            = "West Europe"
  function_app_id     = azurerm_function_app.myfunction.id
}

References

  1. Related to Support for app settings configuration for azurerm_static_site #13451
  2. az cli equivalent at WebApp:staticwebapp - [P2] add support for linking existing function app (bring your own functions) Azure/azure-cli#17507
@adamyager
Copy link

@jackofallops hello. Do you know if this request for fall under the current plan to limit changes to App service/Functions until the 3.0.0 release of AzureRM?
If not, this would be a great feature for customers to use ahead of that.
This would also be a tagged under static-apps vs app service as one deploys a Function and then "attaches" the static app to it.

I think it would be like
link_function_app = function_app.myfunction.id

@jackofallops
Copy link
Member

Hi @adamyager - This isn't in scope for the service rewrite currently as we don't support provisioning Functions (within a Function App / Static Web App) at this time (which is a separate resource to Function Apps). The main focus of the rewrite was for resources / services that have undergone significant change/evolution since their introduction into the provider several years ago (time flies!). Static Web Apps are a relatively recent addition so, although I'm planning on giving them some TLC in the future, it'll currently be post-3.0. I think there are some issues with this API for the way Terraform works, which I need to review and see if we can work with the service team to iron out.

@adamyager
Copy link

@jackofallops thanks for the note. I do want to clarify that I am fairly certain that, in the case of Static Web apps and functions, that you are "attaching" a standard or normal function to a static web app as the underlying runtime. I think I was gathering from your note that it is a different service. I am not stating this to suggest it gets moved ahead or expedited but I do want to clarify what is happening. You can see the steps one would take in the portal to sort of clarify the mechanics here. https://docs.microsoft.com/en-us/azure/static-web-apps/functions-bring-your-own#link-an-existing-azure-functions-app

and

https://docs.microsoft.com/en-us/azure/static-web-apps/apis

Personally, I think they should have followed the patter of Logic Apps Standard as the underlying architecture is similar in many ways. They abstract this attachment from the function and its simply part of the deployment.

Anyway, thanks Again,

Adam

@jackofallops
Copy link
Member

Thanks for the feedback @adamyager - apologies if my reply came across a little terse, that wasn't the intention 🙈

Apparently I missed the GA on the BYOF feature, I don't recall seeing it in the GA for the Static Web Apps, nor in our service change notifications. I'll add it to my list, thanks for clarifying and the heads up! 👍

@adamyager
Copy link

Ha. I did not think you were terse at all. this one is strange in approach. Its not how I would have done it(on the azure side) and I agree there was no notification.

Have a great day,

Adam

@standuprey

This comment was marked as off-topic.

@adamyager
Copy link

@jackofallops hope all is well. This is would be super helpful for us. I think its a fairly simple addition to unlock this service for our company.

@tomabg

This comment was marked as off-topic.

@viresh-meshai

This comment was marked as off-topic.

@tomabg

This comment was marked as off-topic.

@jackofallops
Copy link
Member

Hi All 👋

We’re still looking to support this functionality, however we require acceptance tests for each resource that the Azure Provider supports and due to the way that the Static Web App works, we’re having issues getting working acceptance tests for this. This is as our testing framework doesn’t currently support external changes employed by the service (specifically creating GHA workflows) which isn’t part of our testing framework at this point in time - whilst we have a theory for how to make that work this is something we need to dig into.

The other blocker is that to attach a Function to a Static Web App, the application must already be deployed and running, which is a feature not yet supported by azurerm_static_web_app, this also needs to be investigated and is blocked currently by the same issue above in testing. We appreciate the desire for support for this, and we’d like to be able to add if we can. Please bear with us for the time being!

Thanks

@adamyager
Copy link

Hi All 👋

We’re still looking to support this functionality, however we require acceptance tests for each resource that the Azure Provider supports and due to the way that the Static Web App works, we’re having issues getting working acceptance tests for this. This is as our testing framework doesn’t currently support external changes employed by the service (specifically creating GHA workflows) which isn’t part of our testing framework at this point in time - whilst we have a theory for how to make that work this is something we need to dig into.

The other blocker is that to attach a Function to a Static Web App, the application must already be deployed and running, which is a feature not yet supported by azurerm_static_web_app, this also needs to be investigated and is blocked currently by the same issue above in testing. We appreciate the desire for support for this, and we’d like to be able to add if we can. Please bear with us for the time being!

Thanks

Hello @jackofallops I am just seeing if there is an update here. this service can have some larger financial benefits to us as well as several simplification wins for our teams. Would be great to see if this is something you all can focus on and I would appreciate any update you have.
Thanks!

@aidendipple
Copy link

Hello @jackofallops

Also bumping this for a progress update. This would be a very valuable addition in functionality.

Thanks

@adamyager
Copy link

@jackofallops can we get an update? We really would like this feature.

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 26, 2024
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.

7 participants