azure-storage-file/src/File/FileRestProxy.php
public static function createFileService(
        $connectionString,
        array $options = []
    ) {
        $settings = StorageServiceSettings::createFromConnectionString(
            $connectionString
        );

        $primaryUri = Utilities::tryAddUrlScheme(
            $settings->getFileEndpointUri()
        );

        $secondaryUri = Utilities::tryAddUrlScheme(
            $settings->getFileSecondaryEndpointUri()
        );

        $fileWrapper = new FileRestProxy(
            $primaryUri,
            $secondaryUri,
            $settings->getName(),
            $options
        );

        // Getting authentication scheme
        if ($settings->hasSasToken()) {
            $authScheme = new SharedAccessSignatureAuthScheme(
                $settings->getSasToken()
            );
        } else {
            $authScheme = new SharedKeyAuthScheme(
                $settings->getName(),
                $settings->getKey()
            );
        }

        // Adding common request middleware
        $commonRequestMiddleware = new CommonRequestMiddleware(
            $authScheme,
            Resources::STORAGE_API_LATEST_VERSION,
            Resources::FILE_SDK_VERSION
        );
        $fileWrapper->pushMiddleware($commonRequestMiddleware);

        return $fileWrapper;
    }
public static function createFileService(
        $connectionString,
        array $options = []
    ) {
        $settings = StorageServiceSettings::createFromConnectionString(
            $connectionString
        );

        $primaryUri = Utilities::tryAddUrlScheme(
            $settings->getFileEndpointUri()
        );

        $secondaryUri = Utilities::tryAddUrlScheme(
            $settings->getFileSecondaryEndpointUri()
        );

        $fileWrapper = new FileRestProxy(
            $primaryUri,
            $secondaryUri,
            $settings->getName(),
            $options
        );

        // Getting authentication scheme
        if ($settings->hasSasToken()) {
            $authScheme = new SharedAccessSignatureAuthScheme(
                $settings->getSasToken()
            );
        } else {
            $authScheme = new SharedKeyAuthScheme(
                $settings->getName(),
                $settings->getKey()
            );
        }

        // Adding common request middleware
        $commonRequestMiddleware = new CommonRequestMiddleware(
            $authScheme,
            Resources::STORAGE_API_LATEST_VERSION,
            Resources::FILE_SDK_VERSION
        );
        $fileWrapper->pushMiddleware($commonRequestMiddleware);

        return $fileWrapper;
    }
Builds a file service object, it accepts the following
options:

- http: (array) the underlying guzzle options. refer to
http://docs.guzzlephp.org/en/latest/request-options.html for detailed available options
- middlewares: (mixed) the middleware should be either an instance of a sub-class that
implements {@see MicrosoftAzure\Storage\Common\Middlewares\IMiddleware}, or a
`callable` that follows the Guzzle middleware implementation convention

Please refer to
https://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string
for how to construct a connection string with storage account name/key, or with a shared
access signature (SAS Token).

@param string $connectionString The configuration connection string.
@param array  $options          Array of options to pass to the service
@return FileRestProxy