-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
azurecli classic cert auth's service url picked from endpoint #3256
Conversation
@@ -198,9 +199,9 @@ export class azureclitask { | |||
} | |||
} | |||
|
|||
private static createPublishSettingFile(subscriptionName:string, subscriptionId:string, certificate:string, publishSettingFileName:string): void { | |||
private static createPublishSettingFile(subscriptionName:string, subscriptionId:string, certificate:string, serviceManagementUrl:string, publishSettingFileName:string): void { | |||
//writing the data to the publishsetting file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just verify if serviceManagementUrl can have a terminal slash and if so, will it cause any issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -130,8 +130,9 @@ export class azureclitask { | |||
if (endpointAuth.scheme === "Certificate") { | |||
var bytes = endpointAuth.parameters["certificate"]; | |||
var subscriptionId:string = tl.getEndpointDataParameter(connectedService, "SubscriptionId", true); | |||
var serviceManagementUrl:string = tl.getEndpointUrl(connectedService, false); | |||
const publishSettingFileName:string = path.join(os.tmpdir() ,"subscriptions" + new Date().getTime() + ".publishsettings"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the service endpoint URL always present - even for older endpoints which didn't allow selecting this URL? If not, see if we should fallback to the default URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a default service URL used to be present in older endpoints. so we should be fine.
const publishSettingFileName:string = path.join(os.tmpdir() ,"subscriptions" + new Date().getTime() + ".publishsettings"); | ||
this.createPublishSettingFile(subscriptionName, subscriptionId, bytes, publishSettingFileName); | ||
this.createPublishSettingFile(subscriptionName, subscriptionId, bytes, serviceManagementUrl, publishSettingFileName); | ||
var resultOfToolExecution = tl.execSync("azure", "account import \"" + publishSettingFileName + "\""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UTs for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure that you add UTs to cover the changes.
Azure-CLI classic cert based authentication's Service Management URL will be picked from endpoint.