11/*
22 * Azure Pipelines Azure Datafactory Delete Items Task
3- *
3+ *
44 * Copyright (c) 2020 Jan Pieter Posthuma / DataScenarios
5- *
5+ *
66 * All rights reserved.
7- *
7+ *
88 * MIT License.
9- *
9+ *
1010 * Permission is hereby granted, free of charge, to any person obtaining a copy
1111 * of this software and associated documentation files (the "Software"), to deal
1212 * in the Software without restriction, including without limitation the rights
1313 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1414 * copies of the Software, and to permit persons to whom the Software is
1515 * furnished to do so, subject to the following conditions:
16- *
16+ *
1717 * The above copyright notice and this permission notice shall be included in
1818 * all copies or substantial portions of the Software.
19- *
19+ *
2020 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2121 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2222 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2626 * THE SOFTWARE.
2727 */
2828
29- import * as task from ' azure-pipelines-task-lib/task' ;
29+ import * as task from " azure-pipelines-task-lib/task" ;
3030
3131export class AzureModels {
32-
3332 private connectedServiceName : string ;
3433 private subscriptionId : string ;
3534 private subscriptionName : string ;
@@ -42,25 +41,41 @@ export class AzureModels {
4241 constructor ( connectedServiceName : string ) {
4342 try {
4443 this . connectedServiceName = connectedServiceName ;
45- if ( this . connectedServiceName === 'local' ) { // local debug
46- this . subscriptionId = task . getInput ( 'subscriptionid' , true ) ;
47- this . subscriptionName = task . getInput ( 'subscriptionname' , true ) ;
48- this . servicePrincipalClientId = task . getInput ( 'serviceprincipalid' , true ) ;
49- this . servicePrincipalKey = task . getInput ( 'serviceprincipalkey' , true ) ;
50- this . environmentAuthorityUrl = task . getInput ( 'environmentAuthorityUrl' , true ) ;
51- this . tenantId = task . getInput ( 'tenantid' , true ) ;
52- this . url = task . getInput ( 'connectedServiceNameUrl' , true ) ;
44+ if ( this . connectedServiceName === "local" ) {
45+ // local debug
46+ this . subscriptionId = task . getInput ( "subscriptionid" , true ) ;
47+ this . subscriptionName = task . getInput ( "subscriptionname" , true ) ;
48+ this . servicePrincipalClientId = task . getInput ( "serviceprincipalid" , true ) ;
49+ this . servicePrincipalKey = task . getInput ( "serviceprincipalkey" , true ) ;
50+ this . environmentAuthorityUrl = task . getInput ( "environmentAuthorityUrl" , true ) ;
51+ this . tenantId = task . getInput ( "tenantid" , true ) ;
52+ this . url = task . getInput ( "connectedServiceNameUrl" , true ) ;
5353 } else {
54- this . subscriptionId = task . getEndpointDataParameter ( this . connectedServiceName , 'subscriptionid' , true ) ;
55- this . subscriptionName = task . getEndpointDataParameter ( this . connectedServiceName , 'subscriptionname' , true ) ;
56- this . servicePrincipalClientId = task . getEndpointAuthorizationParameter ( this . connectedServiceName , 'serviceprincipalid' , true ) ;
57- this . servicePrincipalKey = task . getEndpointAuthorizationParameter ( this . connectedServiceName , 'serviceprincipalkey' , true ) ;
58- this . environmentAuthorityUrl = task . getEndpointDataParameter ( this . connectedServiceName , 'environmentAuthorityUrl' , true ) ;
59- this . tenantId = task . getEndpointAuthorizationParameter ( this . connectedServiceName , 'tenantid' , false ) ;
54+ this . subscriptionId = task . getEndpointDataParameter ( this . connectedServiceName , "subscriptionid" , true ) ;
55+ this . subscriptionName = task . getEndpointDataParameter (
56+ this . connectedServiceName ,
57+ "subscriptionname" ,
58+ true
59+ ) ;
60+ this . servicePrincipalClientId = task . getEndpointAuthorizationParameter (
61+ this . connectedServiceName ,
62+ "serviceprincipalid" ,
63+ true
64+ ) ;
65+ this . servicePrincipalKey = task . getEndpointAuthorizationParameter (
66+ this . connectedServiceName ,
67+ "serviceprincipalkey" ,
68+ true
69+ ) ;
70+ this . environmentAuthorityUrl = task . getEndpointDataParameter (
71+ this . connectedServiceName ,
72+ "environmentAuthorityUrl" ,
73+ true
74+ ) ;
75+ this . tenantId = task . getEndpointAuthorizationParameter ( this . connectedServiceName , "tenantid" , false ) ;
6076 this . url = task . getEndpointUrl ( this . connectedServiceName , true ) ;
6177 }
62- }
63- catch ( err ) {
78+ } catch ( err ) {
6479 throw new Error ( task . loc ( "AzureModels_ConstructorFailed" , err . message ) ) ;
6580 }
6681 }
@@ -92,4 +107,4 @@ export class AzureModels {
92107 public getUrl ( ) : string {
93108 return this . url ;
94109 }
95- }
110+ }
0 commit comments