Skip to content

Commit e66fb5a

Browse files
committed
Removing binary dependencies for telemetry
This reverse engineers the REST API for Application Insights so that we no longer need to download / depend on the 3 .dll files that were necessary to use the Application Insights .NET SDK. This is directly benefitting from the work that was done for PowerShellForGitHub (see microsoft/PowerShellForGitHub#186)
1 parent f18939e commit e66fb5a

File tree

4 files changed

+263
-394
lines changed

4 files changed

+263
-394
lines changed

Documentation/SETUP.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ potential confusion. At a high level, all you're doing is:
5757
The following section describes how to configure your system for use with StoreBroker,
5858
and lists the available options for installing the module contents.
5959

60-
### ExecutionPolicy
60+
### ExecutionPolicy
6161

6262
Update the `PowerShell ExecutionPolicy` to be `RemoteSigned` (which means
6363
that PowerShell scripts that are local to your machine don't need to be signed in order to execute).
@@ -165,12 +165,6 @@ StoreBroker has a dependency on dll's from the following NuGet packages:
165165
WindowsAzure.Storage v8.1.1: Microsoft.WindowsAzure.Storage.dll
166166
Microsoft.Azure.Storage.DataMovement v0.5.1: Microsoft.WindowsAzure.Storage.DataMovement.dll
167167

168-
**For [Telemetry](USAGE.md#telemetry)**
169-
170-
Microsoft.ApplicationInsights v2.0.1: Microsoft.ApplicationInsights.dll"
171-
Microsoft.Diagnostics.Tracing.EventSource.Redist v1.1.24: Microsoft.Diagnostics.Tracing.EventSource.dll
172-
Microsoft.Bcl.Async v1.0.168.0: Microsoft.Threading.Tasks.dll
173-
174168
During execution of a command, when StoreBroker has need for an object from one of these dll's,
175169
if it cannot find the dll, it will automatically download nuget.exe, then download the nuget
176170
package that the assembly is in, and finally cache it for the duration of your PowerShell session.
@@ -205,7 +199,7 @@ To initially configure StoreBroker with your Developer Account:
205199

206200
2. You must [associate your AAD with your Dev Center account](https://msdn.microsoft.com/windows/uwp/monetize/create-and-manage-submissions-using-windows-store-services#associate-an-azure-ad-application-with-your-windows-dev-center-account)
207201
to obtain the credentials to allow StoreBroker to access your account and perform actions on
208-
your behalf.
202+
your behalf.
209203

210204
3. The app you want to publish must already exist. The Windows Store Submission API can only
211205
publish updates to existing applications. You can
@@ -217,7 +211,7 @@ To initially configure StoreBroker with your Developer Account:
217211
submission, the Update attempt will fail.
218212

219213

220-
> These prerequisites come directly from the
214+
> These prerequisites come directly from the
221215
> [API Documentation](https://msdn.microsoft.com/windows/uwp/monetize/create-and-manage-submissions-using-windows-store-services).
222216
> Refer to that documentation for additional prerequisites.
223217
@@ -248,10 +242,10 @@ To get those values:
248242
account, and assign it the **Manager** role. If this application already exists in your AAD,
249243
you can select it on the **Add Azure AD applications** page to add it to your Dev Center account.
250244
Otherwise, you can create a new AAD application on the **Add Azure AD applications** page.
251-
For more information, see [Add and manage Azure AD applications](https://msdn.microsoft.com/windows/uwp/publish/manage-account-users#add-and-manage-azure-ad-applications).
245+
For more information, see [Add and manage Azure AD applications](https://msdn.microsoft.com/windows/uwp/publish/manage-account-users#add-and-manage-azure-ad-applications).
252246

253247
3. Return to the **Manage users** page, click the name of your Azure AD application to go to the
254-
application settings, and copy the **Tenant ID** and **Client ID** values.
248+
application settings, and copy the **Tenant ID** and **Client ID** values.
255249

256250
4. Click **Add new key**. On the following screen, copy the **Key** value, which corresponds to the
257251
**Client secret**. You *will not* be able to access this info again after you leave this page,
@@ -292,12 +286,12 @@ One way to do this would be the following:
292286
3. Now you can store the password somewhere on disk securely. Doing this will encrypt the
293287
password into a plain-text file, and only the same user logged-in to the exact same computer
294288
will be able to decrypt it.
295-
289+
296290
$cred.Password | ConvertFrom-SecureString | Set-Content -Path (Join-Path -Path ([System.Environment]::GetFolderPath('MyDocuments')) -ChildPath 'clientSecret.txt')
297291

298292
4. When you want to create the credentials yourself later on and authenticate (being sure to
299293
replace `<tenantId>` and `<clientId>` with the proper values):
300-
294+
301295
$clientSecret = Get-Content -Path (Join-Path -Path ([System.Environment]::GetFolderPath('MyDocuments')) -ChildPath 'clientSecret.txt') | ConvertTo-SecureString
302296
$cred = New-Object System.Management.Automation.PSCredential "<clientId>", $clientSecret
303297
Set-StoreBrokerAuthentication -TenantId <tenantId> -Credential $cred
@@ -348,7 +342,7 @@ That setting (being configured to use the proxy) will be stored for the duration
348342
> the profile for you. Then, just add those 3 lines of code from Step 4 into your profile.
349343
350344
To stop authenticating with the proxy, at any time simply close your PowerShell console window, or
351-
call:
345+
call:
352346

353347
Clear-StoreBrokerAuthentication
354348

@@ -403,7 +397,7 @@ started by generating your app's PDP files based on your current published submi
403397

404398
Where:
405399
* `<appId>` is your app's ID.
406-
400+
407401
* `<release>` is the name of this release. Many teams name their releases as `YYMM`
408402
(depending on how often they release). This value will be added to each of the PDP's that are
409403
generated, and will impact the expected location of the screenshots being referenced. More on
@@ -453,7 +447,7 @@ Every project should have its own StoreBroker config file. The config file has
453447
dynamically during your build from a localization service/process, leave both blank and
454448
only specify `PDPRootPath` at the commandline so that you can use environment variables
455449
to reference the local path, and move on to "**ii**".
456-
450+
457451
Otherwise, it's necessary for you to provide the path that the PDP's can be found.
458452
You'll do this with a combination of these two config values. The general idea
459453
is that you have a root folder for PDP's that contains sub-folders named after each
@@ -480,7 +474,7 @@ Every project should have its own StoreBroker config file. The config file has
480474
be updated with the most recent PDP's, use the first method. If you _will_ be using
481475
release-named sub-folders to organize your PDP's, then you may wish to use the second
482476
option, and you can either choose to update your config file with the new release name
483-
every time it changes, or provide it at the commandline instead. Your choice.
477+
every time it changes, or provide it at the commandline instead. Your choice.
484478

485479
> Remember that you have to escape any backslashes used in the config file.
486480
@@ -508,11 +502,11 @@ Every project should have its own StoreBroker config file. The config file has
508502
Screenshot2.png
509503

510504
you would specify `\\share\MyApp\Images\` as your `ImagesRootPath`, and your PDP file
511-
would set `201605` as the `Release` attribute (at the very top of the file).
505+
would set `201605` as the `Release` attribute (at the very top of the file).
512506
`New-SubmissionPackage` would then combine those together at runtime to get the
513507
full path to these images.
514508

515-
> Remember that you have to escape any backslashes used in the config file.
509+
> Remember that you have to escape any backslashes used in the config file.
516510
517511
vi. `AppxPath` - Follow the guidance in the help comments to correctly specify where the appx
518512
packages for your app will be found. Since this is likely part of your build output, you'll
@@ -575,7 +569,7 @@ started by generating your IAP's PDP files based on your current published (or p
575569

576570
Where:
577571
* `<iapId>` is your IAP's ID.
578-
572+
579573
* `<release>` is the name of this release. Many teams name their releases as `YYMM`
580574
(depending on how often they release). This value will be added to each of the PDP's that are
581575
generated, and will impact the expected location of the screenshots being referenced. More on

StoreBroker/Helpers.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ function Get-HttpWebResponseContent
945945
{
946946
$content = $null
947947

948-
if ($WebResponse.ContentLength -gt 0)
948+
if (($null -ne $WebResponse) -and ($WebResponse.ContentLength -gt 0))
949949
{
950950
$stream = $WebResponse.GetResponseStream()
951951
$encoding = [System.Text.Encoding]::UTF8

StoreBroker/StoreBroker.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
CompanyName = 'Microsoft Corporation'
77
Copyright = 'Copyright (C) Microsoft Corporation. All rights reserved.'
88

9-
ModuleVersion = '1.19.4'
9+
ModuleVersion = '1.20.0'
1010
Description = 'Provides command-line access to the Windows Store Submission REST API.'
1111

1212
RootModule = 'StoreIngestionApi'

0 commit comments

Comments
 (0)