コード例 #1
0
def configure_fd_frontend_endpoint_https(cmd,
                                         resource_group_name,
                                         front_door_name,
                                         frontend_endpoint_name,
                                         disable=None,
                                         protocol=None,
                                         secret_name=None,
                                         secret_version=None,
                                         certificate_type=None,
                                         certificate_source=None,
                                         vault=None):
    if disable:
        return cf_fd_frontend_endpoints(cmd.cli_ctx, None).disable_https(
            resource_group_name, front_door_name, frontend_endpoint_name)
    # if not being disabled, then must be enabled
    from azext_front_door.vendored_sdks.models import CustomHttpsConfiguration, SubResource
    config = CustomHttpsConfiguration(
        certificate_source=certificate_source,
        protocol_type=protocol,
        vault=SubResource(id=vault) if vault else None,
        secret_name=secret_name,
        secret_version=secret_version,
        certificate_type=certificate_type)
    return cf_fd_frontend_endpoints(cmd.cli_ctx,
                                    None).enable_https(resource_group_name,
                                                       front_door_name,
                                                       frontend_endpoint_name,
                                                       config)
コード例 #2
0
def configure_fd_frontend_endpoint_https_frontdoor(cmd, resource_group_name, front_door_name, item_name):
    from azext_front_door.vendored_sdks.models import CustomHttpsConfiguration
    config = CustomHttpsConfiguration(
        certificate_source="FrontDoor",
        protocol_type="ServerNameIndication",
        vault=None,
        secret_name=None,
        secret_version=None,
        certificate_type="Dedicated"
    )
    cf_fd_frontend_endpoints(cmd.cli_ctx, None).enable_https(resource_group_name, front_door_name,
                                                             item_name, config)
    return get_fd_frontend_endpoints(cmd, resource_group_name, front_door_name, item_name)
コード例 #3
0
def configure_fd_frontend_endpoint_https_keyvault(cmd, resource_group_name, front_door_name, item_name,
                                                  vault_id, secret_name, secret_version):
    from azext_front_door.vendored_sdks.models import CustomHttpsConfiguration, SubResource
    config = CustomHttpsConfiguration(
        certificate_source="AzureKeyVault",
        protocol_type="ServerNameIndication",
        vault=SubResource(id=vault_id),
        secret_name=secret_name,
        secret_version=secret_version,
        certificate_type=None
    )
    cf_fd_frontend_endpoints(cmd.cli_ctx, None).enable_https(resource_group_name, front_door_name,
                                                             item_name, config)
    return get_fd_frontend_endpoints(cmd, resource_group_name, front_door_name, item_name)