Skip to content

Conversation

@fore5fire
Copy link
Contributor

@fore5fire fore5fire commented Mar 18, 2020

Adds CDN custom domain BYOC support and fixes CDN-managed certs for Verizon and Microsoft SKUs. Fixes #12152 and #9894.

History Notes:

[CDN] az cdn custom-domain enable-https: Add BYOC support.
[CDN] az cdn custom-domain enable-https: Fix enabling custom HTTPS with CDN managed certificates for Standard_Verizon and Standard_Microsoft SKUs.


This checklist is used to make sure that common guidelines for a pull request are followed.

@yonzhan yonzhan added this to the S167 milestone Mar 19, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 19, 2020

add to S167

@yonzhan yonzhan requested a review from qianwens March 19, 2020 01:53
@fore5fire fore5fire changed the title Add CDN custom domain BYOC support. [CDN] Fixes #12152: Add custom domain BYOC support. Mar 20, 2020
@fore5fire fore5fire force-pushed the cdn/byoc branch 2 times, most recently from 0338ff3 to 1fc1d57 Compare March 21, 2020 02:42
@yonzhan yonzhan modified the milestones: S167, S168 Mar 28, 2020
@fore5fire
Copy link
Contributor Author

Hi again @Juliehzl, what's the timeframe for when I can get a review for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why are there so many recording deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this is due to some change in the cli core, it seems like the authentication request at the beginning of some tests is no longer needed.

@yonzhan
Copy link
Collaborator

yonzhan commented May 2, 2020

add to S169

@mmyyrroonn
Copy link
Contributor

@lsmith130 Could you address the comments so that we can merge this PR to fix issues

@mmyyrroonn
Copy link
Contributor

/azp run Azure.azure-cli

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@fore5fire
Copy link
Contributor Author

@myronfanqiu, I've addressed the comments and CI failures.

Copy link
Contributor

@mmyyrroonn mmyyrroonn left a comment

Choose a reason for hiding this comment

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

LGTM in general except for one question. Wait for @haroldrandom @Juliehzl

arg_group='Bring Your Own Certificate',
help='The protocol type of the certificate.',
arg_type=get_enum_type(['sni', 'ip']))
c.argument('user_cert_subscription_id',
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to support one secret id argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a non-trivial request, as we would need to add extra logic to retrieve the correct resource group name for the secret, which is not included in the secret id because it doesn't use a standard Azure resource id. We would also have to correctly handle permissions issues where the user may not have permission to perform that lookup even though they do have permission to reference the key through CDN. Can we include this later as a separate PR if customers request it?

@yonzhan yonzhan modified the milestones: S169 - For Build, S170 May 16, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented May 16, 2020

add to S170

accept-language:
- en-US
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cdn_domain000001/providers/Microsoft.Cdn/profiles/cdnprofile1?api-version=2019-06-15-preview
Copy link

Choose a reason for hiding this comment

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

This is a get method and a call for profile. So this doesn't match the command you're describing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This profile GET is only part of the setup for the test. If you look below, later requests are actually performing enableCustomHttps POST commands on the custom domains

- en-US
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Cdn/profiles/profile123?api-version=2019-06-15-preview
response:
Copy link

Choose a reason for hiding this comment

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

Same here. This is for a pull request to fix this call and the tests seem off. It's weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Again, the tests must perform required setup before testing the actual area of interest.

Copy link

Choose a reason for hiding this comment

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

Thanks for the explanation. For some reason I assumed these were combined with the other tests considering the setup could be handled in that manor. But this makes it a lot clearer.

My apologies for the comments going a bit to far. The lock-down has put me on edge and frustration got the better of me.

accept-language:
- en-US
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Cdn/profiles/profile123/endpoints/cdn-cli-test-4/customDomains/customdomain000002?api-version=2019-06-15-preview
Copy link

Choose a reason for hiding this comment

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

Why is this happening in multiple places...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This GET request is retrieving the custom domain to verify its status is now correct after the previous POST enableCustomHttps request.

accept-language:
- en-US
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Cdn/profiles/profile123?api-version=2019-06-15-preview
Copy link

Choose a reason for hiding this comment

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

Am I maybe understanding these test wrong or what's the deal.

accept-language:
- en-US
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Cdn/profiles/profile123/endpoints/cdn-cli-test-4/customDomains/customdomain000003?api-version=2019-06-15-preview
Copy link

Choose a reason for hiding this comment

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

Do I need to put this at every enable-https request that has a get method? Because some do use the proper uri en method. So I don't know if it really is a mistake anymore. I think the message is getting through right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above. This is a required part of the test. Since these are not unit tests it is impossible to test only the functionality of interest without making addition setup calls and reading state to verify correct behavior. Please let me know if I have not addressed your concerns in my comments.

@fore5fire
Copy link
Contributor Author

@Juliehzl is it possible to approve this PR? I've addressed all questions and requested changes.

c.argument('location', validator=get_default_location_from_resource_group)

with self.argument_context('cdn custom-domain enable-https') as c:
c.argument('profile_name', id_part=None, help='Name of the parent profile.')
Copy link
Contributor

@Juliehzl Juliehzl May 29, 2020

Choose a reason for hiding this comment

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

Prefer ['--name', '-n' ]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The name_arg_type parameter to the argument custom_domain_name already makes the parameter use --name, -n as requested. See the example for cdn custom-domain enable-https

@yonzhan yonzhan modified the milestones: S170, S171 May 31, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented May 31, 2020

add to S171

@fore5fire
Copy link
Contributor Author

@haroldrandom could you take another look at this PR? I've addressed all comments and I believe it just needs code-owner approval before it can be merged.

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

Successfully merging this pull request may close these issues.

Unable to enable https on custom domain for a CDN endpoint after upgrading to az cli 2.0.81

6 participants