And*_*rio 10 configuration environment-variables azure
我尝试将其添加到我的ServiceDefinition.csdef文件中:
<WorkerRole ...><Runtime><Environment>
<Variable name="AZURE_STORAGE_ACCOUNT">
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/ConfigurationSettings/ConfigurationSetting[@name='AZURE_STORAGE_ACCOUNT']/@value" />
</Variable>
</Environment></Runtime></WorkerRole>
Run Code Online (Sandbox Code Playgroud)
我在ServiceConfiguration.Cloud.cscfg文件中设置配置设置:
<Role name="WorkerRole">
<ConfigurationSettings>
<Setting name="AZURE_STORAGE_ACCOUNT" value="<secret stuff>" />
</ConfigurationSettings>
</Role>
Run Code Online (Sandbox Code Playgroud)
但是当我运行时出现以下错误cspack:
CloudServices091 : The '/RoleEnvironment/CurrentInstance/Configur
ationSettings/ConfigurationSetting[@name='AZURE_STORAGE_ACCOUNT']/@value' is an
invalid xpath expression.
Run Code Online (Sandbox Code Playgroud)
你错过了那个设置的声明吗?我没有看到你的相应元素.csdef,比如<ConfigurationSettings><Setting name="AZURE_STORAGE_ACCOUNT"/></ConfigurationSettings>.你需要其中一个.csdef,然后你仍然希望你的.cscfg那个包括价值.
如果您使用的是Visual Studio,则在使用其属性视图时,它应该为您编辑这两个文件.(只需双击该角色,然后单击以获取配置设置并添加新设置.)
配置似乎是正确的。如果您能确保\xe2\x80\x99使用的是最新的SDK,那就更好了。Windows Azure SDK 1.5 及更高版本中提供了 xPath 功能。
\n\n此致,
\n\n明旭.
\n| 归档时间: |
|
| 查看次数: |
2084 次 |
| 最近记录: |