Вы находитесь на странице: 1из 2

To Get Started Run CheckDependencies.cmd and it will setup your system and check for missing to ols.

During the run of the Dependency Checker we set your policy to RemoteSigned if i t is not because by default, PowerShell is set to a restricted policy that does not allow scripts to run. We reset this at the end of the DependencyChecker run to your previous setting. If you don't have PowerSell installed, you can download it at http://go.microsof t.com/fwlink/?LinkId=178870 You will need run the projects / solutions as Administrator. Tools Needed Windows Azure SDK Windows Azure Tools for Visual Studio - You can get this from the Web Platform In staller (http://www.microsoft.com/web/downloads/platform.aspx) or install it fro m http://msdn.microsoft.com/en-us/windowsazure/cc974146.aspx PowerShell Windows Azure Service Management CmdLets - This is only needed to run the deploym ent scripts (see below). You can get them here: http://code.msdn.microsoft.com/a zurecmdlets. Visual Studio 2008 SP1 Sql Server / Sql Express 2005 / 2008 .NET 3.5 SP1 Windows Identity Foundation - Needed for Claims based Authorization http://www.mi crosoft.com/downloads/details.aspx?FamilyID=eb9c345f-e830-40b8-a5fe-ae7a864c4d76 &displaylang=en Enterprise Library 5 (Included) WatiN - You will need to download and place in the Lib folder (http://watin.sourc eforge.net/) Microsoft Anti-Cross Site Scripting Library V3.1 - You will need to download and place in the Lib folder (http://go.microsoft.com/fwlink/?LinkId=197115) How to use the Deployment Scripts Overview In the zip file there is a Windows Azure project with a web role using ASP.NET a nd a Worker role. The project doesn't actually do anything because the point her e is just to illustrate the deployment process. There are two major issues that come up when you have to build and deploy your project. The first is updating an d managing your ServiceConfiguration file that points to the correct storage loc ation with your key. Normally you want this to point to using local development storage and not have to manage multiple files / entries. The second issue is tha t of the deployment itself. Where do you deploy the package and how do you make sure you do it consistently? Deploy.ps1 The key to the deployment is the commandlets and putting them together. The scri pt takes 4 arguments: build path, package name, service configuration file name and the service name. The build path is the path where your project builds your deployment package (C:\MyBuildPath). The package name is the file name for your package to upload to azure (mypackage.cspkg). The service configuration file nam e is your service configuration file for your project / package (ServiceConfigur ation.cscfg). The service name is the storage service name where you will upload your package (myservice). You also have to have an API certificate for your acc ount installed on your machine and get that for the script. You will also need y our subscription id which you can find on your account page on the Windows Azure Portal. The first part is to determine if the snap-ins for the commandlet are a dded and if not add them. After this, we get the hosted service for staging. You

could change this if you want to get it for production. If the deployment alrea dy exists we suspend it, then delete it. We then deploy the new package and run it. The Build Script The build script takes advantage of the MSBuild tasks shipped with the the Windo ws Azure Tools for Visual Studio. It also uses a RegEx task that we ship with ou r Windows Azure Guidance project. The RegEx tasks are used to manipulate the Ser vice Configuration file and replace the keys for data and diagnostic connection strings. You will see that there are property groups that you can replace with y our information. The EscAccountKey is there because some of the service keys con tain characters that you will need to escape (\) so that the RegEx can replace i t (like backslashes (/) and plus signs (+)). In the Deploy target we exec PowerS hell to run the deploy.ps1 file with all the required parameters we gathered fro m the build. Gotchas The one thing that you will have to do is if you are running 64 bit version of W indows and PowerShell is make sure that you are running the 32 bit version of MS Build and install the commandlets for 32 bit PowerShell. You will need to run th e 32 bit version of MSBuild because the targets file for Azure is in the x86 Pro gram Files folder. I included a set of build files that you can add to the Azure commandlets install directory in the setup\dependency_checker\scripts\tasks dir ectory. Then run installPSSnapIn-x86.cmd from a command / PowerShell prompt. To run the build to deploy you will need to replace all the elements for your ow n Azure account and run the deploy build: msbuild aexpense-azurestorage.msbuild /t:Deploy /p:BuildType=Debug (this is just an example and all other build files work this way)

Вам также может понравиться