Share python source code files between Azure Worker Roles in the same project
<p>I have a single Azure Cloud Service as a project in Visual Studio 2015, which contains 2 Python Worker Roles.</p>

<p>They each have their own folder with source code files, and they are deployed to separate VMs. However, they both rely on some identical pieces of code. Right now my solution is to just include a copy of the code in each worker role, but then I have to remember to apply changes to both worker roles in case of a bug fix.</p>

<p>I have tried making a folder on the project level, containing the shared files, but when I add them to the worker role, VS just copies the files.</p>

<p>Is there a way to implement something like a shared folder, which only copies the files upon building the project?</p>

<p>Likely many ways to solve your problem, but specifically from a worker role standpoint: Worker (and web) roles have definable startup tasks, allowing you to execute code/script during role startup. This allows you to do things like copying content from blob storage to local disk on your role instance. In this scenario, the blob where your code is stored acts like a shared disk.</p>

python azure azure-worker-roles azure-cloud-services