PowerShell Error occurred on "Azure Container Instances" - azure

These code can run on "Docker" on Windows 10.
But these code can not run on "Azure Container Instances" on Windows 10
(command's parameters are omitted)
Connect-AzAccount
Connect-PnPOnline
New-PnPTenantSite
New-AzStorageContext
Set-AzStorageBlobContent
if these code run on "Azure Container Instances", this error below occurred on the azure terminal. Can someone know what is reason and issue?
The Win32 internal error "No process is on the other end of the pipe" 0xE9 occurred while getting console output buffer information. Contact Microsoft Customer Support Services.

The Win32 internal error "No process is on the other end of the pipe" 0xE9 occurred while getting console output buffer information. Contact Microsoft Customer Support Services.
This issue shows that version (Win32) of window throwing error. Because of the version of windows of the Azure Container instance was different from local.
Ways to fix the issue:
Use win64 version of Windows Azure Container Instance.
Make sure you are using latest PowerShell modules. If not update the latest Az PowerShell Modules to access the Azure resources.

Related

Unable to configure Azure Insights on Azure VM running Windows

I am attempting to configure the Log Analytics agent for Insights on my Azure VM running Windows. When I attempt to deploy the monitoring configuration, the DependencyAgentWindows VM extension fails to install. I have the same solution working on a similar VM and am stumped on what the issue is for the failing VM.
{"code":"DeploymentFailed","message":"At least one resource deployment> operation failed. Please list deployment operations for details.> Please see https://aka.ms/DeployOperations for usage
details.","details":"code":"VMExtensionHandlerNonTransientError","message":"The
handler for VM extension type
'Microsoft.Azure.Monitoring.DependencyAgent.DependencyAgentWindows'
has reported terminal failure for VM extension
'DependencyAgentWindows' with error message: 'Install failed for
plugin (name:
Microsoft.Azure.Monitoring.DependencyAgent.DependencyAgentWindows,
version 9.10.16.22650) with exception Command
C:\Packages\Plugins\Microsoft.Azure.Monitoring.DependencyAgent.DependencyAgentWindows\9.10.16.22650\scripts\RunPs1.cmd
of Microsoft.Azure.Monitoring.DependencyAgent.DependencyAgentWindows
has exited with Exit code: 52'.\r\n \r\n'Install handler failed for
the extension. More information on troubleshooting is available at
https://aka.ms/VMExtensionDependencyAgentWindowsTroubleshoot'"}]}
I have tried to deploying the Monitoring Configuration and installing the DepencyAgentWindows VM Extension through the Portal and through PowerShell. I am expecting the DepencyAgentWindows VM Extension to install properly and be able to enable Insights successfully.
I tried to reproduce same in my environment I got the results successfully like below.
This issue usually occurs if network connectivity issues preventing the plugin from being downloaded and if the extension won't work properly if the vm agent is failing to report a status to the Azure platform..
To resolve this issue:
Try to delete if any other extension is already exists in your vm
In virtual machine -> extension -> uninstall
In monitor -> virtual machine -> configure insights -> enable -> monitoring configuration -> configure
When I try to deploy, it deployed successfully like below:
If still issue persists, try to uninstall the vm and Redeploy it and also check the MsDoc to know the supported operating system versions.

Unable to Deploy Flatcar OS on Azure

I was trying to deploy flatcar image on Azure, but I am not able to deploy it. following are the steps I performed
I downloaded latest azure supported VHD from https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_azure_image.vhd.bz2.
I uploaded this VHD to azure storage blob and converted it to an image as recommended by Azure guides
I tried creating VM out of this image. VM gets created successfully, but we can see one error while creating VM and VM creation is shown as failed (Even though it is actually successful). Following is the error which I can see:
{
"code": "DeploymentFailed",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",
"details": [
{
"code": "VMExtensionHandlerNonTransientError",
"message": "The handler for VM extension type 'Microsoft.Azure.Diagnostics.LinuxDiagnostic' has reported terminal failure for VM extension 'LinuxDiagnostic' with error message: '[ExtensionOperationError] Non-zero exit code: 1, /var/lib/waagent/Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.141/diagnostic.py -install\n[stdout]\n\n\n[stderr]\n File \"/var/lib/waagent/Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.141/diagnostic.py\", line 54\n print 'A local import (e.g., waagent) failed. Exception: {0}\\n' \\\n ^\nSyntaxError: invalid syntax\n'.\r\n \r\n'Install handler failed for the extension. More information on troubleshooting is available at https://aka.ms/VMExtensionLinuxDiagnosticsTroubleshoot'"
}
]
}
I tried going through link provided, but it didn't help much.
I also tried another option as following
Deployed flatcar VM through Azure marketplace
Captured generalized image out of this VM
Deployed VM using the image created in above step
Even with this approach I am getting same error.
for now, waagent (Azure Linux agent) does not support python 3.x, hence this syntax error exists. You need to have python 2.x on your OS to not have this issue.

Publish AZWebapp is not working for Linux function app

Publish-AzWebApp is not working for Linux function app
Publish-AzWebApp -ResourceGroupName Default-Web-WestUS -Name MyApp -ArchivePath C:\\project\\app.zip
I am using the above command in powershell and running that powershell in CICD process. But that is not deploying the files to function app(App service deployed) which is in Linux.
Getting the following error:
Service unavailable
It is working fine for Windows.
The following reasons will result in a service unavailable error:
The function host is down/restarting.
Platform issue as a result of the backend server not being available/allocated
A memory leak in the code caused the backend server to return a service unavailable error.
The "Diagnose and solve problems" blade in the Function app should be used to select the "Function app down or reporting" detector.
The diagnostic information regarding the function app and its infrastructure will be displayed by this detector. This will provide some insight into the issues regarding function hosts. Also, look under the Web app restarted section to determine if any platform-related issues contributed to the service unavailable error.
As you are running on Linux platform, then you would get information about the container recycles in the Web app restarted detector.

Onboarding Azure Arc VM fails: can't install Azure Connected Machine Agent

I'd like to add an offsite Windows VM to Azure Arc for health monitoring. The VM is hosted by Vultr and runs Windows Server 2016 Standard Build 14393.
However, installing AzureConnectedMachineAgent.msi on the target VM fails with error code 1603. Installation log also contains this error:
Start-Service : Service 'Guest Configuration Extension service
WixQuietExec64: (ExtensionService)' cannot be started due to the following error: Cannot start
WixQuietExec64: service ExtensionService on computer '.'.
WixQuietExec64: At C:\Program Files\AzureConnectedMachineAgent\ExtensionService\GC\Modules\Exte
WixQuietExec64: nsionService\ServiceHelper.psm1:367 char:5
Any suggestions on how to fix this?
You may Check if the user with which you are logged into the VM have
sufficient permissions to start a system service
If you find the following in the
%ProgramData%\AzureConnectedMachineAgent\Log\himds.log or in installation logs :
time="2021-02-11T08:39:38-08:00" level=error msg="Cannot open event source: Azure Hybrid Instance Metadata Service."
You can verify the permissions by collecting the following registry
key from an impacted server.
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Eventlog\Application\CustomS
Mitigation can be to grant the permission to write to the
SECURITY_SERVICE_RID S-1-5-6 which would grant the required
permissions to the himds service account.
https://learn.microsoft.com/en-us/windows/win32/secauthz/well-known-sids.
If the registry key does NOT exist on the impacted VM, then this
resolution will NOT apply as there will be a separate root cause such
as AV interference.
If the root cause is not found here ,then a procmon trace needs to be
taken to analyze the root cause for the msi not being able to start a
service.
( In case a procmon trace has to be analyzed , please open an MS
Support ticket)
To get support for Windows Agent and extensions in Azure, the Windows
Agent on the Windows VM must be later than or equal to version
2.7.41491.911. However the cause for the failure of agent installation is different in this case.
You may also want to check %programdata%\ext_mgr_logs\gc_ext_telemetry.txt log which must have had an entry something like this :
<GCLOG>........ Not starting Extension Service since machine is an Azure VM</GCLOG>
Cause:
This can happen while attempting to install the agent on an Azure VM.This is an unsupported production scenario.One Should not be installing this agent on an Azure VM as it conflicts with the Azure Guest Agent and interferes with Azure VM management.
If one wishes to use an Azure VM simply for testing purposes then
they can follow the below document for guidance
https://learn.microsoft.com/en-us/azure/azure-arc/servers/plan-evaluate-on-azure-virtual-machine

Azure Devops: installing a Windows Service

I am trying to automate installing windows service using Azure DevOps pipeline. I installed Windows Service Manager from here: https://marketplace.visualstudio.com/items?itemName=MDSolutions.WindowsServiceManagerWindowsServiceManager and added it to the pipeline as a task. The windows service should be installed on the virtual machine where the pipeline is, so I provided "LocalSystem" as Run As Username, and nothing for password. The service was not installed with the following error:
Service ' (MyServiceName)' cannot be created due to the following error: The account name is invalid or does not exist, or the password is invalid for the account name specified
I tried also the credentials I use to get to the virtual machine, but it gave the same error. How can this be solved?
Added:
The service can be installed without problems using installutil.
Azure Devops: installing a Windows Service
You could try to use deployment groups to test, if you are using the private agent:
As the document state:
Service Name - The name of the Windows Service installed on the Deployment Group Target.
You could also refer to the similar thread for some more details.

Resources