src/Common/ServicesBuilder.php
public function createServiceManagementService($connectionString)
    {
        $settings = ServiceManagementSettings::createFromConnectionString(
            $connectionString
        );

        $certificatePath = $settings->getCertificatePath();
        $httpClient = new HttpClient($certificatePath);
        $serializer = $this->serializer();
        $uri = Utilities::tryAddUrlScheme(
            $settings->getEndpointUri(),
            Resources::HTTPS_SCHEME
        );

        $serviceManagementWrapper = new ServiceManagementRestProxy(
            $httpClient,
            $settings->getSubscriptionId(),
            $uri,
            $serializer
        );

        // Adding headers filter
        $headers = [];

        $headers[Resources::X_MS_VERSION] = Resources::SM_API_LATEST_VERSION;

        $headersFilter = new HeadersFilter($headers);
        $serviceManagementWrapper = $serviceManagementWrapper->withFilter(
            $headersFilter
        );

        return $serviceManagementWrapper;
    }
public function createServiceManagementService($connectionString)
    {
        $settings = ServiceManagementSettings::createFromConnectionString(
            $connectionString
        );

        $certificatePath = $settings->getCertificatePath();
        $httpClient = new HttpClient($certificatePath);
        $serializer = $this->serializer();
        $uri = Utilities::tryAddUrlScheme(
            $settings->getEndpointUri(),
            Resources::HTTPS_SCHEME
        );

        $serviceManagementWrapper = new ServiceManagementRestProxy(
            $httpClient,
            $settings->getSubscriptionId(),
            $uri,
            $serializer
        );

        // Adding headers filter
        $headers = [];

        $headers[Resources::X_MS_VERSION] = Resources::SM_API_LATEST_VERSION;

        $headersFilter = new HeadersFilter($headers);
        $serviceManagementWrapper = $serviceManagementWrapper->withFilter(
            $headersFilter
        );

        return $serviceManagementWrapper;
    }
public function createServiceManagementService ( $ connectionString ) { $ settings = ServiceManagementSettings :: createFromConnectionString ( $ connectionString ) ; $ certificatePath = $ settings -> getCertificatePath ( ) ; $ httpClient = new HttpClient ( $ certificatePath ) ; $ serializer = $ this -> serializer ( ) ; $ uri = Utilities :: tryAddUrlScheme ( $ settings -> getEndpointUri ( ) , Resources :: HTTPS_SCHEME ) ; $ serviceManagementWrapper = new ServiceManagementRestProxy ( $ httpClient , $ settings -> getSubscriptionId ( ) , $ uri , $ serializer ) ; // Adding headers filter $ headers = [ ] ; $ headers [ Resources :: X_MS_VERSION ] = Resources :: SM_API_LATEST_VERSION ; $ headersFilter = new HeadersFilter ( $ headers ) ; $ serviceManagementWrapper = $ serviceManagementWrapper -> withFilter ( $ headersFilter ) ; return $ serviceManagementWrapper ; }
Builds a service management object.

@param string $connectionString The configuration connection string

@return IServiceManagement
Builds a service management object .