Add comments

This commit is contained in:
Joel Lopes 2019-02-21 18:12:57 -08:00
parent 1c030cb54b
commit c8a60c77d1
1 changed files with 4 additions and 0 deletions

View File

@ -59,6 +59,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
b.ctxCancel = cancel
defer cancel()
// User's intent to use MSI is indicated with empty subscription id, tenant, client id, client cert, client secret and jwt.
// FillParameters function will set subscription and tenant id here. Therefore getServicePrincipalTokens won't select right auth type.
// If we run this after getServicePrincipalTokens call then getServicePrincipalTokens won't have tenant id.
if !b.config.useMSI() {
if err := newConfigRetriever().FillParameters(b.config); err != nil {
return nil, err
@ -76,6 +79,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
return nil, err
}
// We need subscription id and tenant id for arm operations. Users hasn't specified one so we try to detect them here.
if b.config.useMSI() {
if err := newConfigRetriever().FillParameters(b.config); err != nil {
return nil, err