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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[App Service] Linux App Services don't return all fields #1698

Closed
tombuildsstuff opened this issue Sep 19, 2017 · 19 comments
Closed

[App Service] Linux App Services don't return all fields #1698

tombuildsstuff opened this issue Sep 19, 2017 · 19 comments
Assignees

Comments

@tombuildsstuff
Copy link
Contributor

tombuildsstuff commented Sep 19, 2017

馃憢

When creating a App Service within a Linux App Service Plan using the LinuxFxVersion field - the App Service is created successfully; however it appears this field isn't populated/returned in the API response when retrieving an App Service.

I'm making use of the Go SDK here, but from what I can see this is a Service Issue rather than something specific to the Go SDK.. whilst this may also affect other fields, but I've only noticed the LinuxFxVersion isn't returned - would it be possible to fix this?

Thanks!

@tombuildsstuff
Copy link
Contributor Author

ping @fearthecowboy - is there any update available here? :)

@fearthecowboy
Copy link
Member

assigning to owner (@naveedaz )for follow up

@fearthecowboy fearthecowboy removed their assignment Dec 8, 2017
@herrkris
Copy link

Hey there, are there any updates available? :) @naveedaz

@seffyroff
Copy link

Also chiming in here, this leaves a large hole in my deployment right now.

@joshgav
Copy link

joshgav commented Feb 16, 2018

@tombuildsstuff would you mind describing how the missing field effects Terraform? Thanks!

@seffyroff are you using Terraform or having a problem using the SDKs directly? Thanks!

@tombuildsstuff
Copy link
Contributor Author

@joshgav so with the API in it's current state it's not possible for us to detect drift, since these values can be submitted but aren't returned back, which means that if a change is made outside of Terraform, it won't be detected in the plan. It also means it's not currently possible to fully import a Linux App Service since the fields aren't mapped across; and due to #1697 Terraform will attempt to delete the App Service upon noticing these changes (to work around being unable to update the App Service in the API) - which isn't ideal

Hope that helps - let me know if you need any more information - thanks! :)

@seffyroff
Copy link

@seffyroff are you using Terraform or having a problem using the SDKs directly? Thanks!

Terraform, yes. I have looked at accomplishing this via SDK scaffolding or with a template, but neither is ideal in our use case, and would be a significant departure from our existing workflow.

@joshgav
Copy link

joshgav commented Feb 16, 2018

Thanks @tombuildsstuff and @seffyroff for the details! @davidebbo @naveedaz we'll need your help addressing this, also about to start an email thread with you, thanks!

@C123R
Copy link

C123R commented Mar 15, 2018

Guys, any update here ? :) @davidebbo @naveedaz
Azure Web App for Containers is a cool feature and would love to manage it from Terraform. Appreciate your quick support here. Thanks

@davidebbo
Copy link

Not my area, so I'll let @naveedaz or others respond here.

@naveedaz
Copy link
Contributor

@tombuildsstuff
Please use the https://docs.microsoft.com/en-us/rest/api/appservice/webapps/getconfiguration API to get the value for linuxFxVersion. The Update/Get Configuration API is the supported method of modifying and tracking that configuration.

The swagger file has it already as:
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/Microsoft.Web/stable/2016-03-01/CommonDefinitions.json#L1914

@joshgav
Copy link

joshgav commented Mar 16, 2018

Thank you @naveedaz. The corresponding Go SDK methods are:

So @naveedaz, assuming the user has an AppsClient as client, would you recommend the following code for checking and updating LinuxFxVersion?

@tombuildsstuff are you using this GetConfiguration method and still not getting an updated field?

config, _ := client.GetConfiguration(ctx, rgName, appName)
fmt.Println(config.LinuxFxVersion)
config.LinuxFxVersion = "string"
config, err := client.CreateOrUpdateConfiguration(ctx, rgName, appName, config)

@tombuildsstuff
Copy link
Contributor Author

@naveedaz @joshgav yep - we're using both of those endpoints. Here's the Update call (via client.CreateOrUpdateConfiguration:

https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/resource_arm_app_service.go#L318-L325

and the Read call (via client.GetConfiguration):

https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/resource_arm_app_service.go#L379-L382

For the moment the code linked above doesn't submit the Linux values (since it's broken / hence this issue) - however when adding these fields in, and giving them values; these are omited from the responses from the Azure API's.

Hope that helps!

@marstr
Copy link
Member

marstr commented May 18, 2018

Hey @tombuildsstuff, I just spent a little time digging here and I think we may be able to work around this while I follow-up internally.

When I GET an existing Web App for Containers using this endpoint:

/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}

Instead of getting back a site config as here:

and here:

I get back a structure that looks like this:

        "siteProperties": {
            "metadata": null,
            "properties": [
                {
                    "name": "LinuxFxVersion",
                    "value": "DOCKER|marstr/musicvotes"
                },
                {
                    "name": "WindowsFxVersion",
                    "value": null
                }
            ],
            "appSettings": null
        },

I can't find any reference in the Swagger that documents the "siteProperties" object. I'll follow up internally to get those definitions added.

In the meantime, let me know if you'd like help with a work around.

@marstr
Copy link
Member

marstr commented May 18, 2018

Acutally, while the above is a departure from what is noted in Swagger, it does seem like when I call the endpoint linked above by @joshgav:

/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web

I do get a siteConfig back with the property, "linuxFxVersion": "DOCKER|marstr/musicvotes". Are you not getting that, @tombuildsstuff?

edit: I'm going to start writing a test in the Go SDK samples repository to see if I can repro @tombuildsstuff's results.

@tombuildsstuff
Copy link
Contributor Author

@marstr thanks for confirming that, I'll take a look into this later this week - it could well be this is now returned in the new API version? Thanks!

@marstr
Copy link
Member

marstr commented May 22, 2018

For what it's worth, I'm submitting a PR into the Azure-Samples/azure-sdk-for-go-samples repository that spins up a WebApp for containers, then fetches the value of LinuxFxVersion: Azure-Samples/azure-sdk-for-go-samples#187

Let me know if there's anything else I can do to make the sample a defacto repro for this issue. :)

@yungezz yungezz closed this as completed Oct 17, 2019
@tombuildsstuff
Copy link
Contributor Author

@yungezz can you confirm if this issue has been resolved - I don't believe this has been fixed?

@yungezz
Copy link
Member

yungezz commented Oct 17, 2019

HI @tombuildstuff, #1698 (comment) shared the sample of getting LinuxFxVersion in go. Could you pls give it a try? We're cleanup legacy issues no updating in years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants