Microsoft Azure Services Management Tools
November 2nd, 2008
A few months ago I’ve been working with my colleagues Mr. Angel "Java" Lopez, and Mr. Pablo "Lito" Damiani in the Azure Services Management Tools. I’m really proud to say I’ve been part of this project. We also has been supported by other Southies like Maximiliano Deboli , Sebastian Iacomuzzi, Edgardo Rossetto, Pablo Costantini, Matias Woloski and Paulo Arancibia (our UX great master).
During this project we created a set of tool for enable easy management of the new Microsoft’s Azure Services. Windows Azure Services Platform has been just announced at Microsoft PDC as the Microsoft’s processing platform on the clouds. Now cloud computing takes the center stage.
We could quickly say that Azure is an Software as a Service Platform, that runs on Microsoft Infrastructure.
The Azure Services Management tools that we created allow to manage SQL Data Services, an storage on the clouds, and .NET Services including, Access Control and Workflow Services.
This tools include a set of Powershell Commandlets to work with Access Control, Workflow Services and SQL Data Services. We also include an unified Windows Management Console Snap-In as UI to work with this commandlets.
This tools has been used at PDC presentation: Identity Roadmap for Software + Services.
Resources
- Azure Services Management Tools + Source Code: http://code.msdn.microsoft.com/AzureManagementTools
- Windows Azure: http://www.microsoft.com/azure
- Windows Azure Developer Center: http://msdn.microsoft.com/en-us/azure/default.aspx
How To: LinqToSql from Windows PowerShell
June 26th, 2008
I think is very interesting…
In an Visual Studio Command Prompt, use sqlmetal tool to generate an C# wrapper file that will contain all the code you need to interact with your database, let’s supose PicturesDB. Notice I’ve added “/sprocs”, this means I also need the stored procedures.
\>sqlmetal /server:.\SQLEXPRESS /database:PeopleDB /sprocs /code:db.cs
Next step is to complie this file, to do this use the CS compiler. This compiles the db.cs file into an assembly called db.dll, accessible by PowerShell.
\>csc /target:libary db.cs
Now we have to load the assembly and use the generated class PeopleDB just like we do in C#. For this example we going to use an stored procedure called GetPeople.
[Reflection.Assembly]::LoadFile(’C:\db.dll’)
$conn = “server=.\SQLEXPRESS;database=PicturesDB;Trusted_Connection=true”
$db = new-object dbMovies($conn)
$result = $db.GetPeople()
$result | format-list
I think this can be useful for deployment scripts or data base tests.
Calling an SP from Windows PowerShell
June 16th, 2008
The next PowerShell code is an example to call an Stored Procedure from Windows PowerShell…
Write-Host “————————————————————”
Write-Host “DataScript Started…OK”
Write-Host “————————————————————”
$connectionString = “Server=localhost;DataBase=PictureDB;Integrated Security=SSPI”
$conn = new-Object System.Data.SqlClient.SqlConnection($connectionString)
$conn.Open()
Write-Host “Connection Opened…”
Write-Host “”
[int] $rowCount = 0
$cmd = new-Object System.Data.SqlClient.SqlCommand(”InsertPicture”, $conn)
$cmd.CommandType = [System.Data.CommandType]‘StoredProcedure’
$cmd.Parameters.Clear()
$cmd.Parameters.Add(”@PictureId”,
[System.Guid]::NewGuid().ToString()) | out-null
$cmd.Parameters.Add(”@Text”, “ISO Party”) | out-null
$cmd.Parameters.Add(”@SubmittedOn”, [System.DateTime]::Now) | out-null
$cmd.Parameters.Add(”@Image”,
[System.IO.File]::ReadAllBytes(”pictures/party001.jpg”)) | out-null
Write-Host “Inserting picture…”
$rowCount = $cmd.ExecuteNonQuery()
$cmd.Dispose()
Write-Host $rowCount “Rows acfected!”
$conn.Close()
$conn.Dispose()
Write-Host “”
Write-Host “Connection Closed.”
