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

azurerm_windows_function_app/azurerm_linux_function_app - Add support for PowerShell 7.2 #16718

Merged
merged 3 commits into from
May 18, 2022

Conversation

Francisco-Gamino
Copy link
Contributor

Resolves #16717.

@Francisco-Gamino Francisco-Gamino changed the title Add support for PowerShell 7.2 Add support for PowerShell 7.2 in azurerm_app_service May 10, 2022
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Francisco-Gamino - LGTM but could we update the docs with the new valid value? should be good to merge after that sis done! thanks

@Francisco-Gamino
Copy link
Contributor Author

Thank you @katbyte for the PR review. Could you please point me to the doc that needs to be updated? I am not very familiar with your repro as this is my first contribution.

@Francisco-Gamino
Copy link
Contributor Author

Hello @katbyte -- I did a recursive search for any docs that contain powershell_core_version and 7. Here is the list of files I've updated:

website/docs/r/linux_function_app.html.markdown
website/docs/r/linux_function_app_slot.html.markdown
website/docs/r/windows_function_app.html.markdown
website/docs/r/windows_function_app_slot.html.markdown

Please let me know if I am missing anything. Lastly, once this PR is merged, how long will it take to release this change? Thank you!

@Francisco-Gamino
Copy link
Contributor Author

Thank you @mbfrahry for fixing my PR.

@mbfrahry mbfrahry changed the title Add support for PowerShell 7.2 in azurerm_app_service azurerm_windows_function_app/azurerm_linux_function_app - Add support for PowerShell 7.2 May 18, 2022
@mbfrahry mbfrahry added this to the v3.7.0 milestone May 18, 2022
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a problem @Francisco-Gamino! LGTM!

@mbfrahry mbfrahry merged commit 063829a into hashicorp:main May 18, 2022
mbfrahry added a commit that referenced this pull request May 18, 2022
@Francisco-Gamino
Copy link
Contributor Author

Thank you @mbfrahry !

One last question: When will this change be released?

@github-actions
Copy link

This functionality has been released in v3.7.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!

@bdorplatt
Copy link

After setting the parameter to 7.0 or 7.2, should that value be reflected in the Azure portal? We have tried both versions and under Configuration>General Settings the Stack is listed as PowerShell Core but the PowerShell Core Version option is blank. The versions are available in the drop-down, just neither is selected.

Is this possibly a situation where there is just a bug in the GUI and the setting is actually set on the backend?

@Francisco-Gamino
Copy link
Contributor Author

Hello @bdorplatt -- I am not sure if the Azure Portal has a hardcoded or dynamic list of supported language versions. I would suggest opening an issue against the Azure Portal. The support for PowerShell 7.2 was added to version 3.7.0.

@bdorplatt
Copy link

While support was added to the code, it doesn't appear to actually set the value of the PowerShell version. Changing the version back and forth from 7 to 7.2 in code doesn't seem to modify the actual resource. The same thing happens when using Java as the application stack but works correctly with Node and reflects the correct version in the portal. It appears to be the same issue as here https://github.com/hashicorp/terraform-provider-azurerm/issues/8867
But now it happens with the 3.7.0 provider with the new stack settings.

@Francisco-Gamino
Copy link
Contributor Author

Francisco-Gamino commented May 25, 2022

@bdorplatt -- The code change adds 7.2 to the list of valid runtime values. However, you still need to add this value to the app setting for your function app. It would look something like this for a Windows app:

app_settings = {
    FUNCTIONS_WORKER_RUNTIME_VERSION = "7.2"
    FUNCTIONS_WORKER_RUNTIME         = "powershell"
    # more settings...
  }

These is how the app settings for my app look like after deploying:

image

@bdorplatt
Copy link

We were under the impression that the new application_stack block settings superseded the FUNCTIONS_WORKER_RUNTIME and FUNCTIONS_WORKER_RUNTIME_VERSION app settings and would fill the version into the app settings. It is doing this for FUNCTIONS_WORKER_RUNTIME, filling "powershell" into the app settings without us specifying it as an app setting.

The only app settings we are specifying are below:
app_settings = {
"KEYVAULT_ENDPOINT" = var.kv_uri
"APPINSIGHTS_INSTRUMENTATIONKEY" = var.ai_instrumentation_key
}
And these stack settings:
application_stack {
powershell_core_version = "7.2"
}

And we get the following result in app settings, where only "powershell" without the version is showing. It seems odd that the application stack settings would have been added but you have to specify the versions in two different places. (in stack_settings as well as app_settings)

image

@Francisco-Gamino
Copy link
Contributor Author

@bdorplatt -- Thank you for the reply. I am new to Terraform, so I am going to get let a Terraform SME answer this.
@mbfrahry -- Could you please help answer the question above on what is the recommend way to set the powershell_core_version for a function app? Thank you.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Jun 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support PowerShell 7.2 in azurerm_app_service
4 participants