Azure Powershell - Add-AzureVirtualIP cmdlet not found - powershell

I need to add another VIP for my Azure cloud service using Powershell for Azure, since there is no way to do it via the web console. In the past I was able to do it by using the Add-AzureVirtualIP command.
However, that command seems to no longer be found since MS switched everything to Azure Resource Manager mode. How can I use this command again, or is there another way to add a VIP to my cloud service?
Add-AzureVirtualIP : The term 'Add-AzureVirtualIP' 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

According to your error code, it seems the Azure PowerShell is not loaded correctly. we can install Azure PowerShell with this command:
Install-Module -Name Azure
More information about Azure PowerShell, please refer to the link.

Related

Azure Functions Running AZ Commands

I have a Powershell Script that contains az commands which i am running from an Azure Function
I have The module specified in requirements.psd1 and host json managed dependency is enabled
In my script I have put in the following commands
Get-Module -Name Az -ListAvailable
Import-Module Az
Get Module comes back as 4.8.0 is installed
I then get a warning
[Warning] The Function app may be missing a module containing the 'az' command definition. If this command belongs to a module available on the PowerShell Gallery, add a reference to this module to requirements.psd1. Make sure this module is compatible with PowerShell 7. For more details, see https://aka.ms/functions-powershell-managed-dependency. If the module is installed but you are still getting this error, try to import the module explicitly by invoking Import-Module just before the command that produces the error: this will not fix the issue but will expose the root cause.
Followed by by actual command
az storage account keys list <blah>
[Error] ERROR: The term 'az' 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.
az cli is not available currently out the box in the functions
powershell environment. This is a feature ask and we are looking into
it.
Please refer to GitHub Issue#221 for this.
Using the corresponding Azure PowerShell Modules shall be the only way to go for now.
You can use Get-AzStorageAccountKey instead of az storage account keys

Azure Powershell agent task pipeline

I'm just wondering whats the chain underlies Azure Powershell VSO agent task. I assume that is not simple powershell host because it is not working with some commandlets (for example Get-Module -ListAvailable) and fails with an error:
The term 'Get-ServiceEndpoint' 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.
A Connected Service with name 'xxxxx-xxxx-xxxxx-xxxx-xxxxxxxxxxx' could not be found. Ensure that
this Connected Service was successfully provisioned using services tab
in Admin UI.
VSTS build task are normal powershell scripts. However the 'Get-ServiceEndpoint' is a known issue: issue.
As far as I can see other cmdlets are working normally. I've been able to write several build tasks without any problems.

Manage Azure Redis Cache with Azure PowerShell

When I try to run below command to just start with Azure Redis cache I am getting below error message. Am I missing something? I am using Windows PowerShell, Version 3.0.
PS C:> New-AzureRedisCache
New-AzureRedisCache : The term 'New-AzureRedisCache' 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.
You don't have all the prerequisites complete (no Azure PowerShell commands loaded). Follow the instructions at Manage Azure Redis Cache with Azure PowerShell.

Powershell Webjob fails to run

I have created a Powershell Webjob for use in the Azure Logic App. The code is trying to generate a signed URI so the end user can download the file when its available. To do that I created a simple Powershell Webjob.
New-AzureStorageContext : The term 'New-AzureStorageContext' 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.
CommandNotFoundException New-AzureStorageBlobSASToken : The term 'New-AzureStorageBlobSASToken' 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.
I know these are part of the Azure Powershell. But is there an alternative for them to run? Or would I need to resolve to a separate console application?
After a lot of google searching, I found that Azure Powershell jobs do not support Azure commands. They have a plan to allow for that, but currently you cannot run Azure PowerShell Jobs on WebApps Webjob.

Load Azure PowerShell Cmdlets onto Remote VM

I am using PowerShell to automate the creation of a virtual machine in Azure, then using Remote PowerShell to run commands on that machine. I can run any PowerShell command that ships with Windows perfectly well, but when I try to run something like:
Set-AzureSubscription or Get-AzureStorageBlobContent
I get the following message:
The term 'Set-AzureSubscription' is not recognized as the name of a cmdlet, function, script file, or operable program.
Of course, because the Azure module is not preloaded on the VM in Azure. Is it possible to copy the Azure Module up to the VM using PowerShell? Or any other way to go about this assuming everything must be automated with PowerShell (so I can't log into the VM to run the Azure PowerShell installer or copy and paste over a remote desktop session)?
Did use the Azure Powershell? If not you can install it here:
http://azure.microsoft.com/en-gb/documentation/articles/install-configure-powershell/
This is because you don't have Azure module installed
Try this to check:
Get-AzureModule Azure
You shoud get the module here:
http://azure.microsoft.com/en-us/downloads/#cmd-line-Tools