Showing posts with label Azure. Show all posts
Showing posts with label Azure. Show all posts

Tuesday, July 25, 2023

Not able to RDP to Azure VM

 The Azure VM on startup may get a 169.254 IP and this causes the vm to lose any rdp connections it may have. 

The VM's also do not respond to ping or get DNS addresses assigned.

Solution is to add this registry key.

Find this registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

Click Edit > New, and click DWORD Value. Enter ArpRetryCount.
Right-click the ArpRetryCount registry entry and click Modify. In the Value box, type 0 and click OK.

Since you wont have access to the server you will have to use Bastion in Azure to login. 

Or you can use the Azure serial console to connect and add the registry key via command prompt.

REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v ArpRetryCount /t REG_DWORD /d 0




Friday, April 7, 2023

Orchestrator fails to run powershell cmdlets

Scenario: After you add a runbook activity which runs a powershell script. The activity fails with error.

e.g connecting to Azure using an app id.

The term 'Connect-AzAccount' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

 

If you open the runbook using runbook tester it may work fine.

But when you click run in the Designer it will fail.

This happens because the required modules are not installed in the runbook service context.

To do this add a new  Run . Net script activity and add the lines to install those modules in the it.

You might also get the following  error.


 Install-NuGetClientBinaries -CallerPSCmdlet $PSCmdlet -Proxy $Proxy -ProxyCredential $ProxyCredential
 Exception: Exception calling "ShouldContinue" with "2" argument(s): "A command that prompts the user failed because the host program or the command type does not support user interaction. The host was attempting to request confirmation with the following message: PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet provider must be available in 'C:\Program Files (x86)\PackageManagement\ProviderAssemblies' or 'C:\Windows\system32\config\systemprofile\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import the NuGet provider now?"

 

 

Giving the lines here for the lazy ones.


Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201  -scope CurrentUser  -Force

Install-module Az -scope CurrentUser -Force