hashicorp / terraform-provider-azurestack

Terraform provider for Azure Stack
https://www.terraform.io/docs/providers/azurestack/
Mozilla Public License 2.0
38 stars 62 forks source link

[Feature request] AzureStack AppService Support? #50

Open tuthan opened 5 years ago

tuthan commented 5 years ago

I have read the docs but seem currently Azure-stack haven't provide support for App Service on Azure-stack yet. Is there any plan?

tombuildsstuff commented 5 years ago

@pbolduc

I dont mind helping getting this done and tested. I just dont know the approach. It is difficult to know where to start.

That'd be awesome, thanks!

I suspect I would start with the azurerm provider and strip back / lower the api versions... ?

In general we're copying resources over from the AzureRM Provider as needed but switching the SDK to use the Profile exposed in the Azure SDK rather than using specific API versions (since this is Microsoft's recommendation for developing applications for Azure Stack).

Each Terraform Provider has Acceptance Tests covering each resource - as such it should be possible to lift & shift the resources/tests/documentation from AzureRM, update to using the profile and then run the tests to see which features need to be removed.

Once you've lifted the files over, since we're using Go Modules - you should be able to update the Imports from:

"github.com/Azure/azure-sdk-for-go/services/web/mgmt/2018-02-01/web"

to (in this case)

"github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/web/mgmt/web"

then run GO111MODULE=on go mod vendor and have the relevant source files sync - which should make this compile-able using the new profile. Instructions for how to run the Acceptance Tests can then be found in the readme - which should confirm if just porting this over as-is works or not, or if some unsupported functionality needs to be removed.

It's worth noting that we've started refactoring the AzureRM codebase in the last few releases so the codebases are diverging slightly at the moment - as such it may be easiest to refer to a slightly older version of the codebase where the codebases are more similar.

Feel free to reach out if you've got specific questions too either here or in the #contributors room in the terraform-azure slack (details here) where we should be able to help further :)

Thanks!

tombuildsstuff commented 5 years ago

It it possible to do the initial development against Azure Cloud and then do the final testing against Azure Stack. i.e., Do all the API versions used in Stack exist in Azure Cloud?

You can certainly try - but in my experience this'll be challenging since Azure Stack behaves differently to Azure Public in the same API endpoints (for example some functionality [e.g. SSD's] isn't supported in Azure Stack but is available in Public) as such I'd suggest it's probably easiest to develop against the Azure Stack instance if you can