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_web_app - add support for dotnetcore in site metadata value current_stack #16129

Merged
merged 2 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/services/appservice/helpers/web_app_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,7 @@ func windowsApplicationStackSchema() *pluginsdk.Schema {
Optional: true,
ValidateFunc: validation.StringInSlice([]string{
"dotnet",
"dotnetcore",
"node",
"python",
"php",
Expand Down
27 changes: 26 additions & 1 deletion internal/services/appservice/windows_web_app_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ func TestAccWindowsWebApp_withDotNet3(t *testing.T) {

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.dotNet(data, "v3.0"),
Config: r.dotNetCore(data, "v3.0"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
Expand Down Expand Up @@ -1812,6 +1812,31 @@ resource "azurerm_windows_web_app" "test" {
site_config {
application_stack {
dotnet_version = "%s"
current_stack = "dotnet"
}
}
}
`, r.baseTemplate(data), data.RandomInteger, dotNetVersion)
}

func (r WindowsWebAppResource) dotNetCore(data acceptance.TestData, dotNetVersion string) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}

%s

resource "azurerm_windows_web_app" "test" {
name = "acctestWA-%d"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
service_plan_id = azurerm_service_plan.test.id

site_config {
application_stack {
dotnet_version = "%s"
current_stack = "dotnetcore"
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion website/docs/r/windows_web_app.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@ A `application_logs` block supports the following:

An `application_stack` block supports the following:

* `current_stack` - (Optional) The Application Stack for the Windows Web App. Possible values include `dotnet`, `node`, `python`, `php`, and `java`.
* `current_stack` - (Optional) The Application Stack for the Windows Web App. Possible values include `dotnet`, `dotnetcore`, `node`, `python`, `php`, and `java`.

~> **NOTE:** Whilst this property is Optional omitting it can cause unexpected behaviour, in particular for display of settings in the Azure Portal.

~> **NOTE:** The value of `dotnetcore` is for use in combination with `dotnet_version` set to `v3.0` only.

* `docker_container_name` - (Optional) The name of the Docker Container. For example `azure-app-service/samples/aspnethelloworld`

* `docker_container_registry` - (Optional) The registry Host on which the specified Docker Container can be located. For example `mcr.microsoft.com`
Expand Down