Friday, May 20, 2011

ACS : Powershell commands with Appfabriclabs / Proxy

The ACS team have just announced a set of Powershell commands for ACS.

See here.

Two small problems - they work for ACS but not for Appfabriclabs and ,secondly, they don't work for people who have to work behind a proxy.

Some quick changes to the provided VS project should have you running in no time.

For Appfabriclabs:

In Constants.cs


//public const string AcsHostName = "accesscontrol.windows.net";
public const string AcsHostName = "accesscontrol.appfabriclabs.com";


For the proxy:

In ServiceManagementWrapper.cs - just add the proxy code below.


private string GetTokenFromACS()
{
var client = new WebClient();

WebProxy proxy = new WebProxy("1.2.3.4", 1234);

proxy.BypassProxyOnLocal = true;
proxy.UseDefaultCredentials = true;

client.Proxy = proxy;

client.BaseAddress = string.Format("https://{0}.{1}", this.serviceNamespace,
Constants.AcsHostName);

...
}


Then rerun the startHere.cmd to update and install the plugin.

Enjoy!

No comments: