cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rappen
Level: Powered On

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
Power Apps Staff Mikkelsen2000
Power Apps Staff

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

rappen
Level: Powered On

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

Power Apps Staff Mikkelsen2000
Power Apps Staff

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

Thanks Jonas, I'll reach out privately

Highlighted
jveldhuis
Level: Powered On

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Users online (4,301)