Identify outgoing Azure App Service IP address

Outgoing IP address for Azure App service are different than the incoming IP address. To clarify the difference, the incoming IP address (as the name would indicate) identify the IP address using which data could be sent to App Service. This is what you would see when you would typically do DNS resolution for the App Service. Outgoing IP address identify IP address which would be used when sending data from Azure App service to the outside world. You may need this info because you may need to protect your environment from threats or white-list certain requests.

To identify outgoing Azure App Service IP address, we can simply navigate to the https://portal.azure.com and then go to the app service in reference. Continue reading “Identify outgoing Azure App Service IP address”

Error: The term ‘Save-AzureRMProfile’ is not recognized as the name of a cmdlet, function, script file, or operable program

If you have recently installed Azure PowerShell module on one of the machines and then trying to login using Select-AzureRMProfile, you are likely to receive below error:

Save-AzureRMProfile : The term ‘Save-AzureRMProfile’ 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 againAt line:3 char:2+  Save-AzureRMProfile -Path “C:\$SubscriptionName.json”+  ~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : ObjectNotFound: (Save-AzureRMProfile:String) [], CommandNotFoundException    + FullyQualifiedErrorId : CommandNotFoundException

I checked the list of cmdlets and it was gone. Continue reading “Error: The term ‘Save-AzureRMProfile’ is not recognized as the name of a cmdlet, function, script file, or operable program”

Azure Resource Group Error: A parameter cannot be found that matches parameter name ‘EnvironmentName’

Recently, if you have been trying to deploy Azure Resource Group template using Visual Studio, you might see below error:

[ERROR] Add-AzureRmAccount : A parameter cannot be found that matches parameter name 
[ERROR] 'EnvironmentName'.
[ERROR] At line:1 char:2379
[ERROR] + ... xmg' -AccountId 'myemail@gmail.com' -EnvironmentName 'AzureC ...
[ERROR] +                                                  ~~~~~~~~~~~~~~~~
[ERROR]     + CategoryInfo          : InvalidArgument: (:) [Add-AzureRmAccount], Param 
[ERROR]    eterBindingException
[ERROR]     + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Azure.Commands. 
[ERROR]    Profile.AddAzureRMAccountCommand
[ERROR]  
[ERROR] Run Login-AzureRmAccount to login.

Continue reading “Azure Resource Group Error: A parameter cannot be found that matches parameter name ‘EnvironmentName’”

Save profiles for all Azure subscriptions in one go

As discussed in one of the previous blog posts, we can use PowerShell to help create persistent logins. Now consider scenario, where you have access to multiple azure subscriptions. Off course, you can download and save AzureRM profile for each one of the them. However, there are two major issues:

  1. AzureRM profile downloaded is associated with a token by default and it expires in a few days.
  2. If you have too many subscriptions, it can be tiresome to first select subscription and then save the profile.

Continue reading “Save profiles for all Azure subscriptions in one go”

Persistant Azure PowerShell Logins

While doing azure automation from some time, I have found that I have to login each time I run a new PowerShell session. This is irritating while writing and executing scripts. You can do this manually by configuring the management certificate and subscription details with the Set-AzureSubscription and Select-AzureSubscription cmdlets or automatically by downloading the PublishSettings file from Windows Azure and importing it. In this blog post, we’ll see how to automate the login process for Microsoft Azure so that our script can run without any manual intervention.  Continue reading “Persistant Azure PowerShell Logins”

Invoke Azure Automation jobs using PowerShell

We can use PowerShell cmdlet Get-AzureRmAutomationRunbook to get runbooks associated with an automation account:

$resourceGroupName = "enggdevsoutheastasia"
$automationAccountName = "AzureAutomation"
$runbookName = "start-azurevms"
Get-AzureRmAutomationRunbook -automationAccountName $automationAccountName `
 -resourceGroupName $resourceGroupName

Similarly, we can use cmdlet Start-AzureRmAutomationRunbook …Continue Reading