azure展開がステージングURLを入手することができると完了したイベントはありますか？これはVisual Studio 2010で可能ですが、どちらでも私を方向に指しているのであれば？
I would like to automate the process of running a test application on my development machine after a deployment to Azure has completed.
I am publishing from Visual Studio and would like to pass the staging URL to my test application.
Is there an event that the Azure deployment has completed that I could hook into get the staging URL? Is this possible in Visual Studio 2010 and if so can anyone point me in the direction?</div
It maybe simpler to built into your test-app, code that figures out the staging URL for your deployment. This is done by: 1) Using Azure Service Management API with correct certificate 2) Examining Deployment list and looking at the DeploymentId of the Staging deployment. The DeploymentId + cloudapp.net is the url.</div
You can use the
OnStart method of your
WebRole (the class that extends
RoleEntryPoint). To get the staging URL, you can use
RoleEnvironment.DeploymentId. Using that, you can format a string to get the staging URL:
Be careful what you do in this method though, because when it runs, your web.config will not be loaded yet. If there are any configuration variables you need during this method, you need to get them from the cloud configuration settings.
The RoleEnviroment.DeploymentId is a static property, so you might be able to get it after the app is running (i.e. during Global.asax Application_Start) rather than during WebRole.OnStart. Be careful if you do though, because this code may re-run after an app pool recycle, whereas the OnStart may re-run after an instance reboot.</div