Last active
August 29, 2015 14:21
-
-
Save TianyuanC/f87af3510fdb4492857c to your computer and use it in GitHub Desktop.
Enable diagnostics for Cloud Services using SDK 2.5
This file contains hidden or 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
| ## Input from Octopus | |
| ## $AzureModules "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1" | |
| ## $PublishSettingsLocation "pathto\credentials.publishsettings" | |
| ## $SubscriptionIdentifier | |
| ## $DeploymentStorageAccount | |
| ## $DeploymentStorageKey | |
| ## $ConfigPath | |
| ## $CloudServiceName | |
| ## Get Powershell modules | |
| Import-Module $AzureModules | |
| ## Load the pushlish settings file | |
| Import-AzurePublishSettingsFile $PublishSettingsLocation | |
| Select-AzureSubscription -SubscriptionId $SubscriptionIdentifier | |
| ## configure storage account $DeploymentStorageAccount | |
| $storageContext = New-AzureStorageContext -StorageAccountName $DeploymentStorageAccount -StorageAccountKey $DeploymentStorageKey | |
| ## Turn on diagnostics | |
| Write-Host "Running enable diagnostics for $CloudServiceName" | |
| Set-AzureServiceDiagnosticsExtension -StorageContext $storageContext -DiagnosticsConfigurationPath $ConfigPath -ServiceName $CloudServiceName -Slot "Production" -Verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment