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

New Resource: azurerm_app_service #344

Merged
merged 31 commits into from
Sep 19, 2017
Merged

Conversation

tombuildsstuff
Copy link
Contributor

@tombuildsstuff tombuildsstuff commented Sep 18, 2017

@tombuildsstuff
Copy link
Contributor Author

Tests pass:

screen shot 2017-09-18 at 15 08 27

Copy link
Contributor

@stack72 stack72 left a comment

Choose a reason for hiding this comment

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

@tombuildsstuff this is looking awesome - I left a comments inline for you to think of before it get's merged

One thing I am really not particularly a fan of is these types of validations - just for info, Tom and I spoke on the phone about this so he understands my concerns and I understand his reasoning - it's just nice to let it be known that we have spoken

@@ -0,0 +1,468 @@
package azurerm
Copy link
Contributor

Choose a reason for hiding this comment

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

Really nice to see lots of coverage of import functionality! I think it's usually something that's forgotten about :) So <3 for that!

Type: schema.TypeString,
Optional: true,
Default: "v4.0",
ValidateFunc: validation.StringInSlice([]string{
Copy link
Contributor

Choose a reason for hiding this comment

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

So I am beginning to disagree with validations of this type - by doing this, if Azure release new support, then we need to rerelease the Terraform provider

I am not against it, I just think it limits us - I know it's good for plan time validation but look at what we have to do with diffSuppress

Copy link
Member

Choose a reason for hiding this comment

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

This bit us with another provider so I'd agree with Stack here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given this refers to versions of .net, I don't think this is likely to change often (if at all, now .net core is out), as such I think the validation is safe enough. Submitting v2.0 to the API actually provisions the latest version of .net 2.0 (which is currently .net 3.5.x) and submitting v4.0 uses the latest version of 4.x (currently .net 4.7).

Given this (and any new version of .net being supported being likely to be a big announcement) - I'm going to suggest we leave this in for the moment, until it's proven to be a pain

Type: schema.TypeBool,
Optional: true,
Default: true,
ForceNew: true, // due to a bug in the Azure API :(
Copy link
Contributor

Choose a reason for hiding this comment

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

if there is a bug in the API and this relates to a bug report, it would be nice to link back right here for future ref

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to link to Azure/azure-rest-api-specs#1697

enabled := d.Get("enabled").(bool)
tags := d.Get("tags").(map[string]interface{})

siteConfig := expandAppServiceSiteConfig(d)
Copy link
Contributor

Choose a reason for hiding this comment

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

can this error out? If so, should we try to catch the error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, the schema validation should handle this (so I don't think there's anything needed here)

tags := d.Get("tags").(map[string]interface{})

siteConfig := expandAppServiceSiteConfig(d)
appSettings := expandAppServiceAppSettings(d)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as per siteConfig

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(as above, there's no error thrown here - so not at this time)

return fmt.Errorf("Error updating Connection Strings for App Service %q: %+v", name, err)
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

do any of these need to check to make sure it's Not a new resource?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, they're all applicable here

resp, err := client.Get(resGroup, name)
if err != nil {
if utils.ResponseWasNotFound(resp.Response) {
// TODO: debug logging
Copy link
Contributor

Choose a reason for hiding this comment

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

if it's a to-do, then.... ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated


---

# azurerm\_app\_service
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need the \ - this is a fallacy about markdown :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated


Manages an App Service (within an App Service Plan).

## Example Usage
Copy link
Contributor

Choose a reason for hiding this comment

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

I would really like to see 1 or 2 other example usages here - something maybe a little more complex with a connection_string struct maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated this to be a .net 4.x example with a sql connection string, and added a new java example


* `connection_string` - (Optional) An `connection_string` block as defined below.

* `client_affinity_enabled` - (Optional) TODO: COMPLETE ME. Changing this forces a new resource to be created.
Copy link
Contributor

Choose a reason for hiding this comment

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

/me whistles....

Copy link
Contributor Author

@tombuildsstuff tombuildsstuff Sep 19, 2017

Choose a reason for hiding this comment

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

updated

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.

Agreeing with Stack on quite a few things but other than that it looks really good.

Type: schema.TypeString,
Optional: true,
Default: "v4.0",
ValidateFunc: validation.StringInSlice([]string{
Copy link
Member

Choose a reason for hiding this comment

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

This bit us with another provider so I'd agree with Stack here


* `client_affinity_enabled` - (Optional) TODO: COMPLETE ME. Changing this forces a new resource to be created.

* `enabled` - (Optional) TODO: COMPLETE ME. Changing this forces a new resource to be created.
Copy link
Member

Choose a reason for hiding this comment

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

Here too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@tombuildsstuff
Copy link
Contributor Author

Updated - tests still pass:

screen shot 2017-09-19 at 17 34 03

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.

LGTM!

@tombuildsstuff tombuildsstuff merged commit 5979359 into master Sep 19, 2017
tombuildsstuff added a commit that referenced this pull request Sep 19, 2017
@elemantalcode
Copy link

If I could add more +1 or +<3 I would... thank you!!!

@tombuildsstuff tombuildsstuff deleted the azurerm/app-service-resource branch October 2, 2017 12:28
@pixelicous
Copy link

@tombuildsstuff can we add support for msi, custom domain name, support for https only etc?

Currently i need to do that through arm template.. but i get "ttlInSeconds object is not present in the request body"

@tombuildsstuff
Copy link
Contributor Author

@pixelicous

can we add support for msi, custom domain name, support for https only etc?

Issue #756 is tracking the feature request for these items - which we're hoping to look into in the near future.

"ttlInSeconds object is not present in the request body

Unfortunately this is a bug in the Swagger/API which has been raised with Microsoft/Azure here: Azure/azure-rest-api-specs#1697

@pixelicous
Copy link

@tombuildsstuff thank you! i actually manage to get around the msi problem with an arm template, i had a problem getting the identity.principalid though, that made me get stuck because spns cannot be created using arm template, and using powershell with external provider is just ugly code, you need to export profile of spn, and use it, and remove it.. becomes very ugly.

On another note, Tom i was wondering if you can shade some light, i have been in a couple of hashicorp/ms conferences and they speak about the great cooperation between the companies. now this has been said for months on end now, still, not much change on the azurerm provider.. it seems like you are the only one working on it, and in terms of module registries, well aws has around 200 while azure has around 20, so whats the gig.. what is the workforce behind this provider.. this is very lagging behind to the point that i am thinking of finding another tool to get the job done

thanks man, hopefully you could provide some answer for this, and sorry for hijacking the reply 😋

@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
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.

Azure web app deployment
6 participants