- Install the Azure PowerShell console. For instructions, see How to install and configure Azure PowerShell.This customized console is configured to work with your Azure subscription. The Azure module is installed in the Program Files directory and is automatically imported on every use of the Azure PowerShell console.If you prefer to work in a different host program, such as Windows PowerShell ISE, be sure to use the Import-Module cmdlet to import the Azure module or use a command in the Azure module to trigger automatic importing of the module.
- Start Azure PowerShell with the Run as administrator option.
- Run the Set-ExecutionPolicy cmdlet to set the Azure PowerShell execution policy to
RemoteSigned. Enter Y (for Yes) to complete the policy change.PS C:\> Set-ExecutionPolicy RemoteSignedThis setting enables you to run local scripts that aren't digitally signed. (You can also set the execution policy toUnrestricted, which would eliminate the need for the unblock step later, but this is not recommended for security reasons.) - Run the
Add-AzureAccountcmdlet to set up PowerShell with credentials for your account.PS C:\> Add-AzureAccountThese credentials expire after a period of time and you have to re-run theAdd-AzureAccountcmdlet. As this e-book is being written, the time limit before credentials expire is 12 hours. - If you have multiple subscriptions, use the Select-AzureSubscription cmdlet to specify the subscription you want to create the test environment in.
- Import a management certificate for the same Azure subscription by using the
Get-AzurePublishSettingsFileandImport-AzurePublishSettingsFilecmdlets. The first of these cmdlets downloads a certificate file, and in the second one you specify the location of that file in order to import it. Important: Keep the downloaded file in a safe location or delete it when you're done with it, because it contains a certificate that can be used to manage your Azure services.PS C:\> Get-AzurePublishSettingsFile
PS C:\> Import-AzurePublishSettingsFile "" The certificate is used for a REST API call that detects the development machine's IP address in order to set a firewall rule on the SQL Database server.
Saturday, April 4, 2015
Configure Azure PowerShell
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment