This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "/subscriptions/xxx/providers/Microsoft.Resources", | |
"namespace": "Microsoft.Resources", | |
"resourceTypes": [ | |
{ | |
"resourceType": "subscriptions", | |
"locations": [], | |
"apiVersions": [ | |
"2015-01-01", | |
"2014-04-01-preview" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: ************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To login to Azure Resource Manager | |
Login-AzureRmAccount | |
# To view all subscriptions for your account | |
Get-AzureRmSubscription | |
# To select a default subscription for your current session | |
Get-AzureRmSubscription –SubscriptionName “your sub” | Select-AzureRmSubscription | |
# To select the default storage context for your current session |