According to your description, I assumed that you could leverage Microsoft Azure Management Libraries to retrieve the configuration settings, you could follow the steps below:
I created a console application and reference the Microsoft Azure Management Libraries, here is the core code:
private static X509Certificate2 GetStoreCertificate(string thumbprint)
{
List<StoreLocation> locations = new List<StoreLocation>
{
StoreLocation.CurrentUser,
StoreLocation.LocalMachine
};
foreach (var location in locations)
{
X509Store store = new X509Store("My", location);
try
{
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
X509Certificate2Collection certificates = store.Certificates.Find(
X509FindType.FindByThumbprint, thumbprint, false);
if (certificates.Count == 1)
{
return certificates[0];
}
}
finally
{
store.Close();
}
}
throw new ArgumentException(string.Format(
"A Certificate with Thumbprint '{0}' could not be located.",
thumbprint));
}
static void Main(string[] args)
{
CertificateCloudCredentials credential = new CertificateCloudCredentials("{subscriptionId}", GetStoreCertificate("{thumbprint}"));
using (var computeClient = new ComputeManagementClient(credential))
{
var result = computeClient.HostedServices.GetDetailed("{your-cloudservice-name}");
var productionDeployment=result.Deployments.Where(d => d.DeploymentSlot == DeploymentSlot.Production).FirstOrDefault();
}
Console.WriteLine("press any key to exit...");
Console.ReadKey();
}
You could retrieve the configuration settings from productionDeployment.Configuration
as follows:
