Presented in PowerShell Saturday #009 and 4th PowerShell Saturday in Singapore. This session is about Microsoft Azure and how you can use PowerShell to gradually help manage your services in Azure.
2. Who is this guy?
Milton Goh
Developer / Systems Engineer at Dimension Data
Microsoft Community Contributor (MCC – TechNet)
Geek who loves meddling with technology… Especially… Power…. Shell….
Runs a blog that share a little about everything I do at www.miltongoh.com
Tweet at @miltongoh
7. What is Azure?
Comprehensive set of services
that enable you to quickly build,
deploy and manage applications
across a global network of
Microsoft-managed datacenters.
9. Managing Azure…
You can manage Microsoft Azure via the following:
REST APIs
Command Line Tools
Windows (PowerShell)
Linux (Bash)
Mac (Bash)
10. PowerShell… What can be manage?
By using PowerShell, you can manage the following:
Affinity Groups
Certificates
Cloud Services
Subscriptions
Storage Accounts
Service Bus
SQL Databases
Virtual Networks
Virtual Machines
Web Sites
11. PowerShell… What can be done?
Query, Manage and Configure Virtual Machines across multiple subscriptions,
cloud services and storage accounts.
Manage SQL Databases, Configuration, Diagnostics, Deployments, and Azure assets (Affinity Groups, Storage Accounts, Keys, etc..)
12. Getting Started with Azure Subscription
Credentials in PowerShell
1) Download the Microsoft Azure PowerShell Management Tools via
http://mspro.sg/AzurePowerShellMgmtTools (Direct Link) or http://mspro.sg/AzureDownload
13. Getting Started with Azure Subsciption
Credentials in PowerShell
2) Set execution policy on your local computer
3) Import Azure PowerShell Script Module
Import-Module Azure.psd1
Alternatively, you may want to launch the “Windows Azure PowerShell” instead of the normal
“Windows PowerShell” in order to skip this step.
14. Getting Started with Azure Subsciption
Credentials in PowerShell
4) Download Azure Publisher Settings File
Get-AzurePublishSettingsFile
** Note ** This command will launch your browser and direct you to the Microsoft Azure Portal to sign in (if you are not signed in) to
download the certificate.
Example of the downloaded file:
15. Getting Started with Azure Subsciption
Credentials in PowerShell
5) Import the downloaded publishSettings file using the following command.
Import-AzurePublishSettingsFile
** Note ** You may also change the subscription accordingly.
16. Azure Web Sites + PowerShell
1) Create new Azure Web Site
New-AzureWebsite –Name “Name of Website” –Location “Southeast Asia”
2) Create new Azure Service
New-AzureService –ServiceName “Name of Service” –Label “MyTestService” –Location
“Southeast Asia”
17. Azure Virtual Machine + PowerShell
1) First Virtual Machine in a NEW Cloud Service (-Location specified)
New-AzureQuickVM -Windows -ServiceName “ServiceName” -Name “TestVM” -ImageName
“Name of Image” -Location “Southeast Asia” -Password “youshouldnotknow”
2) New Virtual Machine in an Existing Cloud Service (no –Location)
New-AzureQuickVM -Windows -ServiceName “ServiceName” -Name “TestVM” -ImageName
“Name of Image” -Password “youshouldnotknow”
3) Creating a Linux Virtual Machine in an Existing Cloud Service
New-AzureQuickVM -Linux -ServiceName “ServiceName” -Name “TestVM” -ImageName “Name
of Image” -LinuxUser “admin” -Password “youshouldnotknow”
18. Azure Virtual Machine + PowerShell
1) Retrieve Cloud Services
Get-AzureService
2) Retrieve Virtual Machines for Service
Get-AzureVM -ServiceName “Cloud Service Name”
3) Retrieve Status for All VMs in Subsription
Get-AzureService | foreach {
$_ | Get-AzureVM | ft ServiceName, Name, InstanceStatus
}
26. To get you started with PowerShell on
Azure…
Hit http://mspro.sg/azurescriptcenter Now!
27. New-Question –Target “Audience”
Get-Answer
Thank you for listening to my ranting…
Brought to you by Singapore PowerShell User Group
Do you know about PowerShell Breakfast / PoSHBreakfast? Check out www.poshbreakfast.com NOW!
Editor's Notes
Switch window to play the following video – 01_Azure_Website_CreateWebsite and 04_Azure_PowerShell_CreateWebsite
Switch window to play the following video – 03_Azure_Website_CreateVM and 04_Azure_PowerShell_CreateVM