Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure configuration settings and Microsoft.WindowsAzure.CloudConfigurationManager

Apparently Microsoft.WindowsAzure.CloudConfigurationManager.GetSettings will start by looking in ServiceConfiguration.*.cscfg and then fall back to web.config and app.config.

But - what format should this be in web/app .config?

E.g. to get Microsoft.WindowsAzure.CloudConfigurationManager.GetSettings("Foo") to pick up from app.config what would the XML look like?

like image 720
Ryan Avatar asked Jul 18 '12 18:07

Ryan


People also ask

What feature is used to manage Windows Azure configuration options?

Use a cloud management gateway (CMG). The CMG provides a simple way to manage Configuration Manager clients on the internet. You deploy the service to an Azure subscription, and it connects to your on-premises infrastructure through the cloud management gateway connector point.

Can you use SCCM in Azure?

Support: Microsoft fully supports multiple SCCM in Azure configurations, such as Configuration Manager on an Azure VM or using an Azure VM to run different Configuration Manager site system roles with other roles running in the data center.

How do I access Azure Configuration Manager?

Start the Azure Services wizardOn the Home tab of the ribbon, in the Azure Services group, select Configure Azure Services. On the Azure Services page of the Azure Services Wizard: Specify a Name for the object in Configuration Manager. Specify an optional Description to help you identify the service.


2 Answers

It will just be an appSettings key/value.

<configuration>
  <appSettings>
    <add key="Foo" value="AzureSetting"/>
  </appSettings>
</configuration>
like image 72
SliverNinja - MSFT Avatar answered Nov 04 '22 07:11

SliverNinja - MSFT


You will need to add the settings to the ServiceDefinition.csdef and ServiceConfiguration.cscfg

ex: ServiceDefinition.csdef

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="WindowsAzure1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-05.1.7">
    <WebRole name="WebRole1" vmsize="Small">
        <ConfigurationSettings>
            <Setting name="Foo"/>
        </ConfigurationSettings>
        :
    </WebRole>
</ServiceDefinition>

ex: ServiceConfiguration.cscfg

<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzure1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="1" osVersion="*" schemaVersion="2012-05.1.7">
  <Role name="WebRole1">
    <Instances count="1" />
    <ConfigurationSettings>
        <Setting name="Foo" value="val"/>
    </ConfigurationSettings>
  </Role>
</ServiceConfiguration>
like image 41
kosmos.ebi Avatar answered Nov 04 '22 06:11

kosmos.ebi