Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name: AzureCLI
Server - Azure Pipelines or TFS on-premises? Azure Pipelines
Agent - Hosted or Private: Hosted
Trying to deploy a webapp zip package from AzureCLI in an hosted agent from a multi-stage YAML pipeline.
jobs:
- deployment: my_deployment
pool:
vmImage: vs2017-win2016
environment: my-environment
variables:
resourceGroupName: 'MyRGName'
webAppName: 'mywebapp'
strategy:
runOnce:
deploy:
steps:
- task: AzureCLI@2
displayName: 'Deploy apps'
inputs:
azureSubscription: 'My-Service-Connection-Name'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
az webapp deployment source config-zip -g $(resourceGroupName) -n $(webAppName) --src $(Pipeline.Workspace)/myBuildPipeline/myArtifact/My.App.zip
Running the same commands locally on my machine with Azure CLI v2.0.76 work as expected.
I also tried AzureCLI@1 with batch script, same issue as reported.
Is it possible to provide them in a private manner too?
WARNING: Starting zip deployment. This operation can take a while to complete ...
{
"active": true,
"author": "N/A",
"author_email": "N/A",
"complete": true,
"deployer": "Push-Deployer",
"end_time": "2019-11-29T15:35:57.7581811Z",
"id": "c161a25632f04740803434ed81e6f280",
"is_readonly": true,
"is_temp": false,
"last_success_end_time": "2019-11-29T15:35:57.7581811Z",
"log_url": "https://mywebapp.scm.azurewebsites.net/api/deployments/latest/log",
"message": "Created via a push deployment",
"progress": "",
"provisioningState": null,
"received_time": "2019-11-29T15:35:56.9022421Z",
"site_name": "mywebapp",
"start_time": "2019-11-29T15:35:57.2425493Z",
"status": 4,
"status_text": "",
"url": "https://mywebapp.scm.azurewebsites.net/api/deployments/latest"
}
ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: 'NoneType' object has no attribute 'server_farm_id'
Traceback (most recent call last):
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\knack\knack\cli.py", line 206, in invoke
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\commands\__init__.py", line 603, in execute
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\commands\__init__.py", line 661, in _run_jobs_serially
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\commands\__init__.py", line 654, in _run_job
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\six\six.py", line 693, in reraise
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\commands\__init__.py", line 631, in _run_job
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\commands\__init__.py", line 306, in __call__
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli-core\azure\cli\core\__init__.py", line 485, in default_command_handler
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-p8t_6awn\azure-cli\azure\cli\command_modules\appservice\custom.py", line 314, in enable_zip_deploy_functionapp
AttributeError: 'NoneType' object has no attribute 'server_farm_id'
WARNING:
To open an issue, please run: 'az feedback'
Hey @ggirard07 can you please cross-check the subscription used in the task?
If you are still facing this issue, can you please set the variable "System.debug" with value "true". Redeploy and share logs at [email protected].
@jalajmsft Yes I did and it was the proper one. I even tried to set it again explicitly in my script just to be sure but it did no change anything.
I'll share the logs on the provided email today or tomorrow and keep you posted.
Hey @ggirard07 are you still blocked on this?
I shared the logs yesterday of a failed run to the provided email address.
In the meantime, I was able to get the same pipeline running 2 times properly without any specific changes.
So I am wondering whether it is an intermittent issue or if you fixed something on your side?
Hey @ggirard07 I can't find any logs in the inbox, can you please send it again?
Glad the pipeline is working. I was also able to get the pipeline running with the same command at my end. It could be an intermittent issue with Azure CLI as there is no update at our end w.r.t. task.
@jalajmsft just re-forwarded my email to [email protected] (title is Logs for https://github.com/microsoft/azure-pipelines-tasks/issues/11862).
Hey @ggirard07 sorry for the inconvenience we haven't received the mail, can you please re-send it to [email protected] (although it shouldn't matter)
I tried to resend it by just providing a link to the zip file in my onedrive instead of attaching it to the email...
Hey @ggirard07 We have received the logs this time. This looks like an issue with functionapp deployement,
Few more folks have faced this issue intermittently, this could be related to Azure/azure-cli #10773
I saw that issue at that time. Problem was provided workaround (setting the subscription explicitly outside the command) wasn't working. Also, I had the same issue whether it was webapp of functionapp.
Do you think It can all be related to the issue you linked (meaning once it fixed, it will also fix the webapp case)?
The issue seems common for both webapp and functionapp deployment. I guess once fixed it should be applicable for both.
Closing as this is not a task issue. Please track the original issue here