|
| 1 | +""" |
| 2 | +Copyright (C) Microsoft Corporation. All rights reserved. |
| 3 | + |
| 4 | +Microsoft Corporation (“Microsoft”) grants you a nonexclusive, perpetual, |
| 5 | +royalty-free right to use, copy, and modify the software code provided by us |
| 6 | +("Software Code"). You may not sublicense the Software Code or any use of it |
| 7 | +(except to your affiliates and to vendors to perform work on your behalf) |
| 8 | +through distribution, network access, service agreement, lease, rental, or |
| 9 | +otherwise. This license does not purport to express any claim of ownership over |
| 10 | +data you may have shared with Microsoft in the creation of the Software Code. |
| 11 | +Unless applicable law gives you more rights, Microsoft reserves all other |
| 12 | +rights not expressly granted herein, whether by implication, estoppel or |
| 13 | +otherwise. |
| 14 | + |
| 15 | +THE SOFTWARE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 16 | +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 18 | +MICROSOFT OR ITS LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 19 | +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 20 | +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 21 | +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER |
| 22 | +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 23 | +ARISING IN ANY WAY OUT OF THE USE OF THE SOFTWARE CODE, EVEN IF ADVISED OF THE |
| 24 | +POSSIBILITY OF SUCH DAMAGE. |
| 25 | +""" |
| 26 | + |
| 27 | +import os, json, requests, datetime |
| 28 | +import argparse |
| 29 | +from azureml.core.authentication import AzureCliAuthentication |
| 30 | + |
| 31 | +try: |
| 32 | + with open("aml_config/pipeline_config.json") as f: |
| 33 | + config = json.load(f) |
| 34 | +except: |
| 35 | + print("No pipeline config found") |
| 36 | + sys.exit(0) |
| 37 | + |
| 38 | +# Run a published pipeline |
| 39 | +cli_auth = AzureCliAuthentication() |
| 40 | +aad_token = cli_auth.get_authentication_header() |
| 41 | +rest_endpoint1 = config["rest_endpoint"] |
| 42 | +experiment_name = config["experiment_name"] |
| 43 | +print(rest_endpoint1) |
| 44 | + |
| 45 | +response = requests.post( |
| 46 | + rest_endpoint1, headers=aad_token, json={"ExperimentName": experiment_name} |
| 47 | +) |
| 48 | + |
| 49 | +run_id = response.json()["Id"] |
| 50 | +print(run_id) |
| 51 | +print("Pipeline run initiated") |
0 commit comments