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
var ctx = new Microsoft.WindowsAzure.Storage.Table.DataServices.TableServiceContext(table.ServiceClient); | |
var query = ctx.CreateQuery<BlogPostTableServiceEntity>("ChronoTableStorageSample") | |
.Where(QueryDateReverseChronologicalComparisons.After, | |
DateTime.Parse("2012-12-10 00:00:00")); | |
foreach (var blogPost in query) | |
{ | |
Console.WriteLine("{0:yyyy-MM-dd}: {1}", blogPost.PublishedOn, blogPost.Title); | |
} |
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
public static class BlogReader | |
{ | |
public static IEnumerable<Model.BlogPost> Read() | |
{ | |
using (var rdr = System.Xml.XmlReader.Create("http://blogs.msdn.com/b/windowsazure/rss.aspx")) | |
{ | |
foreach (var item in SyndicationFeed.Load(rdr).Items) | |
{ | |
yield return new Model.BlogPost() | |
{ |
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
# Remove RDP endpoints from VMs in cloud service | |
Get-AzureVM -ServiceName myservice | Remove-AzureEndpoint -Name RemoteDesktop | |
| Update-AzureVM | |
# Add RDP endpoints to all VMs in cloud service | |
Get-AzureVM -ServiceName myservice | Add-AzureEndpoint -Name RemoteDesktop -LocalPort 3389 -Protocol tcp | |
| Update-AzureVM |
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
$user = Get-WMIObject Win32_UserAccount -Filter "Name='Administrator'" | |
$username = -join ([Char[]]'abcdefghijklmnopqrstuvwxyz._-~´`àéèç' | Get-Random -count 15) | |
$user.Rename($username) |
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
// Example 1: Simply updating an entity does not work if not calling UpdateObject | |
string tableName = "testupdate"; | |
string partition = "Customers"; | |
client.GetTableReference(tableName) | |
.CreateIfNotExists(); | |
var rowKey = DateTime.Now.ToString("HHmmss"); | |
// User A creates customer. |
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
Import-AzurePublishSettingsFile 'C:\...' | |
Select-AzureSubscription -SubscriptionName ... | |
# Import normal endpoints. | |
$vm = Get-AzureVM MyVirtualMachine | |
.\Import-AzureEndpointsFromCSV.ps1 $vm Normal-Endpoints.csv NoLB | |
# Import load-balanced endpoints. | |
$vm = Get-AzureVM MyLoadBalancedCloudSvc | |
.\Import-AzureEndpointsFromCSV.ps1 $vm[0] LB-Endpoints.csv LoadBalanced |
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
# Arguments. | |
param | |
( | |
[Microsoft.WindowsAzure.Management.ServiceManagement.Model.PersistentVMRoleContext]$vm = $(throw "'vm' is required."), | |
[string]$csvFile = $(throw "'csvFile' is required."), | |
[string]$parameterSet = $(throw "'parameterSet' is required.") | |
) | |
Get-ChildItem "${Env:ProgramFiles(x86)}\Microsoft SDKs\Windows Azure\PowerShell\Azure\*.dll" | ForEach-Object {[Reflection.Assembly]::LoadFile($_) | out-null } | |
# Add endpoints without loadbalancer. |
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
Install-FTPServer.cmd "passiveftp" "C:\FtpServer" 2500 10000 10125 168.63.28.123 |
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
REM Variables. | |
SETLOCAL EnableDelayedExpansion | |
SET FtpSiteName=%1% | |
SET FtpDirectory=%2% | |
SET PublicPort=%3% | |
SET DynamicPortFirst=%4% | |
SET DynamicPortLast=%5% | |
SET DynamicPortRange=%DynamicPortFirst%-%DynamicPortLast% | |
SET PublicIP=%6% |
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
Import-AzurePublishSettingsFile 'C:\...' | |
Select-AzureSubscription -SubscriptionName ... | |
$vm = Get-AzureVM passiveftp | |
Add-AzureFtpEndpoints.ps1 $vm 2500 10000 10125 |