ImageStoreUtility.GenerateSfpkg(String, String, Boolean, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a 'sfpkg' file from the application package found in the specified application package root directory.
public static string GenerateSfpkg (string appPackageRootDirectory, string destinationDirectory, bool applyCompression = true, string sfpkgName = default);
static member GenerateSfpkg : string * string * bool * string -> string
Public Shared Function GenerateSfpkg (appPackageRootDirectory As String, destinationDirectory As String, Optional applyCompression As Boolean = true, Optional sfpkgName As String = Nothing) As String
Parameters
- appPackageRootDirectory
- String
The application package root directory. It must exist.
- destinationDirectory
- String
The folder where the sfpkg file is placed. If it doesn't exist, it is created.
- applyCompression
- Boolean
If true, the package is
compressed
before generating the sfpkg, inside appPackageRootDirectory
.
If the package is already compressed, no changes are made. To compress, the appPackageRootDirectory must allow write access.
If false, the sfpkg is generated using the application package as it is, either compressed or uncompressed. Default: true.
- sfpkgName
- String
The name of the sfpkg file.
Returns
The path to the sfpkg file. Can be used to expand the sfpkg using ExpandSfpkg(String, String).
Remarks
If sfpkgName is not specified or null, the generated package takes the name of the application package root folder, adding the '.sfpkg' extension. If the specified name has no extension or a different extension, the extension is replaced with '.sfpkg'.
The destination directory can't be same or a child of the application package root directory, as extraction will fail.
No validation is performed to ensure the package is valid. Please test the package before generating the sfpkg.
The sfpkg can be uploaded to an external store and used for provisioning.
To expand the sfpkg to see the original content, use ExpandSfpkg(String, String)
Applies to
Azure SDK for .NET