Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7810973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:59:14+00:00 2026-06-02T03:59:14+00:00

I’m running a command line program (happens to be Redis) inside a Windows Azure

  • 0

I’m running a command line program (happens to be Redis) inside a Windows Azure Worker Role using ProgramEntryPoint as follows

  <WorkerRole name="Worker" vmsize="Small">
    <Runtime executionContext="limited">
      <Environment>
        <Variable name="ADDRESS">
          <RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/Endpoints/Endpoint[@name='Redis']/@address" />
        </Variable>
        <Variable name="PORT">
          <RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/Endpoints/Endpoint[@name='Redis']/@port" />
        </Variable>
      </Environment>
      <EntryPoint>
        <ProgramEntryPoint commandLine="redis-server.exe" setReadyOnProcessStart="true" />
      </EntryPoint>
    </Runtime>
    <Endpoints>
      <InternalEndpoint name="Redis" protocol="tcp" port="6379" />
    </Endpoints>
  </WorkerRole>

So far, so good (it works).
I now want to run a slave instance of the server in another WorkerRole

<WorkerRole name="SlaveWorker" vmsize="Small">
    <Runtime executionContext="limited">
      <EntryPoint>
        <ProgramEntryPoint commandLine="echo slaveof %ADDRESS% %PORT% | redis-server.exe -"   setReadyOnProcessStart="true" />
      </EntryPoint>
    </Runtime>    
    <Imports>
      <Import moduleName="Diagnostics" />
      <Import moduleName="RemoteAccess" />
    </Imports>
    <Endpoints>
      <InternalEndpoint name="Redis" protocol="tcp" port="6379" />
    </Endpoints>    
  </WorkerRole>

You can see I need to tell the slave server where its master is using IP address and port; something that I don’t know until Azure has allocated the network resources for that role. I’ve seen @smarx do something along these lines.

However I think there may be a couple of things wrong with this in my case

  1. I’m setting environment variables in one role and hoping to use them in another – not going to work.

  2. Even if the right data was available the way I need to pass it to the redis-server.exe is not recognized as a valid entry point with the echo at the beginning


  1. Is the only way to know the runtime IP address and Port of another
    worker role via code or is there a syntax I’m missing in the config
    file?
  2. If I manage to get the IP and Port, is the only way to make my
    command line work to push it to a powershell script or batch file?

Thanks for your thoughts.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:59:17+00:00Added an answer on June 2, 2026 at 3:59 am

    The only way one instance will know another’s IP address will be if a.) it programmatically grabs it, or b.) the other instance publishes it to a wellknown location (e.g. table storage). In your case, it might be easiest to just have the slave role run a startup task that accesses the RoleEnvironment (via Powershell perhaps) and sets an Environment variable with the IP Address of the master. If you do this as a ‘simple’ type, I believe it will run before your ProgramEntryPoint does (blocking) and you can just use the env var in your command line there.

    Couple thoughts here however:

    1. How are you handling multi-instance within a role? Are you only planning on running a single instance?
    2. Do you need two different roles? Why not a single role with 2 instances that decide via election which is master?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.