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

Open
tombuildsstuff opened this Issue Sep 19, 2017 · 17 comments

Comments

Projects
None yet
9 participants
@tombuildsstuff
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

This comment has been minimized.

Contributor

tombuildsstuff commented Dec 8, 2017

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

@fearthecowboy

This comment has been minimized.

Member

fearthecowboy commented Dec 8, 2017

assigning to owner (@naveedaz )for follow up

@fearthecowboy fearthecowboy removed their assignment Dec 8, 2017

@herrkris

This comment has been minimized.

herrkris commented Jan 30, 2018

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

@seffyroff

This comment has been minimized.

seffyroff commented Feb 15, 2018

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

@joshgav

This comment has been minimized.

Member

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

This comment has been minimized.

Contributor

tombuildsstuff commented Feb 16, 2018

@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

This comment has been minimized.

seffyroff commented Feb 16, 2018

@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

This comment has been minimized.

Member

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

This comment has been minimized.

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

This comment has been minimized.

davidebbo commented Mar 15, 2018

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

@naveedaz

This comment has been minimized.

Contributor

naveedaz commented Mar 15, 2018

@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

This comment has been minimized.

Member

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

This comment has been minimized.

Contributor

tombuildsstuff commented Mar 16, 2018

@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

tombuildsstuff commented May 21, 2018

@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

This comment has been minimized.

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment