microsoft / powerplatform-build-tools

Power Platform Build Tools automate common build and deployment tasks related to Power Platform. This includes synchronization of solution metadata (a.k.a. solutions) between development environments and source control, generating build artifacts, deploying to downstream environments, provisioning/de-provisioning of environments, and the ability to perform static analysis checks against your solution using the PowerApps checker service.
MIT License
184 stars 38 forks source link

InstallApplication@2 not loading the authentication profiles. #422

Closed omnisip closed 1 year ago

omnisip commented 1 year ago

My team thinks this issue started yesterday or the day before. I can't tell myself.

See logs I've put a WhoAmI which properly gets the auth profile vs. InstallApplication.

Pipeline tasks

    - task: PowerPlatformWhoAmi@2
      inputs:
        authenticationType: 'PowerPlatformSPN'
        PowerPlatformSPN: $(serviceConnection)
        Environment: '${{ parameters.environment }}'
    - task: PowerPlatformInstallApplication@2
      inputs:
        authenticationType: 'PowerPlatformSPN'
        PowerPlatformSPN: $(serviceConnection)
        Environment: '${{ parameters.environment }}'
        ApplicationList: '$(Build.SourcesDirectory)/.azure-pipelines/apps.json'

Contents of apps.json

[
  {
    "ApplicationId": "7484ff7e-7b48-4016-9c6f-a1ffaa90c0ac",
    "FriendlyName": "Adobe Acrobat Sign for Microsoft Dynamics 365",
    "UniqueName": "AdobeSign"
  }
]

WhoAmI output

