-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
azurerm/resource_arm_app_service.go
Outdated
Type: schema.TypeBool, | ||
Optional: true, | ||
Default: true, | ||
ForceNew: true, // due to a bug in the Azure API :( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
azurerm/resource_arm_app_service.go
Outdated
tags := d.Get("tags").(map[string]interface{}) | ||
|
||
siteConfig := expandAppServiceSiteConfig(d) | ||
appSettings := expandAppServiceAppSettings(d) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
azurerm/resource_arm_app_service.go
Outdated
resp, err := client.Get(resGroup, name) | ||
if err != nil { | ||
if utils.ResponseWasNotFound(resp.Response) { | ||
// TODO: debug logging |
There was a problem hiding this comment.
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.... ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
|
||
--- | ||
|
||
# azurerm\_app\_service |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/me whistles....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
c58554b
to
978c976
Compare
There was a problem hiding this 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{ |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
3822292
to
50f1a06
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
If I could add more +1 or +<3 I would... thank you!!! |
@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" |
Issue #756 is tracking the feature request for these items - which we're hoping to look into in the near future.
Unfortunately this is a bug in the Swagger/API which has been raised with Microsoft/Azure here: Azure/azure-rest-api-specs#1697 |
@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 😋 |
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! |
This PR extends the work done by @lstolyarov in #2 to support provisioning App Services within an App Service Plan.
There's a couple of limitations with this PR due to API issues (which I'll open Rest API Specs issues about shortly):
client_affinity_enabled
,enabled
andtags
- as the Update endpoint has issues - such I've made themForceNew
for the momentFixes #35