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

[App Service] az functionapp/logicapp create: Add new --https-only parameter #23213

Merged
merged 17 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def default_api_version(self):
'subscription_diagnostic_settings': '2017-05-01-preview'
}),
ResourceType.MGMT_MSI: '2021-09-30-preview',
ResourceType.MGMT_APPSERVICE: '2021-03-01',
ResourceType.MGMT_APPSERVICE: '2022-03-01',
ResourceType.MGMT_IOTHUB: '2021-07-02',
ResourceType.MGMT_IOTDPS: '2021-10-15',
ResourceType.MGMT_IOTCENTRAL: '2021-11-01-preview',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def create_domain(cmd, resource_group_name, hostname, contact_info, privacy=True
except:
raise CLIError("Unable to get IP address")

web_client = web_client_factory(cmd.cli_ctx)
# TODO remove api_version when Microsoft.DomainRegistration supports a later version
web_client = web_client_factory(cmd.cli_ctx, api_version="2021-01-15")
hostname_availability = web_client.domains.check_availability(NameIdentifier(name=hostname))
StrawnSC marked this conversation as resolved.
Show resolved Hide resolved

if not hostname_availability.available:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2670,7 +2670,8 @@ def delete_ssl_cert(cmd, resource_group_name, certificate_thumbprint):

def import_ssl_cert(cmd, resource_group_name, name, key_vault, key_vault_certificate_name):
Certificate = cmd.get_models('Certificate')
client = web_client_factory(cmd.cli_ctx)
# TODO remove api_version when Microsoft.CertificateRegistration supports a later version
client = web_client_factory(cmd.cli_ctx, api_version="2021-01-15")
Copy link
Contributor

@zhoxing-ms zhoxing-ms Jul 25, 2022

Choose a reason for hiding this comment

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

@StrawnSC May I ask why Microsoft.DomainRegistration and Microsoft.CertificateRegistration don't support the new api-version as ResourceType.MGMT_APPSERVICE?
If the supported api-version between them and ResourceType.MGMT_APPSERVICE are independent of each other, I suggest setting the sub configurations for them separately in the _shared.py, just like

ResourceType.MGMT_COMPUTE: SDKProfile('2022-03-01', {
'resource_skus': '2019-04-01',
'disks': '2022-03-02',
'disk_encryption_sets': '2022-03-02',
'disk_accesses': '2020-05-01',
'snapshots': '2021-12-01',
'galleries': '2021-10-01',
'gallery_images': '2021-10-01',
'gallery_image_versions': '2021-10-01',
'gallery_applications': '2021-07-01',
'gallery_application_versions': '2022-01-03',
'shared_galleries': '2022-01-03',
'virtual_machine_scale_sets': '2022-03-01',
}),

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 App Service certs and domains back end team just released the new API version, so I just removed all the places where I was hardcoding the API version in the client

Copy link
Contributor

Choose a reason for hiding this comment

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

@StrawnSC May I ask why Microsoft.DomainRegistration and Microsoft.CertificateRegistration don't support the new api-version as ResourceType.MGMT_APPSERVICE? If the supported api-version between them and ResourceType.MGMT_APPSERVICE are independent of each other, I suggest setting the sub configurations for them separately in the _shared.py, just like

ResourceType.MGMT_COMPUTE: SDKProfile('2022-03-01', {
'resource_skus': '2019-04-01',
'disks': '2022-03-02',
'disk_encryption_sets': '2022-03-02',
'disk_accesses': '2020-05-01',
'snapshots': '2021-12-01',
'galleries': '2021-10-01',
'gallery_images': '2021-10-01',
'gallery_image_versions': '2021-10-01',
'gallery_applications': '2021-07-01',
'gallery_application_versions': '2022-01-03',
'shared_galleries': '2022-01-03',
'virtual_machine_scale_sets': '2022-03-01',
}),

@zhoxing-ms this was a temporary change, while we were waiting on ARM manifest update for the new API version to complete across all locations & get the initial code review unblocked.

webapp = client.web_apps.get(resource_group_name, name)
if not webapp:
raise ResourceNotFoundError("'{}' app doesn't exist in resource group {}".format(name, resource_group_name))
Expand Down Expand Up @@ -2709,8 +2710,10 @@ def import_ssl_cert(cmd, resource_group_name, name, key_vault, key_vault_certifi
subscription_id = get_subscription_id(cmd.cli_ctx)
if cloud_type.lower() == PUBLIC_CLOUD.lower():
if kv_subscription.lower() != subscription_id.lower():
# TODO remove api_version when Microsoft.CertificateRegistration supports a later version
diff_subscription_client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_APPSERVICE,
subscription_id=kv_subscription)
subscription_id=kv_subscription,
api_version="2021-01-15")
ascs = diff_subscription_client.app_service_certificate_orders.list()
else:
ascs = client.app_service_certificate_orders.list()
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ interactions:
ParameterSetName:
- -g --hostname --contact-info --dryrun
User-Agent:
- AZURECLI/2.33.1 azsdk-python-azure-mgmt-web/6.1.0 Python/3.8.2 (macOS-10.16-x86_64-i386-64bit)
- AZURECLI/2.38.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.4-x86_64-i386-64bit)
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DomainRegistration/checkDomainAvailability?api-version=2021-03-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DomainRegistration/checkDomainAvailability?api-version=2021-01-15
response:
body:
string: '{"name":"testuniquedomainname1.com","available":true,"domainType":"Regular"}'
Expand All @@ -31,7 +31,7 @@ interactions:
content-type:
- application/json
date:
- Thu, 24 Feb 2022 19:39:00 GMT
- Mon, 18 Jul 2022 22:14:29 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -73,9 +73,9 @@ interactions:
ParameterSetName:
- -g --hostname --contact-info --dryrun
User-Agent:
- AZURECLI/2.33.1 azsdk-python-azure-mgmt-web/6.1.0 Python/3.8.2 (macOS-10.16-x86_64-i386-64bit)
- AZURECLI/2.38.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.4-x86_64-i386-64bit)
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DomainRegistration/topLevelDomains/com/listAgreements?api-version=2021-03-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DomainRegistration/topLevelDomains/com/listAgreements?api-version=2021-01-15
response:
body:
string: "{\"value\":[{\"agreementKey\":\"DNRA\",\"title\":\"Domain Registration
Expand All @@ -88,7 +88,7 @@ interactions:
id=\\\"id-6de81dbb-6ddc-4107-a4fd-86de2b44f601\\\" class=\\\"vsc-legal-content-module\\\"
>\\r\\n <div class=\\\"lcm-title\\\">\\r\\n <strong><span class=\\\"h5\\\">Azure
- DOMAIN NAME REGISTRATION AGREEMENT</span></strong>\\r\\n </div>\\r\\n <div
class=\\\"lcm-subtitle\\\">\\r\\n <strong>Last Revised: 1/28/2022</strong>\\r\\n
class=\\\"lcm-subtitle\\\">\\r\\n <strong>Last Revised: 4/5/2022</strong>\\r\\n
\ </div>\\r\\n <strong><strong>PLEASE READ THIS AGREEMENT CAREFULLY,
AS IT CONTAINS IMPORTANT INFORMATION REGARDING YOUR LEGAL RIGHTS AND REMEDIES.</strong></strong>\\r\\n\\r\\n
\ <p></p>\\r\\n <strong><strong>1. OVERVIEW</strong></strong>\\r\\n\\r\\n
Expand Down Expand Up @@ -141,12 +141,12 @@ interactions:
below in this Section 2 are generally applicable to all TLDs that we offer.
\ Special provisions specific to any TLD or ccTLD (those in addition to posted
Registry Policies) are identified elsewhere below in this Agreement.</em>
\ \\r</p>\\n<p><ol>\\r\\n<li><em><u>Registry Policies.</u></em> You agree
to be bound by all Registry Policies (defined above in this Agreement) applicable
\ \\r</p>\\n<p><ol><li><em><u>Registry Policies.</u></em> You agree to be
bound by all Registry Policies (defined above in this Agreement) applicable
to your domain name registration (at any level). IT IS YOUR RESPONSIBILITY
TO VISIT THE APPLICABLE TLD SITE AND READ AND REVIEW ALL APPLICABLE REGISTRY
POLICIES PRIOR TO YOUR REGISTRATION IN THE TLD. REGISTRY POLICIES FOR EACH
TLD CAN BE FOUND BY VISITING THE CORRESPONDING TLD LINK LISTED <a href=\\\"\\r\\n/legal/agreements/tld-registry-policies\\\">HERE</a>.
TLD CAN BE FOUND BY VISITING THE CORRESPONDING TLD LINK LISTED<a href=\\\"https://www.secureserver.net/legal/agreements/tld-registry-policies?prog_id=510456&pl_id=510456&plid=510456\\\">HERE</a>.
Notwithstanding anything in this Agreement to the contrary, the Registry Operator
of the TLD in which the domain name registration is made is and shall be an
intended third party beneficiary of this Agreement. As such the parties to
Expand Down Expand Up @@ -447,15 +447,15 @@ interactions:
publication, modification and other processing for the purpose of administration
of the domain name registration, which may require such information be transferred
back and forth across international borders, to and from the U.S. to the EU,
for example. As required by ICANN or for certain ccTLDs (.am, .com.au, .net.au,
.org.au, .ca, .cz, .fr, .it, .jp, .co.jp, .kr, .co.kr, .ne.kr, .re.kr, .no,
.co.nz, .net.nz, .org.nz, .vg, .se, .so, .sg, .com.sg, .tw, .com.tw, .net.tw,
.org.tw, .uk, .co.uk, .me.uk, .org.uk, .us), this information may be made
publicly available by the registry operator via Whois or its successor protocol
(collectively referred to as the \u201CWhois&quot; Directory) that is beyond,
and not subject to, Azure's control.</p>\\n<p>Both Azure and the registry
operator may be required to archive this information with a third-party escrow
service. You hereby consent and give permission for all such requirements
for example. As required by ICANN or for certain ccTLDs (.am, .au, .com.au,
.net.au, .org.au, .ca, .cz, .fr, .it, .jp, .co.jp, .kr, .co.kr, .ne.kr, .re.kr,
.no, .co.nz, .net.nz, .org.nz, .vg, .se, .so, .sg, .com.sg, .tw, .com.tw,
.net.tw, .org.tw, .uk, .co.uk, .me.uk, .org.uk, .us), this information may
be made publicly available by the registry operator via Whois or its successor
protocol (collectively referred to as the \u201CWhois&quot; Directory) that
is beyond, and not subject to, Azure's control.</p>\\n<p>Both Azure and the
registry operator may be required to archive this information with a third-party
escrow service. You hereby consent and give permission for all such requirements
and disclosures. Further, you represent and warrant that, if you are providing
information about a third party, you have notified the third party of the
disclosure and the purpose for the disclosure and you have obtained the third
Expand Down Expand Up @@ -1145,15 +1145,16 @@ interactions:
to, agreeing to indemnify the ccTLD provider, limiting the liability of the
ccTLD provider, and requirements that any disputes be resolved under that
particular country's laws.</p>\\n<p><strong><em>(A) PROVISIONS SPECIFIC TO
.AU REGISTRATIONS</em></strong><br />\\n.au Registrations (to include com.au,
net.au and org.au) are governed by the following additional terms and conditions:</p>\\n<p><u>auDA</u>.
\ auDA means .au Domain Administration Limited ACN 079 009 340, the .au domain
names administrator. The Registrar acts as agent for auDA for the sole purpose,
but only to the extent necessary, to enable auDA to receive the benefit of
rights and covenants conferred to it under this Agreement. auDA is an intended
third party beneficiary of this agreement.<br />\\n<br />\\n<u>auDA Published
Policy</u>. auDA Published Policies means those specifications and policies
established and published by auDA from time to time at <a href=\\\"https://www.auda.org.au\\\">https://www.auda.org.au</a>.
.AU REGISTRATIONS</em></strong><br />\\n.au Registrations (to include .au,
com.au, net.au and org.au) are governed by the following additional terms
and conditions:</p>\\n<p><u>auDA</u>. auDA means .au Domain Administration
Limited ACN 079 009 340, the .au domain names administrator. The Registrar
acts as agent for auDA for the sole purpose, but only to the extent necessary,
to enable auDA to receive the benefit of rights and covenants conferred to
it under this Agreement. auDA is an intended third party beneficiary of this
agreement.<br />\\n<br />\\n<u>auDA Published Policy</u>. auDA Published
Policies means those specifications and policies established and published
by auDA from time to time at <a href=\\\"https://www.auda.org.au\\\">https://www.auda.org.au</a>.
\ You must comply with all auDA Published Policies, as if they were incorporated
into, and form part of, this Agreement. In the event of any inconsistency
between any auDA Published Policy and this Agreement, then the auDA Published
Expand Down Expand Up @@ -1272,7 +1273,7 @@ interactions:
id=\\\"id-fc86ff53-d1e8-4ffa-8551-77fd27f0b3ce\\\" class=\\\"vsc-legal-content-module\\\"
>\\r\\n <div class=\\\"lcm-title\\\">\\r\\n <span class=\\\"h5\\\">Azure
- DOMAINS BY PROXY - DOMAIN NAME PROXY AGREEMENT</span>\\r\\n </div>\\r\\n
\ <div class=\\\"lcm-subtitle\\\">\\r\\n Last Revised: 8/12/2021 \\r\\n
\ <div class=\\\"lcm-subtitle\\\">\\r\\n Last Revised: 6/6/2022\\r\\n
\ </div>\\r\\n\\r\\n <p><p>Please read this Domain Name Proxy Agreement
(&quot;Agreement&quot;) carefully. By using the Services and/or website of
Domains By Proxy, LLC, a Delaware limited liability company (&quot;DBP&quot;),
Expand All @@ -1295,8 +1296,8 @@ interactions:
and agree to be bound by all the terms and conditions of this Agreement, and
You further agree to be bound by the terms of this Agreement for transactions
entered into by: \\r</p>\\n<ol type=i>\\r\\n<li>You on Your behalf;</li>
\ \\r\\n<li> Anyone acting as Yor agent; and</li> \\r\\n<li>Anyone who uses
the account You have established with DBP, whether or not the transactions
\ \\r\\n<li> Anyone acting as Your agent; and</li> \\r\\n<li>Anyone who
uses the account You have established with DBP, whether or not the transactions
were on Your behalf and/or authorized by You.</li>\\r\\n</ol>\\r\\n<p>You
agree You will be bound by representations made by third parties acting on
Your behalf, which either use or purchase services from DBP. You further agree
Expand Down Expand Up @@ -1365,9 +1366,9 @@ interactions:
(as that term is defined below) in instances when DBP services are added to
or cancelled from your domain name and for the purpose of facilitating a change
of registrant request (as further described below).</li><li>As required by
ICANN or for certain ccTLDs (.ag, .am, .at, .be, .ca, .cl, .cn, .de, .dk,
.es, .fi, .fm, .fr, .gg, .gr, .gs, .in, .it, .jp, .kr, .ms, .my, .no, .nu,
.ph, .pl, .pt, .ru, .sc, .se, .sg, .tc, .tk, .tw, .us, .vg, .co.nz, .net.nz,
ICANN or for certain ccTLDs (.ag, .am, .at, .au, .be, .ca, .cl, .cn, .de,
.dk, .es, .fi, .fm, .fr, .gg, .gr, .gs, .in, .it, .jp, .kr, .ms, .my, .no,
.nu, .ph, .pl, .pt, .ru, .sc, .se, .sg, .tc, .tk, .tw, .us, .vg, .co.nz, .net.nz,
.org.nz, .com.tw, .org.tw, .idv.tw, .com.cn, .net.cn, .org.cn, .jobs, .eu,
.com.ag, .net.ag, .org.ag, .com.pl, .net.pl, .org.pl, .biz.pl, .info.pl, .com.sc,
.net.sc, .org.sc, .com.au, .net.au, .com.br, .co.jp, .com.sg, .com.ph, .co.za,
Expand Down Expand Up @@ -1661,11 +1662,11 @@ interactions:
cache-control:
- no-cache
content-length:
- '124198'
- '124269'
content-type:
- application/json
date:
- Thu, 24 Feb 2022 19:39:01 GMT
- Mon, 18 Jul 2022 22:14:30 GMT
expires:
- '-1'
pragma:
Expand Down
Loading