2023-07-19T21:48:45.2701465Z ##[debug]Evaluating condition for step: 'PowerPlatformWhoAmi'
2023-07-19T21:48:45.2701987Z ##[debug]Evaluating: SucceededNode()
2023-07-19T21:48:45.2702175Z ##[debug]Evaluating SucceededNode:
2023-07-19T21:48:45.2702493Z ##[debug]=> True
2023-07-19T21:48:45.2702706Z ##[debug]Result: True
2023-07-19T21:48:45.2702916Z ##[section]Starting: PowerPlatformWhoAmi
2023-07-19T21:48:45.2706056Z ==============================================================================
2023-07-19T21:48:45.2706168Z Task         : Power Platform Who Am I
2023-07-19T21:48:45.2706241Z Description  : Who Am I for quick connection testing to Power Platform org/environment instance.
2023-07-19T21:48:45.2706351Z Version      : 2.0.31
2023-07-19T21:48:45.2706408Z Author       : Microsoft
2023-07-19T21:48:45.2706467Z Help         : [More Info](https://aka.ms/buildtoolsdoc)
2023-07-19T21:48:45.2706542Z ==============================================================================
2023-07-19T21:48:45.3069931Z ##[debug]Using node path: /home/vsts/agents/3.220.5/externals/node10/bin/node
2023-07-19T21:48:45.4220807Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp
2023-07-19T21:48:45.4221172Z ##[debug]loading inputs and endpoints
2023-07-19T21:48:45.4221483Z ##[debug]loading INPUT_AUTHENTICATIONTYPE
2023-07-19T21:48:45.4231815Z ##[debug]loading INPUT_POWERPLATFORMSPN
2023-07-19T21:48:45.4233441Z ##[debug]loading INPUT_ENVIRONMENT
2023-07-19T21:48:45.4234608Z ##[debug]loading ENDPOINT_AUTH_23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2
2023-07-19T21:48:45.4236454Z ##[debug]loading ENDPOINT_AUTH_SCHEME_23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2
2023-07-19T21:48:45.4237544Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2_TENANTID
2023-07-19T21:48:45.4283897Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2_APPLICATIONID
2023-07-19T21:48:45.4284302Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2_CLIENTSECRET
2023-07-19T21:48:45.4284664Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2023-07-19T21:48:45.4284995Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2023-07-19T21:48:45.4285354Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2023-07-19T21:48:45.4285674Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2023-07-19T21:48:45.4285960Z ##[debug]loaded 12
2023-07-19T21:48:45.4286238Z ##[debug]Agent.ProxyUrl=undefined
2023-07-19T21:48:45.4286536Z ##[debug]Agent.CAInfo=undefined
2023-07-19T21:48:45.4286822Z ##[debug]Agent.ClientCert=undefined
2023-07-19T21:48:45.4287120Z ##[debug]Agent.SkipCertValidation=undefined
2023-07-19T21:48:45.4535470Z ##[debug]Agent.Version=3.220.5
2023-07-19T21:48:45.4556629Z ##[debug]authenticationType=PowerPlatformSPN
2023-07-19T21:48:45.4557123Z ##[debug]PowerPlatformSPN=23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2
2023-07-19T21:48:45.4557456Z ##[debug]23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2 exists true
2023-07-19T21:48:45.4558153Z ##[debug]23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2=https://XXXXXXX.crm.dynamics.com/
2023-07-19T21:48:45.4575893Z ##[debug]Environment=https://dwtestsolutionimport.crm.dynamics.com
2023-07-19T21:48:45.4579469Z Discovered environment url from explicit input parameter 'Environment': https://dwtestsolutionimport.crm.dynamics.com
2023-07-19T21:48:45.4580730Z ##[debug]Discovered environment url from explicit input parameter 'Environment': https://dwtestsolutionimport.crm.dynamics.com
2023-07-19T21:48:45.4582079Z ##[debug]IsolateVarRef: https://dwtestsolutionimport.crm.dynamics.com -> https://dwtestsolutionimport.crm.dynamics.com (isRefExpression=false)
2023-07-19T21:48:45.4589423Z ##[debug]POWERPLATFORMTOOLS_PACCLIPATH=/home/vsts/work/_tasks/PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3/2.0.31/bin
2023-07-19T21:48:45.4605983Z [ 'authN to env. authType:SPN authScheme:None; cloudInstance: Public; envUrl: https://dwtestsolutionimport.crm.dynamics.com' ]
2023-07-19T21:48:45.4611194Z ##[debug]command: /home/vsts/work/_tasks/PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3/2.0.31/bin/pac_linux/tools/pac, first arg of 12: auth
2023-07-19T21:48:50.9251861Z [ '\'***\' authenticated successfully.' ]
2023-07-19T21:48:50.9259489Z [ 'Validating connection...' ]
2023-07-19T21:48:52.1175140Z [ 'Connected to... DanDev' ]
2023-07-19T21:48:52.1175943Z [ 'Connected as ***' ]
2023-07-19T21:48:52.6430823Z [ 'Authentication profile created' ]
2023-07-19T21:48:52.6485284Z [ '    * DATAVERSE                                https://dwtestsolutionimport.crm.dynamics.com/ : ***     Public' ]
2023-07-19T21:48:52.6485785Z [ '' ]
2023-07-19T21:48:52.7854813Z [ 'The Authentication Result: \'***\' authenticated successfully.,Validating connection...,Connected to... DanDev,Connected as ***,Authentication profile created,    * DATAVERSE                                https://dwtestsolutionimport.crm.dynamics.com/ : ***     Public,' ]
2023-07-19T21:48:52.7858582Z ##[debug]command: /home/vsts/work/_tasks/PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3/2.0.31/bin/pac_linux/tools/pac, first arg of 2: org
2023-07-19T21:48:54.8599817Z [ 'Connected to... DanDev' ]
2023-07-19T21:48:54.8600701Z [ 'Connected as ***' ]
2023-07-19T21:48:55.2155445Z [ 'Organization Information' ]
2023-07-19T21:48:55.2160522Z [ '  Org ID:                     feac7023-7626-ee11-8473-000d3a106f19' ]
2023-07-19T21:48:55.2161404Z [ '  Unique Name:                unqfeac70237626ee118473000d3a106' ]
2023-07-19T21:48:55.2161867Z [ '  Friendly Name:              DanDev' ]
2023-07-19T21:48:55.2162492Z [ '  Org URL:                    https://dwtestsolutionimport.crm.dynamics.com/' ]
2023-07-19T21:48:55.2163052Z [ '  User Email:                 ***' ]
2023-07-19T21:48:55.2163693Z [ '  User ID:                    9dbacd48-7726-ee11-9966-6045bdd55584' ]
2023-07-19T21:48:55.2164131Z [ '  Environment ID:             00e47a69-fc05-e5d9-8452-0617b6adcf08' ]
2023-07-19T21:48:55.2800770Z [ 'WhoAmI Action Result: Connected to... DanDev,Connected as ***,Organization Information,  Org ID:                     feac7023-7626-ee11-8473-000d3a106f19,  Unique Name:                unqfeac70237626ee118473000d3a106,  Friendly Name:              DanDev,  Org URL:                    https://dwtestsolutionimport.crm.dynamics.com/,  User Email:                 ***,  User ID:                    9dbacd48-7726-ee11-9966-6045bdd55584,  Environment ID:             00e47a69-fc05-e5d9-8452-0617b6adcf08' ]
2023-07-19T21:48:55.2802080Z ##[debug]command: /home/vsts/work/_tasks/PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3/2.0.31/bin/pac_linux/tools/pac, first arg of 2: auth
2023-07-19T21:48:56.2983017Z [ 'Authentication profiles and token cache removed' ]
2023-07-19T21:48:56.3648745Z [ 'The Clear Authentication Result: Authentication profiles and token cache removed' ]
2023-07-19T21:48:56.3649723Z ##[debug]set BuildTools.EnvironmentId=00e47a69-fc05-e5d9-8452-0617b6adcf08
2023-07-19T21:48:56.3650879Z ##[debug]Processed: ##vso[task.setvariable variable=BuildTools.EnvironmentId;isOutput=false;issecret=false;]00e47a69-fc05-e5d9-8452-0617b6adcf08
2023-07-19T21:48:56.3684196Z ##[section]Finishing: PowerPlatformWhoAmi

InstallApplication Output

2023-07-19T21:48:56.3693499Z ##[debug]Evaluating condition for step: 'PowerPlatformInstallApplication'
2023-07-19T21:48:56.3694244Z ##[debug]Evaluating: SucceededNode()
2023-07-19T21:48:56.3694453Z ##[debug]Evaluating SucceededNode:
2023-07-19T21:48:56.3694807Z ##[debug]=> True
2023-07-19T21:48:56.3695032Z ##[debug]Result: True
2023-07-19T21:48:56.3695267Z ##[section]Starting: PowerPlatformInstallApplication
2023-07-19T21:48:56.3698570Z ==============================================================================
2023-07-19T21:48:56.3698808Z Task         : Power Platform Install Applications
2023-07-19T21:48:56.3698895Z Description  : Install Power Platform Applications from AppSource
2023-07-19T21:48:56.3698989Z Version      : 2.0.31
2023-07-19T21:48:56.3699045Z Author       : Microsoft
2023-07-19T21:48:56.3699107Z Help         : [More Info](https://aka.ms/buildtoolsdoc)
2023-07-19T21:48:56.3699190Z ==============================================================================
2023-07-19T21:48:56.4144755Z ##[debug]Using node path: /home/vsts/agents/3.220.5/externals/node10/bin/node
2023-07-19T21:48:56.5266731Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp
2023-07-19T21:48:56.5289310Z ##[debug]loading inputs and endpoints
2023-07-19T21:48:56.5294291Z ##[debug]loading INPUT_AUTHENTICATIONTYPE
2023-07-19T21:48:56.5306378Z ##[debug]loading INPUT_POWERPLATFORMSPN
2023-07-19T21:48:56.5308180Z ##[debug]loading INPUT_ENVIRONMENT
2023-07-19T21:48:56.5309304Z ##[debug]loading INPUT_APPLICATIONLIST
2023-07-19T21:48:56.5310257Z ##[debug]loading ENDPOINT_AUTH_23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2
2023-07-19T21:48:56.5311247Z ##[debug]loading ENDPOINT_AUTH_SCHEME_23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2
2023-07-19T21:48:56.5312103Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2_TENANTID
2023-07-19T21:48:56.5312959Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2_APPLICATIONID
2023-07-19T21:48:56.5313795Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2_CLIENTSECRET
2023-07-19T21:48:56.5314615Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2023-07-19T21:48:56.5315441Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2023-07-19T21:48:56.5316259Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2023-07-19T21:48:56.5319831Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2023-07-19T21:48:56.5320792Z ##[debug]loaded 13
2023-07-19T21:48:56.5324994Z ##[debug]Agent.ProxyUrl=undefined
2023-07-19T21:48:56.5325705Z ##[debug]Agent.CAInfo=undefined
2023-07-19T21:48:56.5326102Z ##[debug]Agent.ClientCert=undefined
2023-07-19T21:48:56.5326419Z ##[debug]Agent.SkipCertValidation=undefined
2023-07-19T21:48:56.5714454Z ##[debug]Agent.Version=3.220.5
2023-07-19T21:48:56.5736143Z ##[debug]authenticationType=PowerPlatformSPN
2023-07-19T21:48:56.5738387Z ##[debug]PowerPlatformSPN=23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2
2023-07-19T21:48:56.5740155Z ##[debug]23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2 exists true
2023-07-19T21:48:56.5741698Z ##[debug]23bd674d-aebf-4bd7-8921-c3e2f4b7a2a2=https://bbws-dev.crm.dynamics.com/
2023-07-19T21:48:56.5753271Z ##[debug]POWERPLATFORMTOOLS_PACCLIPATH=/home/vsts/work/_tasks/PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3/2.0.31/bin
2023-07-19T21:48:56.5797583Z [ 'authN to admin API: authType=SPN; cloudInstance: Public' ]
2023-07-19T21:48:56.5798501Z ##[debug]command: /home/vsts/work/_tasks/PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3/2.0.31/bin/pac_linux/tools/pac, first arg of 12: auth
2023-07-19T21:48:58.2837684Z [ '\'***\' authenticated successfully.' ]
2023-07-19T21:48:58.2841765Z [ 'Validating connection...' ]
2023-07-19T21:48:58.3575448Z [ 'Authentication profile created' ]
2023-07-19T21:48:58.3627371Z [ '    * ADMIN                                    https://service.powerapps.com/           : ***     Public' ]
2023-07-19T21:48:58.3632806Z [ '' ]
2023-07-19T21:48:58.3641362Z [ 'Microsoft PowerPlatform CLI' ]
2023-07-19T21:48:58.3641827Z [ 'Version: 1.25.2+g1c4a1b8' ]
2023-07-19T21:48:58.3642470Z [ 'Online documentation: https://aka.ms/PowerPlatformCLI' ]
2023-07-19T21:48:58.3643218Z [ 'Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions' ]
2023-07-19T21:48:58.3643773Z [ '' ]
2023-07-19T21:48:58.3644139Z [ 'Warning: Argument --kind is deprecated and is ignored.' ]
2023-07-19T21:48:58.3644649Z [ '' ]
2023-07-19T21:48:58.4259784Z [ 'The Authentication Result: \'***\' authenticated successfully.,Validating connection...,Authentication profile created,    * ADMIN                                    https://service.powerapps.com/           : ***     Public,,Microsoft PowerPlatform CLI,Version: 1.25.2+g1c4a1b8,Online documentation: https://aka.ms/PowerPlatformCLI,Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions,,Warning: Argument --kind is deprecated and is ignored.,' ]
2023-07-19T21:48:58.4261516Z ##[debug]Environment=https://dwtestsolutionimport.crm.dynamics.com
2023-07-19T21:48:58.4262356Z Discovered environment url from explicit input parameter 'Environment': https://dwtestsolutionimport.crm.dynamics.com
2023-07-19T21:48:58.4262926Z ##[debug]Discovered environment url from explicit input parameter 'Environment': https://dwtestsolutionimport.crm.dynamics.com
2023-07-19T21:48:58.4263731Z ##[debug]IsolateVarRef: https://dwtestsolutionimport.crm.dynamics.com -> https://dwtestsolutionimport.crm.dynamics.com (isRefExpression=false)
2023-07-19T21:48:58.4264287Z ##[debug]ApplicationList=/home/vsts/work/1/s/.azure-pipelines/apps.json
2023-07-19T21:48:58.4265119Z [ 'Calling pac cli inputs: application install --environment https://dwtestsolutionimport.crm.dynamics.com --application-list /home/vsts/work/1/s/.azure-pipelines/apps.json' ]
2023-07-19T21:48:58.4265712Z ##[debug]command: /home/vsts/work/_tasks/PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3/2.0.31/bin/pac_linux/tools/pac, first arg of 6: application
2023-07-19T21:49:00.2886132Z [ 'Microsoft PowerPlatform CLI' ]
2023-07-19T21:49:00.2886629Z [ 'Version: 1.25.2+g1c4a1b8' ]
2023-07-19T21:49:00.2886977Z [ 'Online documentation: https://aka.ms/PowerPlatformCLI' ]
2023-07-19T21:49:00.2887383Z [ 'Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions' ]
2023-07-19T21:49:00.2887642Z [ '' ]
2023-07-19T21:49:00.2888243Z [ 'Error: Must have tenant id, current profile (Kind: ADMIN; User: ***; Resource: https://service.powerapps.com/; Name: ; CloudInstance: Public) has none set.' ]
2023-07-19T21:49:00.2888567Z [ '' ]
2023-07-19T21:49:00.2893888Z [ 'Usage: pac application install [--environment] [--application-name] [--application-list]' ]
2023-07-19T21:49:00.2894193Z [ '' ]
2023-07-19T21:49:00.2894613Z [ '  --environment               List available Dataverse applications for given environment (by ID or url); if not specified, list all applications in the tenant (alias: -env)' ]
2023-07-19T21:49:00.2895069Z [ '  --application-name          Unique name of the application to install to the target environment. (alias: -an)' ]
2023-07-19T21:49:00.2895530Z [ '  --application-list          Location of the JSON file with list of the Dataverse applications from AppSource to be installed (alias: -al)' ]
2023-07-19T21:49:00.2895803Z [ '' ]
2023-07-19T21:49:00.3523440Z ##[error]error: 1
2023-07-19T21:49:00.3531155Z ##[debug]Processed: ##vso[task.issue type=error;]error: 1
2023-07-19T21:49:00.3533957Z ##[error]failed: Microsoft PowerPlatform CLI
Version: 1.25.2+g1c4a1b8
Online documentation: https://aka.ms/PowerPlatformCLI
Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions

Error: Must have tenant id, current profile (Kind: ADMIN; User: ***; Resource: https://service.powerapps.com/; Name: ; CloudInstance: Public) has none set.

Usage: pac application install [--environment] [--application-name] [--application-list]

  --environment               List available Dataverse applications for given environment (by ID or url); if not specified, list all applications in the tenant (alias: -env)
  --application-name          Unique name of the application to install to the target environment. (alias: -an)
  --application-list          Location of the JSON file with list of the Dataverse applications from AppSource to be installed (alias: -al)

2023-07-19T21:49:00.3535591Z ##[debug]Processed: ##vso[task.issue type=error;]failed: Microsoft PowerPlatform CLI
Version: 1.25.2+g1c4a1b8
Online documentation: https://aka.ms/PowerPlatformCLI
Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions

Error: Must have tenant id, current profile (Kind: ADMIN; User: ***; Resource: https://service.powerapps.com/; Name: ; CloudInstance: Public) has none set.

Usage: pac application install [--environment] [--application-name] [--application-list]

  --environment               List available Dataverse applications for given environment (by ID or url); if not specified, list all applications in the tenant (alias: -env)
  --application-name          Unique name of the application to install to the target environment. (alias: -an)
  --application-list          Location of the JSON file with list of the Dataverse applications from AppSource to be installed (alias: -al)

2023-07-19T21:49:00.3536646Z ##[debug]command: /home/vsts/work/_tasks/PowerPlatformToolInstaller_8015465b-f367-4ec4-8215-8edf682574d3/2.0.31/bin/pac_linux/tools/pac, first arg of 2: auth
2023-07-19T21:49:01.3765667Z [ 'Authentication profiles and token cache removed' ]
2023-07-19T21:49:01.4396103Z [ 'The Clear Authentication Result: Authentication profiles and token cache removed' ]
2023-07-19T21:49:01.4398983Z ##[debug]task result: Failed
2023-07-19T21:49:01.4400764Z ##[error]Error: Microsoft PowerPlatform CLI
Version: 1.25.2+g1c4a1b8
Online documentation: https://aka.ms/PowerPlatformCLI
Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions

Error: Must have tenant id, current profile (Kind: ADMIN; User: ***; Resource: https://service.powerapps.com/; Name: ; CloudInstance: Public) has none set.

Usage: pac application install [--environment] [--application-name] [--application-list]

  --environment               List available Dataverse applications for given environment (by ID or url); if not specified, list all applications in the tenant (alias: -env)
  --application-name          Unique name of the application to install to the target environment. (alias: -an)
  --application-list          Location of the JSON file with list of the Dataverse applications from AppSource to be installed (alias: -al)

2023-07-19T21:49:01.4402378Z ##[debug]Processed: ##vso[task.issue type=error;]Error: Microsoft PowerPlatform CLI
Version: 1.25.2+g1c4a1b8
Online documentation: https://aka.ms/PowerPlatformCLI
Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions

Error: Must have tenant id, current profile (Kind: ADMIN; User: ***; Resource: https://service.powerapps.com/; Name: ; CloudInstance: Public) has none set.

Usage: pac application install [--environment] [--application-name] [--application-list]

  --environment               List available Dataverse applications for given environment (by ID or url); if not specified, list all applications in the tenant (alias: -env)
  --application-name          Unique name of the application to install to the target environment. (alias: -an)
  --application-list          Location of the JSON file with list of the Dataverse applications from AppSource to be installed (alias: -al)

2023-07-19T21:49:01.4414806Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: Microsoft PowerPlatform CLI
Version: 1.25.2+g1c4a1b8
Online documentation: https://aka.ms/PowerPlatformCLI
Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions

Error: Must have tenant id, current profile (Kind: ADMIN; User: ***; Resource: https://service.powerapps.com/; Name: ; CloudInstance: Public) has none set.

Usage: pac application install [--environment] [--application-name] [--application-list]

  --environment               List available Dataverse applications for given environment (by ID or url); if not specified, list all applications in the tenant (alias: -env)
  --application-name          Unique name of the application to install to the target environment. (alias: -an)
  --application-list          Location of the JSON file with list of the Dataverse applications from AppSource to be installed (alias: -al)

2023-07-19T21:49:01.4439101Z ##[section]Finishing: PowerPlatformInstallApplication
omnisip commented 1 year ago

I have now tested every possible combination of workaround and cannot find a solution.

I downgraded the tools task versions. Didn't help.

I downgraded the pac tool itself back to 1.24 and found new breaking issues in shell testing that would prevent it from working.

I tried both Windows and Linux for all of the combinations.

I also wrote entire shell excepte replacements for the tasks down to making calls to pac from authenticate through application install. No matter what I do there, it won't work with a client secret for app install.

My diagnosis of the issue makes me believe that changes in pac are the root of this. From all of the experimental testing, between 1.24 and 1.25.2+g1c4a1b8, persistence of tenant ids to the place where authentication profiles are stored is broken. When manually adding the tenant id to authentication profiles Json, a new issue occurs where it will fail the authentication despite working correctly when adding the profile. I've further confirmed the results in portal.azure.com sign in logs.

petrochuk commented 1 year ago

We are working on a fix and plan to release it tomorrow

tehcrashxor commented 1 year ago

Fix has rolled out in PAC v1.25.3 and Power Platform Build Tools v2.0.32