是否可以在ServiceDefinition.csdef xml文件本身內部使用環境變量?在xml中使用環境變量(在Azure ServiceDefinition xml中)
我試圖做到這一點:
<ServiceDefinition name="MyService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0">
<WorkerRole name="MyService" vmsize="Small">
<Startup>
<Task commandLine="Create.cmd config_%DeploymentId%" executionContext="elevated" taskType="simple" >
<Environment>
<Variable name="DeploymentId">
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/ConfigurationSettings/ConfigurationSetting[@name='DeploymentId']/@value" />
</Variable>
</Environment>
</Task>
...
的create.cmd批量接收參數字符串,沒有得到與實際部署的ID值替換。
是否有可能實現這一目標?