Code Sample: Management Service
Updated: June 19, 2015
Applies To: Azure
This sample illustrates how to use the Microsoft Azure Active Directory Access Control (also known as Access Control Service or ACS) Management Service. It consists of a single Visual Studio 2010 solution and six projects. One project, Common, contains a helper type that simplifies working with the Management Service. The other projects demonstrate how to work with different types of ACS entities. The code for this sample is located in the ManagementService subdirectory (C#\Management\ManagementService) of the Microsoft Azure Active Directory Access Control (ACS) Code Samples package.
To run this sample, you will need:
An account at the Azure homepage and an Access Control namespace.
Visual Studio 2010 (any version).
Running the Sample
To run the sample
Go to the Microsoft Azure Management Portal (https://manage.WindowsAzure.com), sign in, and then click Active Directory. (Troubleshooting tip: "Active Directory" item is missing or not available)
To create an Access Control namespace, click New, click App Services, click Access Control, and then click Quick Create. (Or, click Access Control Namespaces before clicking New.)
To manage an Access Control namespace, select the namespace, and then click Manage. (Or, click Access Control Namespaces, select the namespace, and then click Manage.)
This action opens the Access Control Service management portal.
Click Management Service and then click the default ManagementClient account. You will see a set of credentials that can be used to access the Management Service. In this sample, we will use the password credential.
To view the password, click Password.
Copy the password into your clipboard.
If you have not done so already, open the sample in Visual Studio.
In the Common project, open the SamplesConfiguration.cs file, and locate the following lines of code:
public const string ServiceNamespace = "...Copy Access Control Namespace..."; public const string ManagementServiceIdentityKey = "...Copy Management Service Password...";
Update the value of the ServiceNamespace field with the name of your Access Control namespace.
Update the value of the ManagementServiceIdentityKey field with the password value in your clipboard.
Build the solution.
With the ManagementServiceHelper configured, you can start any of the other projects. Each of the projects sends results to the console.