Skip to content

Instantly share code, notes, and snippets.

@TianyuanC
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save TianyuanC/f87af3510fdb4492857c to your computer and use it in GitHub Desktop.

Select an option

Save TianyuanC/f87af3510fdb4492857c to your computer and use it in GitHub Desktop.
Enable diagnostics for Cloud Services using SDK 2.5
## 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