Step-by-Step Instruction for creating Managed Cache Namespace Using Windows Azure PowerShell CmdLets


Currently the ability to create Azure Managed Cache Service Namespace from Portal is disabled, however end users can still create the Managed Cache namespace using the latest PowerShell CmdLet. So in this blog I will provide the step-by-step instruction on creating Managed Cache Service Namespace by leveraging latest version PowerShell CmdLet.

1. Please download the latest version of the Azure PowerShell Module from here

2. Create a  PowerShell Script file (*.ps1) with below CmdLet to add and List the  new managed cache namespace (Please refer the attached CreateManageCache.ps1)

Add-AzureAccount
New-AzureManagedCache -Name <cachenamespace> -Location "Location" -Sku Basic -Memory 128MB
Get-AzureManagedCache

3. Open the PowerShell Script, which is created in Step 2, in the PowerShell Script editor  ‘Windows PowerShell ISE’, which is located under ‘%windir%\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe’

4. Please note that, it will take couple of minutes to complete above script, once it created the name space, you can open the management portal and you will see the newly created Managed Cache Namespace, and you can do further cache management from the Management Portal.

Reference:

CreateManageCache.ps1

Comments (9)

  1. Om Gupta says:

    it's  great article for creating managed cache service through PowerShell.

    Thanks Pradeep for sharing it.

  2. Paul says:

    Is there any comment as to why it's been disabled in the portal?

  3. Sheng Liu says:

    Any idea why it's disabled in the Azure Portal?

  4. Todd says:

    Any way to set the expiry mode and time via powershell?

  5. Bhushan Gawale says:

    Awesome!! Thanks for sharing this valuable article as there is no clear information on MSDN for this.

    Wondering, why option to create cache is absent on the azure portal though, it was present in the preview version?

  6. Dan says:

    Are you able to get any information why the option to create a new cache has been deleted from the portal? Does this cache have any future ore should we start using the redis preview?

  7. Bala says:

    Very nice blog. Any reason why Microsoft removed the create cache option removed from portal.

    If we know the reason then that will be very informative for us.

  8. Mike says:

    Following these steps to the letter I am able to use Add-AzureAccount to connect.  But as soon as I execute the "New-AzureManagedCache -Name mycachename -Location "North Europe" -Sku Basic -Memory 128MB" command I get the error:

    New-AzureManagedCache : Your Windows Azure credential in the Windows PowerShell session has expired. Please use Add-AzureAccount to login again.

    If I log in again I get the same error.  Is there an issue in Azure Powershell at the moment?

  9. @Mike, I am not 100% sure, what might be  went wrong  in your scenario, it look like due to some unknown reason, session information is loosing from PowerShell Console, So verify whether you can workaround this issue by leveraging PowerShell CmdLet Get-AzurePublishSettingsFile. If this doesn't fix the issue, please open a support ticket with Microsoft ,so that we can have a investigation on this issue