We are using Deploy AzreRM Web App task for deployment. Getting below error while deploying
2016-10-12T09:36:10.2957680Z ##[debug]Processing: ##vso[task.issue type=error;]TypeError: Cannot read property 'id' of undefined
2016-10-12T09:36:10.2957680Z ##[error]TypeError: Cannot read property 'id' of undefined
Attaching the log
Error.txt
@PrashanthReddyAnnedla , please add console.log(url); console.log(headers); below azurermutil.js
and console.log(body); console.log(webAppIDDetails ); below azurermutil.js
and run the task and provide the logs. Please make sure that the changes are made in '.js' files not in '.ts' files.
'azurermutil.js' file will present in E:\agent_work\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\2.0.2\
Please share the web app name too.
I am getting the same issue. Very frustrating..
@vincentdass - We dont have access to the Agent machines hence cannot update the script!
I will try to do it my local agent and see if I am able to repro this issue!
@vincentdass I was able to add the logging to the task in my local agent and I got the output but it has my subscription ID and other sensitive info that I can't share here... from what I gathered from the logs... I'm guessing that the API call to look up the Azure WebApp... is returning an empty array...
@nibras85 , thanks for the info. Can you replace header in azurermutil.js with
var headers = {
authorization: 'Bearer '+ accessToken,
'Cache-Control': 'no-cache'
};
and queue a new build/release ?
@vincentdass I did. Same error.
@vincentdass ,
One more observation : Selected the slot, resource group in the task. Got the error as 404 not found, though the website exists
@PrashanthReddyAnnedla , Did you create a slot from Azure Portal ? (if Slot is not created, it throws 404 error)

If your slot name is 'Production' :
Production slot is applicable only for Azure Classic Web Deployment Task. It should not be explicitly specified as slot for AzureRM web App Deployment task. By default, it is deployed in Production slot.
Can u share the web app name and the slot name ? Please share the agent version too.
@vincentdass
I am not trying to create a new slot here, deploying to Production slot only.
I will send you the details over the mail.
@nibras85 , Can u mail the log with debug messsages ?
@vincentdass please share your email address and I can share the logs with you. Thanks.
@nibras85, [email protected]
@vincentdass sent. Thanks a lot.
@nibras85 , @PrashanthReddyAnnedla . It's a genuine issue and will be fixed in the upcoming deployment.
@vincentdass any workarounds? In my case, I need to automate the deployment of an ASP.NET Core app
@vincentdass - do we want to patch the task or is it fixed in 107 (rolling now)?
@bryanmacfarlane - We will patch this issue with 107. We have recently identified the different cause of issue will fix it soon .
@mxa0079
We have identified different cause of this issue. Need some info from you regarding issue.
@Ajay-MS We are using hosted agents,so we cannot make the changes mentioned by @vincentdass (and cannot afford the time to create a dedicated agent to debug this issue) -- however, I will be glad to enable the verbose logs if this will help you.
The issue is hotfixed. If the error occurs again , please open this thread.
Most helpful comment
@nibras85 , @PrashanthReddyAnnedla . It's a genuine issue and will be fixed in the upcoming deployment.