cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Azure DevOps task Reset Environment fails 'ApiUrl is null'

I'm setting up a build pipeline according to the lab at MBAS, but before importing unmanaged to BUILD environment I want to reset the environment so it does not contain stuff from last build.AzDO-PA-Build-pipeline.png

 

The build task reports the following error:

 

[...]
##[debug]INPUT_POWERAPPSENVIRONMENT: 'e2019327-7056-4beb-8e29-xxxxxxxxxx' ##[debug]ENDPOINT_URL_e2019327-7056-4beb-8e29-xxxxxxxxxx: 'https://xxxxxxxxxx.crm4.dynamics.com/' ##[debug]ENDPOINT_AUTH_e2019327-7056-4beb-8e29-xxxxxxxxxx: '********' ##[debug]ENDPOINT_DATA_e2019327-7056-4beb-8e29-xxxxxxxxxx: '{}' ##[debug]INPUT_TARGETRELEASE: 'Dynamics 365, version 9.0' ##[debug]INPUT_BASELANGUAGE: '1033' ##[debug]INPUT_DOMAINNAME (empty) ##[debug]INPUT_FRIENDLYNAME (empty) ##[debug]INPUT_WAITFORENVIRONMENTAVAILABILITY: 'true' ##[debug]Entering CrmInstanceResetRequestInfo - ProcessRecord ##[debug]Executing CrmInstanceResetRequestInfo ##[debug]Exiting CrmInstanceResetRequestInfo - ProcessRecord : 00:00:00.0016028 Starting reset instance operation for https://xxxxxxxxxx.crm4.dynamics.com/... ##[debug]Leaving C:\Dev\AzDOBuildAgent\_work\_tasks\PowerAppsResetEnvironment_9fc15847-c58d-42f6-8d35-5905e5a5062b\0.1.129\ResetEnvironment.ps1. ##[debug]Caught exception from task script. ##[debug]Error record: ##[debug]Reset-Instance : Cannot bind argument to parameter 'ApiUrl' because it is null. ##[debug]At C:\Dev\AzDOBuildAgent\_work\_tasks\PowerAppsResetEnvironment_9fc15847-c58d-42f6-8d35-5905e5a5062b\0.1.129\ResetEnvironment.ps1:115 char:5 ##[debug]+ Reset-Instance -EnvironmentURL $serviceConnection.url -PSCredenti ... ##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##[debug] + CategoryInfo : InvalidData: (:) [Reset-Instance], ParameterBindingValidationException ##[debug] + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Reset-Instance ##[debug] ##[debug]Script stack trace: ##[debug]at Reset-Instance<Process>, C:\Dev\AzDOBuildAgent\_work\_tasks\PowerAppsResetEnvironment_9fc15847-c58d-42f6-8d35-5905e5a5062b\0.1.129\ResetEnvironment.ps1: line 49 ##[debug]at <ScriptBlock>, C:\Dev\AzDOBuildAgent\_work\_tasks\PowerAppsResetEnvironment_9fc15847-c58d-42f6-8d35-5905e5a5062b\0.1.129\ResetEnvironment.ps1: line 115 ##[debug]at <ScriptBlock>, <No file>: line 1 ##[debug]at <ScriptBlock>, <No file>: line 22 ##[debug]at <ScriptBlock>, <No file>: line 18 ##[debug]at <ScriptBlock>, <No file>: line 1 ##[debug]Exception: ##[debug]System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'ApiUrl' because it is null. ##[debug] at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) ##[debug] at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) ##[debug] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) ##[debug] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) ##[debug] at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) ##[debug] at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) ##[debug] at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) ##[debug] at System.Management.Automation.PSScriptCmdlet.DoProcessRecord() ##[debug] at System.Management.Automation.CommandProcessor.ProcessRecord() ##[error]Cannot bind argument to parameter 'ApiUrl' because it is null. ##[debug]Processed: ##vso[task.logissue type=error]Cannot bind argument to parameter 'ApiUrl' because it is null. ##[debug]Processed: ##vso[task.complete result=Failed]

YAML for the above task:

steps:
- task: 10m-cust-mscrm.10m-powerapps-beta.powerapps-reset-environment.PowerAppsResetEnvironment@0
  displayName: 'PowerApps Reset Environment '
  inputs:
    PowerAppsEnvironment: 'xxxxxx BUILD'
  enabled: true

Importing solution works fine, so the connection to the environment is good.

The Global Admin user I have has MFA enabled (customer requirement) and I can't get that to authenticate properly even with an app-pwd.

So I'm using another user which is just a "User" in the AAD, but of course SysAdmin in D365.

 

Any ideas?

@Mikkelsen2000 perhaps? 🙂 

4 REPLIES 4
Highlighted
Power Apps
Power Apps

Re: Azure DevOps task Reset Environment fails 'ApiUrl is null'

Hi Jonas, 

 

Two points:

A: Thanks for asking - highlighted a gap in documentation. Reset is currently not supported for non D365 CE environments.

B: Is the environment you are trying to reset a Dynamics 365 CE environment or CDS only? 

 

Finally - pls. update your Azure DevOps org with the public preview version of the Build Tools. The Private preview isn't upgradable as we had to change the publisher

 

Let me know how it goes

 

Thanks

Highlighted
Advocate I
Advocate I

Re: Azure DevOps task Reset Environment fails 'ApiUrl is null'

Thanks @Mikkelsen2000 !

 

It is D365CE (has Sales and Customer Service installed) and even after switching to the public preview version, I get the same error.

I can send you orgid and AzDO tenant privately, if you think that could help investigation.

 

Jonas

Highlighted
Power Apps
Power Apps

Re: Azure DevOps task Reset Environment fails 'ApiUrl is null'

Thanks Jonas, I'll reach out privately

Highlighted
New Member

Re: Azure DevOps task Reset Environment fails 'ApiUrl is null'

hi @Mikkelsen2000,

 

Is there a fix for this issue? I'm getting the same error with this task in AzureDevops.

 

KR,

 

Joost

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (4,966)