我尝试将此添加到我的 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>
我在我的 ServiceConfiguration.Cloud.cscfg 文件中设置了配置设置:
<Role name="WorkerRole">
<ConfigurationSettings>
<Setting name="AZURE_STORAGE_ACCOUNT" value="<secret stuff>" />
</ConfigurationSettings>
</Role>
但是当我运行时出现以下错误cspack
:
CloudServices091 : The '/RoleEnvironment/CurrentInstance/Configur
ationSettings/ConfigurationSetting[@name='AZURE_STORAGE_ACCOUNT']/@value' is an
invalid xpath expression.