Monday, June 19, 2017

Sunday, March 5, 2017

Add-AzureRmAccount : The browser based authentication dialog failed to complete. Reason: The server or proxy was not found.

Add-AzureRmAccount : The browser based authentication dialog failed to complete.
Reason: The server or proxy was not found.
At C:\Users\ajeet.kumar.chouksey\Source\Workspaces\MyProject\Deploy.ps1:202 char:13
+             Add-AzureRmAccount
+             ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Add-AzureRmAccount], AadAuthenticati
   onFailedException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.AddAzureRMAccountCom
   mand



I am facing this issue since last couple of days and I found that this issue due to IE is not set as default browser. I change default browser from Chrome to IE, things start working as expected.

Wednesday, February 15, 2017

Get List of Latest API version for ARM resources

# Resource API version play an important role in ARM template. Below script help to get list of available API versions for various providers. if you remove if statement, script will list the API versions for all the provider.

$listProviderNameSpace=Get-AzureRmResourceProvider -ListAvailable
foreach($provideNameSpace in $listProviderNameSpace.ProviderNamespace)
{
   
    if(($provideNameSpace -eq "microsoft.compute") -or($provideNameSpace -eq "microsoft.storage") -or ($provideNameSpace -eq "microsoft.network"))
    {
       Write-Host $provideNameSpace
       $providerList = (Get-AzureRmResourceProvider -ProviderNamespace $provideNameSpace).ResourceTypes
       foreach($providerType in $providerList.ResourceTypeName)
       {     
            Write-Host $providerType
         ((Get-AzureRmResourceProvider -ProviderNamespace $provideNameSpace).ResourceTypes | Where-Object ResourceTypeName -eq $providerType).ApiVersions

         }
   }
}