Benutzer:MovGP0/Azure/Infrastructure Services
aus Wikipedia, der freien Enzyklopädie
MovGP0 | Über mich | Hilfen | Artikel | Weblinks | Literatur | Zitate | Notizen | Programmierung | MSCert | Physik |
Azure Infrastructure Services
#As Admin
Install-Module Azure -Force -AllowClobber
Install-Module AzureRM -Force -AllowClobber
# when installation fails,
## go to 'cd $env:ProgramFiles\WindowsPowerShell\Modules' and delete Azure* directories
## update PSGet using 'Install-Module PowerShellGet'
# As User
Import-Module AzureRM
Get-Command -Module AzureRM
Authenticate to Azure with a certificateGet-AzurePublishSettingsFile
# log in to Azure
# download the '.publishsettings' file
# Import the '.publishsettings' file
Import-PublishSettingsFile 'C:\Scripts\.publishsettings'
Authenticate to Azure via Active DirectoryAdd-AzureAccount -Credential (Get-Credential)
Remove-AzureAccount
Manage Aure SubscriptionsGet-AzureSubscription
Get-AzureSubscription -Default # subscription that is used for new PS Sessions
Get-AzureSubscription -Current # currently set subscription
Get-AzureSubscription -SubscriptionName "" -ExtendedDetails
Select-AzureSubscription # switches to another Azure Subscription
Select-AzureSubscription -SubscriptionName "" -Default # sets the default subscription
Select-AzureSubscription -NoDefault # deletes the default
Select-AzureSubscription -SubscriptionName "" -Current # sets the current subscription
Select-AzureSubscription -NoCurrent # disconnects the subscription from the current PS Session
Subsriptions are managed in $cert = Get-Item Cert:\CurrentUser\My\[certificate thumbprint]
$subscriptionID = "[SubscriptionID]"
$localName = "[Subscription Name]"
Set-AzureSubscription -SubscriptionName $localName -SubscriptionId $subscriptionID -Certificate $ cert
|