Configuring a Windows Azure Project
A Windows Azure project includes two configuration files: ServiceDefinition.csdef and ServiceConfiguration.cscfg. These files are packaged with your Windows Azure application and deployed to Windows Azure.
- The ServiceDefinition.csdef file contains the metadata that is required by the Windows Azure environment for the requirements of your application, including what roles it contains. This file also contains configuration settings that apply to all instances. These configuration settings can be read at runtime using the Windows Azure Service Hosting Runtime API. This file cannot be updated while your service is running in Windows Azure.
- The ServiceConfiguration.cscfg file sets values
for the configuration settings defined in the service definition file
and specifies the number of instances to run for each role. This file
can be updated while your service is running in Windows Azure.
The Windows Azure Tools for Microsoft Visual Studio provide
property pages that you can use to set configuration settings stored in
these files. To access the property pages, double-click the role
reference underneath the Windows Azure project in Solution Explorer, or
right-click the role reference and choose Properties, as shown in the following figure.
For information about the underlying schemas for the service definition and service configuration files, see the Windows Azure SDK Schema Reference. For more information about service configuration, see Configuring an Application.
The Windows Azure Managed Library provides classes for
interacting with the Windows Azure environment at runtime, including
reading configuration settings. For more information, see the Windows Azure Managed Library Reference.
Configuring Role Properties
The following figure shows the property pages for a web role.
The property pages for a worker role are similar, although there are a
few differences, pointed out in the following sections.
The June 2012 release also provides the Caching page, from which you can configure the Azure caching services that are in preview. For more information, see How to: Configure a Windows Azure In-Role Cache.
Configuration Page
On the Configuration page, you can set these properties:
Instances
Set the Instance count property to the number of instances the service should run for this role.
Set the VM size property to Extra Small, Small, Medium, Large, or Extra Large. For more information, see How to Configure Virtual Machine Sizes .
Startup Action (Web Role Only)
Set this property to specify that Visual Studio should
launch a web browser for either the HTTP endpoints or the HTTPS
endpoints, or both when you start debugging.
The HTTPS endpoint option is available only if you have already defined an HTTPS endpoint for your role. You can define an HTTPS endpoint on the Endpoints property page.
If you have already added an HTTPS endpoint, the HTTPS endpoint
option is enabled by default, and Visual Studio will launch a browser
for this endpoint when you start debugging, in addition to a browser for
your HTTP endpoint. This assumes that both startup options are enabled.
Diagnostics
By default, diagnostics is enabled for the Web role. The
Windows Azure project and storage account are set to use the local
storage emulator. When you are ready to deploy to Windows Azure, you can
click the builder button (…) to update the storage
account to use Windows Azure storage in the cloud. You can transfer the
diagnostics data to the storage account on demand or at automatically
scheduled intervals. For more information about Windows Azure
diagnostics, see Collecting Logging Data by Using Windows Azure Diagnostics.
Settings Page
On the Settings page, you can add
configuration settings for your service. Configuration settings are
name-value pairs. Code running in the role can read the values of your
configuration settings at runtime using classes provided by the Windows Azure Managed Library. Specifically, the GetConfigurationSettingValue method returns the value of a named configuration setting at runtime.
Configuring a Connection String to a Storage Account
A connection string is a configuration setting that
provides connection and authentication information for the storage
emulator or for a Windows Azure storage account. Whenever your code must
access Windows Azure storage services data – that is, blob, queue, or
table data – from code running in a role, you will have to define a
connection string for that storage account.
A connection string that points to a Windows Azure storage
account must use a defined format. For information about how to create
connection strings, see How to Configure Connection Strings in the Windows Azure SDK.
When you are ready to test your service against the Windows
Azure storage services, or when you are ready to deploy your service to
Windows Azure, you can change the value of any connection strings to
point to your Windows Azure storage account. Click (…), select Enter storage account credentials. Enter your account information that includes your account name and account key. In the Storage Account Connection String
dialog box, you can also indicate whether you want to use the default
HTTPS endpoints (the default option), the default HTTP endpoints, or
custom endpoints. You might decide to use custom endpoints if you have
registered a custom domain name for your service, as described in Registering Custom Domain Names for Blob Resources.
![]() |
---|
You must modify your connection strings to point to a Windows Azure storage account before you deploy your service. Failing to do this may cause your role not to start, or to cycle through the initializing, busy, and stopping states. |
Endpoints Page
A worker role can have any number of HTTP, HTTPS, or TCP
endpoints. Endpoints can be input endpoints, which are available to
external clients, or internal endpoints, which are available to other
roles that are running in the service.
- To make an HTTP endpoint available to external clients and Web
browsers, change the endpoint type to input, and specify a name and a
public port number. - To make an HTTPS endpoint available to external clients and Web
browsers, change the endpoint type to input, and specify a name, a
public port number, and a management certificate name.Note that before you can specify a management certificate, you must define the certificate on the Certificates property page.
- To make an endpoint available for internal access by other
roles in the cloud service, change the endpoint type to internal, and
specify a name and possible private ports for this endpoint.
Local Storage Page
You can use the Local Storage property
page to reserve one or more local storage resources for a role. A local
storage resource is a reserved directory in the file system of the
Windows Azure virtual machine in which an instance of a role is running.
For more information about how to work with local storage resources,
see How to Configure Local Storage Resources.
Certificates Page
On the Certificates page, you can
associate certificates with your role. The certificates that you add can
be used to configure your HTTPS endpoints on the Endpoints property page.
The Certificates property page adds
information about your certificates to your service configuration. Note
that your certificates are not packaged with your service; you must
upload your certificates separately to Windows Azure through the Windows Azure Platform Management portal.
To associate a certificate with your role, provide a name
for the certificate. You use this name to refer to the certificate when
you configure an HTTPS endpoint on the Endpoints property page. Next, specify whether the certificate store is Local Machine or Current User and the name of the store. Finally, enter the certificate's thumbprint. If the certificate is in the Current User\Personal (My)
store, you can enter the certificate's thumbprint by selecting the
certificate from a populated list. If it resides in any other location,
enter the thumbprint value by hand.
When you add a certificate from the certificate store, any
intermediate certificates are automatically added to the configuration
settings for you. These intermediate certificates must also be uploaded
to Windows Azure in order to correctly configure your service for SSL.
Any management certificates that you associate with your
service apply to your service only when it is running in the cloud. When
your service is running in the local development environment, it uses a
standard certificate that is managed by the compute emulator.
For more information about uploading your management certificates to Windows Azure, see How to Add a Management Certificate to a Windows Azure Subscription.
Virtual Network Page
On the Virtual Network page, you associate
a Windows Azure Connect token with your role. You must have activated
the token using the Management Portal. This will let you set up an IP
connection between the selected role and other computers that are
running applications outside Windows Azure. For more information about
Windows Azure Connect, see Using Windows Azure Connect to Create Virtual Networks
Configuring the Windows Azure Project
To configure settings that apply to an entire Windows Azure
project, you first open the shortcut menu for that project node, and
then you choose Properties to open its property pages. The following table shows those property pages.
Configuring a Windows Azure Project的更多相关文章
- [Windows Azure] Configuring and Deploying the Windows Azure Email Service application - 2 of 5
Configuring and Deploying the Windows Azure Email Service application - 2 of 5 This is the second tu ...
- [Windows Azure] How to use the Queue Storage Service
How to use the Queue Storage Service version 1.7 version 2.0 This guide will show you how to perform ...
- [Windows Azure] How to use the Table Storage Service
How to use the Table Storage Service version 1.7 version 2.0 This guide will show you how to perform ...
- [Windows Azure] How to use the Windows Azure Blob Storage Service in .NET
How to use the Windows Azure Blob Storage Service in .NET version 1.7 version 2.0 This guide will de ...
- Windows Azure入门教学系列 (三):创建第一个Worker Role程序
在开始本教学之前,请确保你从Windows Azure 平台下载下载并安装了最新的Windows Azure开发工具.本教学使用Visual Studio 2010作为开发工具. 步骤一:创建解决方案 ...
- [转]探索 Windows Azure Storage
本文转自:https://msdn.microsoft.com/zh-tw/jj573842 概觀 儲存服務 (Storage services) 在 Windows Azure 運算模擬器中提供了可 ...
- [书目20140902]实战Windows Azure——微软云计算平台技术详解 --徐子岩
目录第1章 云计算技术简介 1.1 云计算所要解决的问题 1.2 云计算平台的分类 1.3 微软云计算平台Windows Azure 1.3.1 高可用性 ...
- Windows Azure中文博客 Windows Azure入门教学系列 (一): 创建第一个WebRole程序
http://blogs.msdn.com/b/azchina/ 本文转自:http://blogs.msdn.com/b/azchina/archive/2010/02/09/windows-azu ...
- [Windows Azure] Using the Graph API to Query Windows Azure AD
Using the Graph API to Query Windows Azure AD 4 out of 4 rated this helpful - Rate this topic This d ...
随机推荐
- CSRF - 空Referer绕过
在实际环境中,服务器很多CGI由于一些历史原因,必须允许空Referer的请求.比如:老的客户端版本请求的时候就没有Referer,总不能在服务端一刀切,让老版本的用户都无法正常使用了吧. 这样的CG ...
- 一篇文章,读懂 Netty 的高性能架构之道
原文 Netty是一个高性能.异步事件驱动的NIO框架,它提供了对TCP.UDP和文件传输的支持,作为一个异步NIO框架,Netty的所有IO操作都是异步非阻塞的,通过Future-Listener机 ...
- Ehcache 使用
自从Ehcache 到了1.2+的版本,就支持分布式缓存了 Spring + Hibernate的结构 ,ehcache的对这几个框架的支持较好,就采用这个缓存方案 下面是配置文件: <ehca ...
- 开发WebApp之PC客户端
HTML5的跨平台性还是很好的,苹果.Android手机都可以用,所在最近使用Jquery Mobile开发了一个手机端应用程序,一次开发,多个平台使用. 但我们的很多客户使用的是还是IE浏览器,有的 ...
- Xcode 文档注释方法
摘自:http://www.cnblogs.com/bomo/p/4815963.html 文档注释,可以在调用时显示注释信息,让调用者更好的理解方法的用途. 注释方法: /// 注释 和 /** 注 ...
- Intellij IDEA IDE部署Servlet项目
1.设置Project Structure 2.修改Modules中的Web项目文件默认class编译之后输出位置 3.给Modules中的Web项目添加Web模块 4.修改Web项目Web.xml文 ...
- Spring3系列4-多个配置文件的整合
Spring3系列4-多个配置文件的整合 在大型的Spring3项目中,所有的Bean配置在一个配置文件中不易管理,也不利于团队开发,通常在开发过程中,我们会按照功能模块的不同,或者开发人员的不同,将 ...
- PLSQL登录弹出空白框如何解决
转自:http://jingyan.baidu.com/article/066074d6760959c3c21cb0d6.html 出现登录弹出空白框这是由于win7的安全性提高了,在PLSQL ...
- 气球或者泡泡向上飘动 jQuery插件
圣诞.元旦要来了,公司以往基本每个月至少要搞一两款手机小游戏来宣传产品,这次也不例外!! 之前做过,按压柚子.许愿.吃柚子等等小游戏,这次是做个那种 气球向上飘动,戳破气球,随机获取奖品.如下图: 手 ...
- 使用B或BL跳转时,下一条指令的地址是这样计算的
B跳转指令:它是个相对跳转指令,其机器码格式如下: [31:28]位是条件码:[27:24]位为“1010”(0xeaffffff)时,表示B跳转指令,为“1011”时,表示BL跳转指令:[23:0] ...