by pbutlerm via Windows Azure Tribes on 7/1/2011 5:27:00 AM
The Azure Management API Cmdlets enable you to use PowerShell Cmdlets to manage your Azure projects. You can access this project from the following link: http://wappowershell.codeplex.com/
Working with the Azure Management API Cmdlets
1. Follow the instructions to install the Cmdlets
2. Installing a certificate is needed for executing the Cmdlets:
For creating the certificate follow this instructions: http://blogs.msdn.com/b/avkashchauhan/archive/2010/12/30/handling-issue-csmanage-cannot-establish-secure-connection-to-management-core-windows-net.aspx Viewing Certificates: http://windows.microsoft.com/en-US/windows-vista/View-or-manage-your-certificates
For creating the certificate follow this instructions: http://blogs.msdn.com/b/avkashchauhan/archive/2010/12/30/handling-issue-csmanage-cannot-establish-secure-connection-to-management-core-windows-net.aspx
Viewing Certificates: http://windows.microsoft.com/en-US/windows-vista/View-or-manage-your-certificates
Lessons Learned Install the certificate your are going to be using as the Azure Management API certificate in the computer you are using for Execution/development. If this is not done you will get errors like this one: Windows Azure PowerShell CMDLET returns "The HTTP request was forbidden with client authentication scheme 'Anonymous'" error message. Link: http://blogs.msdn.com/b/avkashchauhan/archive/2011/06/13/what-to-do-when-windows-azure-powershell-cmdlet-returns-quot-the-http-request-was-forbidden-with-client-authentication-scheme-anonymous-quot-error-message.aspx
Lessons Learned
Install the certificate your are going to be using as the Azure Management API certificate in the computer you are using for Execution/development. If this is not done you will get errors like this one: Windows Azure PowerShell CMDLET returns "The HTTP request was forbidden with client authentication scheme 'Anonymous'" error message. Link: http://blogs.msdn.com/b/avkashchauhan/archive/2011/06/13/what-to-do-when-windows-azure-powershell-cmdlet-returns-quot-the-http-request-was-forbidden-with-client-authentication-scheme-anonymous-quot-error-message.aspx
Developing and Debugging Recommendations
1. Closing the PowerShell Windows for Compiling
The PowerShell shell windows will lock the build and rebuild of the project because it using the Azure Management Cmdlets compiled libraries. You need to close any PowerShell window you may have open before Building the Azure Cmdlets project and for un-installation of the Cmdlets.
2. Streamline Testing
Create a text file with the variables and values, open a PowerShell window and copy and paste the variables. The variables will be available for the entire life of the window. Example:
$RolName = "WebRole1_IN_0" $RolName2= "WebRole1_IN_1" $Slot = "Production" $ServiceName = "Mydemo" $SubId = "6cad9315-45a8-3e4r4e-8bdc-3e3rfdeerrrf" $Cert = "C:\certs\AzureManagementAPICertificate.cer"
Reboot-RoleInstance -RoleInstanceName $RolName -Slot $Slot -SubscriptionId $SubId -Certificate $Cert -ServiceName $ServiceName
ReImage-RoleInstance -RoleInstanceName $RolName2 -Slot $Slot -SubscriptionId $SubId -Certificate $Cert -ServiceName $ServiceName
Visual studio Azure Management Cmdlets debugging Steps:
Running the Commands:
Happy Development and Debugging! Thanks to David Aiken for the PowerShell tips and tricks.
Original Post: Developing and Debugging Azure Management API CmdLets
The content of the postings is owned by the respective author. AzureFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on AzureFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.