Skip to content

Instantly share code, notes, and snippets.

View devigned's full-sized avatar

David Justice devigned

View GitHub Profile
@devigned
devigned / get-started-azps-1-0-pre-sm.ps1
Last active October 9, 2015 17:49
Getting started Azure Preview 1.0 Service Management
# Import the Azure Service Management module
Import-Module Azure
# To login to Azure Service Management
Add-AzureAccount
# To list the your virtual machines
Get-AzureVM
@devigned
devigned / install-azps-1-0-pre.ps1
Last active October 9, 2015 17:49
Installing Azure Powershell 1.0 Preview PowerShellGet
# Install the Azure Resource Manager modules from PowerShell Gallery
Install-Module AzureRM
Install-AzureRM
# Install the Azure Service Management module from PowerShell Gallery
Install-Module Azure
@devigned
devigned / import-azps-1-0-pre.ps1
Created October 9, 2015 17:46
Importing Azure PowerShell 1.0 preview
# Import all of the AzureRM.* modules within the known semantic version range
Import-AzureRM
# Import a single AzureRM module
Import-Module AzureRM.Compute
# Import Azure Service Management
Import-Module Azure
@devigned
devigned / azcli-login-h.sh
Last active October 13, 2015 19:05
Login with Organizational or Microsoft Account
azure login -h
help: Log in to an Azure subscription using Active Directory.
help:
help: Usage: login [options]
help:
help: Options:
help: -h, --help output usage information
help: -v, --verbose use verbose output
help: -vv more verbose with debug output
help: --json use json output
@devigned
devigned / azcli-login-msa.sh
Last active October 13, 2015 19:37
Azure CLI v0.9.10 Microsoft Account Login
# Running Azure login will prompt the user to open the device login page and start polling
# for confirmation of login.
azure login
# info: Executing command login
# info: To sign in, use a web browser to open the page http://aka.ms/devicelogin. Enter the code #######
# to authenticate. If you're signing in as an Azure AD application, use the --username and --password parameters.
# info: Added subscription Visual Studio Ultimate with MSDN
# info: login command OK
@devigned
devigned / azcli-login-org.sh
Last active October 13, 2015 19:50
Azure CLI v0.9.10 Login Organizational Account
# Running Azure login with -u will prompt the user for their password
# and authenticate the Azure organizational account unless Multi-Factor
# Authentication is enabled. If Multi-Factor Authentication is enabled,
# the user will be prompted with the following error:
#
# error: Interactive login is required. Use 'azure login' to interactively login.
azure login -u your-username
# info: Executing command login
# Password: **************
@devigned
devigned / azcli-login-sp.sh
Last active October 13, 2015 20:28
Azure CLI v0.9.10 Service Principal Login
# Running Azure login with --service-principal is intended for use in automation
# scenarios and does not require an interactive login.
azure login --service-principal -u client-id -p secret --tenant [tenant-guid | domain]
# info: Executing command login
# info: Added subscription Visual Studio Ultimate with MSDN
# +
# info: login command OK
{
"id": "/subscriptions/xxx/providers/Microsoft.Resources",
"namespace": "Microsoft.Resources",
"resourceTypes": [
{
"resourceType": "subscriptions",
"locations": [],
"apiVersions": [
"2015-01-01",
"2014-04-01-preview"
@devigned
devigned / install-import-asps-1-0.ps1
Created November 16, 2015 19:21
Install and Import Azure PowerShell 1.0
# Install the Azure Resource Manager modules from PowerShell Gallery
Install-Module AzureRM
Install-AzureRM
# Install the Azure Service Management module from PowerShell Gallery
Install-Module Azure
# Import AzureRM modules for the given version manifest in the AzureRM module
Import-AzureRM
# To login to Azure Resource Manager
Login-AzureRmAccount
# You can also use a specific Tenant if you would like a faster login experience
# Login-AzureRmAccount -TenantId xxxx
# To view all subscriptions for your account
Get-AzureRmSubscription
# To select a default subscription for your current session