-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add support for Azure #89
Comments
I am a member of Azure group and I am also thinking about this these days. I wonder what kind of features are important and thus really needed. |
Hi @foreverXZC! Good question :) I suspect many of the same utilities we have in the aws package would be useful, such as functions to make it easier to work with authentication, regions, machine images, logging, user accounts, and so on. |
Hi folks - thanks for introducing the Terratest tool! Have there been any updates on this issue? Azure support would be a great addition for those working with Azure. |
I know some teams using Azure are using Terratest for testing... But no one has contributed any PRs back yet. We would very much welcome that :) |
@brikis98 - thanks for the quick reply! So to use Azure, one would need to write the go code in their tests to talk with Azure, or develop their own helper library, correct? |
You'd write a library of helpers similar to the aws helpers, but focused on authenticating to Azure and calling various services you're testing. You'd then use your helpers to test your Azure code. |
I'm contributing back some relevant work. See #332 |
@nmiodice Would love to work with you on this, as I wrote the beginnings of one as well. I was going to open a PR later tonight! My work is laid out a little differently than yours, so I might open a PR as well just to get the mainters' thoughts on how we could come together on approach. |
@drmmarsunited Absolutely. Looking through your PR I like the approach you took with the authorizer as it is more robust and works with non-service principal use cases. Other than that, these look very compatible. I suggest that we get one merged (either one) and then we can work off of that common base. Thank you for putting this PR up, and it is too funny that we did it within an hour of each other! OSS community hard at work :) |
@nmiodice and @drmmarsunited Thank you both for the Azure PRs! Love seeing support for another cloud 👍 Any thoughts on how you'd like to merge your two approaches together? |
@brikis98 - We could pretty easily merge our code bases. My only concern with the approach that @nmiodice took, is that it's too focused on creating clients. On one hand, that pretty closely aligns with the how the Azure Go SDK itself works, but for testing purposes, I'd prefer to see targeted, specific, and prescriptive methods, much like the AWS module. As someone who will immediately be a consumer of this module for my team and other teams in the business here, I'd like to see the style/approach to these modules follow as closely as possible. It makes the developer experience pretty seamless, and that would be a big win, instead of having to learn a different pattern for each cloud provider's module. |
I spent a day trying to build some Azure functions and dealing with all of the Azure SDK Clients creation was off-putting. Hiding that tedium would be very appreciated as a possible user. |
Agreed on maintaining a common style for Terratest with prescriptive methods. That said, @nmiodice, wasn't your PR just one of several planned ones? Are the follow-up PRs similar in style to what @drmmarsunited is mentioning? |
@brikis98 Not to be nagging on you guys, but this initiative is super important to the teams here (and I hope to the larger community). Can we time box the feedback window here? I'm ready to start contributing more helper methods to the Azure module to enable my teams. I'm totally game to work with @nmiodice, but I want to keep the ball rolling and not get stalled. |
Agreed on not holding it up too long. @nmiodice Let me know your thoughts. If we don't hear back in a day or two, we'll roll forward and hopefully you can add your contributions later on. |
OK, moving forward with @drmmarsunited's PR. |
Following the work that @drmmarsunited has done to introduce Azure support, I would like to contribute coverage for network-related resources in the
Should I open a separate issue regarding Azure networking resources ? |
I don't think any of the Azure PRs were ever completed... So I think we still need a base PR! |
@brikis98 mine was merged a while back. |
@drmmarsunited Ah, I'm sorry, you're right, I was thinking of #332. |
As Terratest has grown, we've had to think more about what types of helper functions we want in the library to make sure it doesn't become so big as to be unusable. Please check out our contribution guidelines, especially the part about infrastructure and validation helpers. Specifically, to decide if we want to add something like this to terratest, we need to pass four tests:
I think this passes the litmus test for "platforms" and "popularity", but I am unsure about "complexity" and "creating infrastructure". Since I don't have experience with the Azure SDK, it is hard for me to gauge the potential test functions here. Can you share some more details on some of the APIs you would like to support, their use cases, and what makes it hard about using the SDK directly such that terratest wrappers would be beneficial? PS: Thanks for writing about terragrunt and terratest in Japanese! 全部読んでます! |
Thank you for your comment, @yorinasub17 I'm planning to create some validation helper methods. It doesn't create/delete infrastructure, just validate the deployment of the resource. It is something like this code without Create/Update/Delete method. https://github.com/gruntwork-io/terratest/blob/master/modules/aws/ecs.go I might add retry feature since aks resource creation takes time to up and running. When I'm writing the code of terratest with aks and my original test helper, it required to wait until the resource is being ready. The method I'm gonna use is Test will be something like this. Just validate if the cluster is now up and running. https://github.com/gruntwork-io/terratest/blob/master/test/terraform_azure_example_test.go In addition of retrying, in case of Azure, Just calling get method of Azure SDK for go might be difficult for many Azure users. Not very difficult, however, a lot of Azure users doesn't familiar with go coding. The Azure SDK for go documentation is not rich. There is no documentation/example for AKS resource. Reference is also not rich. :( https://godoc.org/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-11-01/containerservice Users need to read through the code of the repo, find resources, authenticate it,... something like that required. AKS is a managed service of kubernetes. One of the top usage of terraform. After accepting this contribution, if it doesn't take long time, I'll keep on contributing several resources on Azure. (these are also validation helper methods.) I have an actual workload for my customer. I believe, it helps to include more Azure users for terratest. P.S. Thank you for reading my blog post, I'll keep on posting it. I just love your product. ;) ありがとうございます! |
Thanks for the feedback. I am investigating options and will get back shortly. |
Okay, great! |
Hey everyone, I am also looking at contributing to the Azure part of Terratest. We recently discovered this and love it. At present, we are mostly a .Net shop with a couple of people dipping their toes into Go. What @TsuyoshiUshio said in his Jan 15th post about limited Go knowledge and documentation around the API, having wrapper methods here for Azure validation would be helpful. While I am not an employee of Microsoft, I have spent the last 3 years working in Azure and went from ARM templates, to Azure CLI, to using Terraform with Terratest. I have been looking for a project to support and this one really excites me and would love to help in this space around Azure. I would be open to helping lead, review, and maintain the quality of Azure features of Terratest. In regards to automated testing, there are many services that have free tiers that we can make sure the automated tests are using to validate these. For all the module validations I am doing for Alaska Airlines, I have a single Resource Group and Service Principal created to apply and destroy terrafrom against. I also have a nightly job that blows away anything in that resource group in case something went wrong during the tests so I don't have resources living longer than they should. I will keep my eyes on the cost of our solution and can provide some data if that will help. I plan on adding the app service plan, web app, function app, auto scaling, alerting, app insights, and action group suite that is generally used together when creating PaaS web apps. We also have plans for Redis, CosmsoDB, SQL Server, Service Bus, Event Grid, Event Hub, Key Vault, and Resource Groups. |
@tsalright Thanks for the interest! We're discussing this internally with the team and will get back to you on this. |
gruntworks team, I have a proposal for moving forward. Would it be possible to have a discussion of which the outcome we can post back into this issue? You can reach me at rguthrie at microsoft dot com of which I can outline our thinking? We would love to imrpove the azure support and @tsalright happy to work together if we can find a good solution for accepting PRs. |
@rguthriemsft Just sent you an email! |
@robmorgan @yorinasub17 Have you thought about adding some additional tags to the issues to identify |
@tsalright we already have one for GCP, but I guess we could for the other packages. @yorinasub17 any preferences? |
UPDATE: we're in talks with @rguthriemsft and have a call scheduled next week. Once agreed on a plan forward, we'll post the notes here. @tsalright , we appreciate your help! We'll be following up with you once we figure out our plans going forward with Microsoft, hopefully by end of week next week.
I think this is a good idea! We haven't done a good job with tagging even though we have the gcp label... I think we can do this going forward, but we don't quite have the bandwidth to go through old issues and label things at the moment. EDIT: just created the labels |
Oh also, forgot to mention that we will continue to welcome feedback from anyone in the community no matter how the call turns out with MS. We hope to work with MS to set up some basic scaffolding to make maintenance easier, but we are eager to get help from the community on PRs, issues, etc. |
Update for everyone: We are starting to do some work around setting up proper CI / CD for Terratest with Azure. We can't share any details or timelines right now, but just wanted to give you all a heads up that we haven't forgotten about this! |
Also, I just tagged a number of issues/PRs with the Azure label. We'll come back to those when the work mentioned in my comment above has been completed. |
Just a quick update to the Terratest Azure community. We are working on getting the pipeline up and running to start processing the Azure PRs that are out there. We are in the testing and validating phase of it. We will have an update in another week or two. |
@brikis98 / @yorinasub17 I think we can consider this issue resolved and would like to just add a link to the Developing for Azure as well as the examples. Thoughts? |
Sounds good to me! I'll mark this ticket as resolved. |
Terratest has an aws package with a number of utilities useful for AWS. It would be great to add similar utilities for testing code in Azure.
The text was updated successfully, but these errors were encountered: